コード例 #1
0
 public function actionFind()
 {
     if (isset($_POST['flightNumber'])) {
         $current = date('Y-m-d');
         $flightNumber = $_POST['flightNumber'];
         $criteria = new CDbCriteria();
         $criteria->join = 'LEFT JOIN tbl_mry_user ON tbl_mry_plan.userId=tbl_mry_user.userId';
         $criteria->addCondition('flightNumber=:flightNumber');
         $criteria->params = array(':flightNumber' => $flightNumber);
         $criteria->order = 'startDate DESC';
         $UserModel = User::model();
         $total = $UserModel->count($criteria);
         $pager = new CPagination($total);
         $pager->pageSize = 10;
         $pager->applyLimit($criteria);
         $UserList = $UserModel->findAll($criteria);
         //删除PASSWORD相关的信息
         $dataFormat = new DataFormat();
         $format = $dataFormat->format($userList, null, null);
         $clientFlash = new ClientFlash();
         if ($total > 0) {
             $clientFlash->pushMobile(0, $format);
         } else {
             _echo(3, 数据为空);
         }
     }
 }
コード例 #2
0
 public function actionCommentList($shareId)
 {
     $currentTime = time();
     $criteria = new CDbCriteria();
     $criteria->addCondition('shareId=:shareId');
     $criteria->params = array(':shareId' => $shareId);
     $criteria->order = 't.commentId DESC';
     $comment = Comment::model();
     $total = $comment->count($criteria);
     $pager = new CPagination($total);
     $pager->pageSize = 10;
     $pager->applyLimit($criteria);
     $commentList = $comment->findAll($criteria);
     $dataFormat = new DataFormat();
     $format = array();
     $clientFlash = new ClientFlash();
     $format = $dataFormat->format($commentList);
     if ($total > 0) {
         $clientFlash = new ClientFlash();
         $clientFlash->pushMobile(0, $format);
     } else {
         _echo(3, '数据为空');
     }
 }