public function actionNoticeCount() { echo new ReturnInfo(RET_SUC, array('data' => Notice::Model()->count("targetUserid=:targetUserId AND readFlag = 1", array("targetUserId" => $this->apiUser->ID)))); }
public function actionNoticeCount() { if (Yii::app()->request->isAjaxRequest) { echo Notice::Model()->count("targetUserid=:targetUserId AND readFlag = 1", array(":targetUserId" => Yii::app()->user->id)); } }