예제 #1
0
 public function actionSent()
 {
     Yii::beginProfile('messages_sent');
     $total = 0;
     $criteria = PmbApi::getSentCriteria(Yii::app()->user->id);
     $total = PmbApi::getSentItems(Yii::app()->user->id);
     if ($total) {
         $total = count($total);
     }
     $pages = new CPagination($total);
     $pages->pageSize = Yii::app()->params['resultsPerPage'];
     $pages->applyLimit($criteria);
     $messages = PmbMessages::model()->findAll($criteria);
     //$messages = PmbApi::getInbox(Yii::app()->user->id);
     $unread = PmbApi::getUnreadInboxCount(Yii::app()->user->id);
     $this->render('sent', array('messages' => $messages, 'unread' => $unread, 'pages' => $pages));
     Yii::endProfile('messages_sent');
 }
예제 #2
0
파일: PmbApi.php 프로젝트: romeo14/wallfeet
 public static function getMessageById($id)
 {
     return PmbMessages::model()->findByPk($id);
 }