Exemple #1
0
 public function action_index()
 {
     TXEvent::on(onSql);
     $ids = array_keys($this->projectDAO->rightJoin($this->testDAO, ['type' => 'type'])->filter([['name' => 'test'], ['>=' => ['time' => time()]]])->query([['id' => 'projectId']], 'projectId'));
     $this->userDAO->filter(['projectId' => [2, 3, 4]])->query();
     $this->userDAO->leftJoin($this->projectDAO, ['projectId' => 'id'])->rightJoin($this->testDAO, [[], ['type' => 'type']])->filter([[], ['name' => 'test'], ['>=' => ['time' => time()]]])->query(['*']);
     $result = $this->userDAO->filter(['>=' => ['id' => 20], 'count' => 2])->limit(2)->query();
     TXLogger::info($result);
     $data = $this->getParam('test');
     $params = array('test' => $data);
     //        TXDatabase::start();
     //        $this->testDAO->add(['name'=>'rollback', 'userId'=>10, 'time'=>time(), 'type'=>2]);
     //        $this->userDAO->add(['name'=>'rollback']);
     //        TXDatabase::commit();
     return $this->display('main/test', $params);
 }
Exemple #2
0
 /**
  * 启动类
  */
 public static function init()
 {
     TXEvent::on(onException, ['TXEvent', 'onException']);
     TXEvent::on(onRequest, ['TXEvent', 'onRequest']);
 }