Example #1
0
 /**
  *  赞
  */
 public function actionPraise()
 {
     if (!isset($_POST['uid']) || !$_POST['uid']) {
         $this->_exit($this->_error['20007'], '20007');
     }
     if (!isset($_POST['tid']) || !$_POST['tid']) {
         $this->_exit($this->_error['20057'], '20057');
     }
     $uid = trim($_POST['uid']);
     $tid = trim($_POST['tid']);
     $nickname = UserInfo::model()->getNickname($uid);
     $res = Trends::model()->addPraise($tid, $uid);
     if ($res) {
         $this->_exit($this->_error['20000'], '20000', $nickname, 'nickname');
     }
     $this->_exit($this->_error['20059'], '20059');
 }
Example #2
0
 /**
  * 删除动态
  */
 public function actionDeleteTrends()
 {
     if (!isset($_POST['uid']) || !$_POST['uid']) {
         $this->_exit($this->_error['20007'], '20007');
     }
     if (!isset($_POST['tid']) || !$_POST['tid']) {
         $this->_exit($this->_error['20057'], '20057');
     }
     $uid = trim($_POST['uid']);
     $tid = trim($_POST['tid']);
     $res = Trends::model()->deleteTrends($uid, $tid);
     if ($res) {
         $this->_exit($this->_error['20000'], '20000');
     }
     $this->_exit($this->_error['21000'], '21000');
 }