Exemplo n.º 1
0
 public function setIntroduceStatus()
 {
     $data = $this->request()->all();
     try {
         $userInfo = UserInfo::find($data['user_id']);
         if (!$userInfo) {
             return $this->rest()->error('不存在的用户');
         }
         $userInfo->introduce_status = $data['status'];
         if ($data['status'] == \App\Enum\User::INTRODUCE_OK) {
             $userInfo->introduce = $userInfo->new_introduce;
             $userInfo->new_introduce = NULL;
         }
         $userInfo->save();
         return $this->rest()->success(array(), '操作成功');
     } catch (\Exception $e) {
         return $this->rest()->error($e->getMessage());
     }
 }