public function indexAction()
 {
     //用Init::getInstance()->config['Domain']['baidu']['host'];
     $curl = new HttpHandle('http://m.fang.com/zhishi/');
     //TODO修改Socket类的bug
     print_r($curl->output);
     // echo '<hr/>indexAction<br/>';
     /*if (isset($_GET['key1']) && isset($_GET['key1'])) {
     			echo $_GET['key1'].'<br/>';
     			echo $_GET['key2'];
     		}
     		
     		var_dump($this->config['DataBase']);
     		var_dump($this->config['Model']);*/
     echo '<hr/>';
     $db = Factory::getDatabase();
     $res = $db->query("select * from user limit 2");
     while ($row = mysqli_fetch_assoc($res)) {
         echo "id: {$row['id']} <br>";
         echo "name: {$row['name']} <br>";
         echo "phone: {$row['mobile']} <br>";
         echo "reg: {$row['regtime']} <br>";
     }
     //TODO实现数组
     //$res = array('0'=>'a','1'=>'b');
     $this->assign('res', 'first assign');
     $this->display('admin/index.php');
 }
Beispiel #2
0
 /**
  * 写入日志到日志表
  *
  * @access public
  * @param array $log
  * @return bool|int
  */
 public function add($log)
 {
     $tablename = Application::app()->getConfig()->application->queue->log->tablename;
     $table = Factory::table($tablename);
     $table->insert($log);
     $lastInsertValue = $table->getLastInsertValue();
     if ($lastInsertValue) {
         return $lastInsertValue;
     } else {
         return false;
     }
 }
Beispiel #3
0
 /**
  * 用户头像
  */
 public function updateThumb($params)
 {
     return Factory::table('member')->get(array('id' => $params['memberid']))->mergeData(array('thumb' => $params['thumb']))->save();
 }
Beispiel #4
0
 public function __construct($table)
 {
     $this->_db = \core\Factory::getDatabase();
     $this->_table = $table;
 }