Exemplo n.º 1
0
 public function actionAuth()
 {
     $data = $this->post;
     if ($data['status'] != 3) {
         $date = date('Y-m-d', $data['vo']['create_time']);
         if ($data['type'] == 1) {
             $msg['message'] = '你已被举报,被举报内容:' . $data['vo']['content'] . ';被举报时间:' . $date . ';审核情况:情况属实;处理结果:给予警告一次;如有疑问请拨打客服电话023-68800997。';
         } elseif ($data['type'] == 2) {
             UserInformation::getInstance()->updateUserInfo($data['vo']['feedback_id'], ['report_flag' => 1]);
             $msg['message'] = '你已被举报,被举报内容:' . $data['vo']['content'] . ';被举报时间:' . $date . ';审核情况:情况属实;处理结果:资料卡标记;如有疑问请拨打客服电话023-68800997。';
         } elseif ($data['type'] == 3) {
             UserInformation::getInstance()->updateUserInfo($data['vo']['feedback_id'], ['report_flag' => 1]);
             User::getInstance()->editUserTableInfo($data['vo']['feedback_id'], ['status' => 3]);
             $msg['message'] = '你已被举报,被举报内容:' . $data['vo']['content'] . ';被举报时间:' . $date . ';审核情况:情况属实;处理结果:永久封禁;如有疑问请拨打客服电话023-68800997。';
         }
         // 此处处理发送给被举报人
         $msg['send_user_id'] = isset($_SESSION[USER_SESSION]['member']) ? $_SESSION[USER_SESSION]['member']['id'] : 1;
         $msg['receive_user_id'] = $data['vo']['feedback_id'];
         UserMessage::getInstance()->addMessage($msg);
         // 是否发送给举报人
         if (isset($data['ret']) && $data['ret'] == 'on') {
             $retMsg['send_user_id'] = isset($_SESSION[USER_SESSION]['member']) ? $_SESSION[USER_SESSION]['member']['id'] : 1;
             $retMsg['receive_user_id'] = $data['vo']['user_id'];
             $retMsg['message'] = '感谢您对本网站文明建设的支持,经查证情况属实,我们已对该账号做出相应处理';
             UserMessage::getInstance()->addMessage($retMsg);
         }
     } else {
         // 是否发送给举报人
         if (isset($data['ret']) && $data['ret'] == 'on') {
             $retMsg['send_user_id'] = isset($_SESSION[USER_SESSION]['member']) ? $_SESSION[USER_SESSION]['member']['id'] : 1;
             $retMsg['receive_user_id'] = $data['vo']['user_id'];
             $retMsg['message'] = '感谢您对本网站文明建设的支持,但因证据不足,暂时不予处理';
             UserMessage::getInstance()->addMessage($retMsg);
         }
     }
     if (Feedback::getInstance()->auth($data['id'], $data['status'])) {
         $this->renderAjax(['status' => 1, 'message' => '成功']);
     } else {
         $this->renderAjax(['status' => 0, 'message' => '失败']);
     }
 }
Exemplo n.º 2
0
 /**
  * 设置头像
  * @param $user_id
  * @param $where
  * @return int
  */
 public function setHeadPic($user_id, $where)
 {
     //var_dump($where);exit;
     $this->getDb()->createCommand()->update($this->tablePrefix . 'user_photo', ['is_head' => 0], ['user_id' => $user_id, 'is_head' => 1])->execute();
     $row = $this->getDb()->createCommand()->update($this->tablePrefix . 'user_photo', ['is_head' => 1], ['id' => $where['id']])->execute();
     return $row ? UserInformation::getInstance()->updateUserInfo($user_id, ['head_pic' => $where['thumb_path']]) : false;
 }
Exemplo n.º 3
0
 /**
  * 开通服务(修改余额,到期时间,等级)
  * @param $user_id
  * @param $orderInfo
  * @param int $level
  * @return bool
  * @throws \yii\db\Exception
  */
 public function changeMatureTime($user_id, $orderInfo, $level = 0, $isAdmin = false)
 {
     $goods = ArrayHelper::toArray(ChargeGoods::getInstance()->findOne($orderInfo['charge_goods_id']));
     $userInfo = $this->getUserById($user_id);
     //  订单金额是否大于余额
     if (!$isAdmin) {
         if ($orderInfo['money'] > $userInfo['balance']) {
             return false;
         }
     }
     $db = $this->getDb();
     $transaction = $db->beginTransaction();
     // 启动事务
     // 计算时间
     $time = $goods['value'] * 30 * 24 * 3600;
     // vip时间(月)
     if (1 == $goods['giveType'] && $goods['give'] > 0) {
         $time += $goods['give'] * 24 * 3600;
         // 赠送的时间(天)
     }
     // 修改余额
     $user = $this->changeBalance($user_id, $goods['price']);
     if ($userInfo['honesty_value'] & 16) {
         $nData['honesty_value'] = intval($userInfo['honesty_value']) - 16;
         UserInformation::getInstance()->updateUserInfo($user_id, $nData);
     }
     // 修改到期时间
     $_user_information_table = $this->tablePrefix . 'user_information';
     // 表名
     $userInfo['mature_time'] = YII_BEGIN_TIME > $userInfo['mature_time'] ? YII_BEGIN_TIME + $time : $userInfo['mature_time'] + $time;
     $level = $goods['level'];
     if ($level != 0) {
         $sql = "UPDATE {$_user_information_table} SET info = JSON_REPLACE(info,'\$.level','" . $level . "'), mature_time = " . $userInfo['mature_time'] . " WHERE user_id={$user_id}";
     } else {
         $sql = "UPDATE {$_user_information_table} SET mature_time = " . $userInfo['mature_time'] . " WHERE user_id={$user_id}";
     }
     $info = $db->createCommand($sql)->execute();
     if ($user && $info) {
         $transaction->commit();
         // 写入用户消费日志表
         $goods['receive_name'] = '嘉瑞百合缘';
         $goods['type'] = 1;
         ConsumptionLog::getInstance()->addConsumptionLog($user_id, $goods);
         return true;
     } else {
         $transaction->rollBack();
         return false;
     }
 }
Exemplo n.º 4
0
 public function actionEasyEditInformation()
 {
     if ($result = UserInformation::getInstance()->editUserByInfo($this->post)) {
         $this->renderAjax(['status' => 1, 'data' => $result, 'msg' => '成功']);
     } else {
         $this->renderAjax(['status' => 0, 'data' => $result, 'msg' => '失败']);
     }
 }
Exemplo n.º 5
0
 public function checkPhoto($user_id, $type, $honesty_value)
 {
     if ($data = UserPhoto::getInstance()->getPhotoList($user_id, $type, 1)) {
         if ($data[0]['is_check'] == 1) {
             if ($type == 5) {
                 $honesty_value = $honesty_value + 2;
             } elseif ($type == 4) {
                 $honesty_value = $honesty_value + 4;
             } elseif ($type == 6) {
                 $honesty_value = $honesty_value + 8;
             }
             UserInformation::getInstance()->updateUserInfo($user_id, ['honesty_value' => $honesty_value]);
             return 1;
         } elseif ($data[0]['is_check'] == 0) {
             return 0;
         } else {
             return 2;
         }
     } else {
         return '';
     }
 }