Exemplo n.º 1
0
 public function actionDoDelNotify()
 {
     $msg_id = Yii::app()->request->getQuery('notify_id');
     $model = new Notify();
     $notify = $model->loadMsg($msg_id);
     $return = $msg->delNotify();
     YiicmsHelper::goBack();
     #echo $return;
 }
Exemplo n.º 2
0
 /**
  * 好友添加
  */
 public function actionAdd()
 {
     $model = new Friend();
     $uid = Yii::app()->user->id;
     $fuid = Yii::app()->request->getParam('uid');
     $msg = '';
     //不允许加自己好友
     if ($fuid == $uid) {
         $msg = '不允许自己加自己好友...';
     }
     $t = Yii::app()->request->getParam('t');
     //加好友的权限设置
     if ($t != "agree") {
         //$model->__checkeFriendPrivacy($fuid);
     }
     //检查好友状态
     $is_add = $model->checkFriendStatus($uid, $fuid);
     if ("1" === $is_add) {
         $msg = '你们已经是好友了...';
     } elseif ("0" === $is_add) {
         $msg = '等待验证中...';
     }
     //对方已经发过请求了,直接就加为好友
     if ("0" === $model->checkFriendStatus($fuid, $uid)) {
         //并且弹出好友分组页面
         //$model->__straightAddFrends($fuid,intval($_GET['nid']));
     }
     $model->fuid = $fuid;
     if (isset($_POST['Friend'])) {
         $model->attributes = $_POST['Friend'];
         if ($model->save()) {
             YiicmsHelper::goBack();
             #$this->redirect(array('list'));
         }
     }
     $data = array('model' => $model, 'msg' => $msg);
     if (Yii::app()->request->isAjaxRequest) {
         $this->renderPartial('add', $data);
     } else {
         $this->render('add', $data);
     }
 }