コード例 #1
0
 public function addCensorLog($content)
 {
     $log = new LogUserProfileCensors();
     $log->u_id = $this->u_id;
     $log->cate = 'bank_card';
     $log->content = $content;
     $log->admin_id = Tools::getAdminId();
     $log->addLog();
 }
コード例 #2
0
 public function enable($id)
 {
     $status = Input::get('status', 0);
     $remark = Input::get('remark', '');
     try {
         $user = User::find($id);
         if (empty($user)) {
             throw new Exception("没有找到请求的用户", 10001);
         }
         $log = new LogUserProfileCensors();
         $log->u_id = $user->u_id;
         $log->cate = 'base';
         $log->admin_id = Tools::getAdminId();
         if ($status == 1) {
             $status = 1;
             $log->content = '用户状态修改为: 启用';
         } else {
             $status = -1;
             $log->content = '用户状态修改为: 禁用';
         }
         $log->addLog();
         $user->u_status = $status;
         $user->u_remark = $remark;
         $user->save();
         $re = Tools::reTrue('用户状态修改成功');
     } catch (Exception $e) {
         $re = Tools::reFalse($e->getCode(), '用户状态修改失败:' . $e->getMessage());
     }
     return Response::json($re);
 }