public function actionaddcomment($postId, $comment)
 {
     $model = new CommentBussinessPage();
     $model->user_id = Yii::app()->user->userId;
     $model->post_id = $postId;
     $model->date = date('Y-m-d H:i:s');
     $model->comment = $comment;
     $model->save();
 }
예제 #2
0
 public function actionaddcomment($postId, $comment, $text)
 {
     if ($text == 'post') {
         $model = new CommentPost();
         $model->user_id = Yii::app()->user->userId;
         $model->post_id = $postId;
         $model->date = date('Y-m-d H:i:s');
         $model->comment = $comment;
         $model->save();
     } else {
         if ($text == 'page') {
             $model = new CommentBussinessPage();
             $model->user_id = Yii::app()->user->userId;
             $model->post_id = $postId;
             $model->date = date('Y-m-d H:i:s');
             $model->comment = $comment;
             $model->save();
         }
     }
 }