黄宗昌 2 年之前
父節點
當前提交
cf3da5c1f5
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      app/Http/Controllers/V1/UserController.php

+ 9 - 1
app/Http/Controllers/V1/UserController.php

xqd
@@ -52,7 +52,15 @@ class UserController extends Controller
      */
     public function show()
     {
-        $info = (new UserService())->show($this->userId);
+        $info = User::query()->where('id',$this->userId)->first();
+
+        if($info && !empty($info['end_time'])){
+           if(time() > strtotime($info['end_time'])){
+               $info->member_type == 1;
+               $info->save();
+           }
+        }
+
         $info->follow_count = UserFollow::query()->where('user_id',$this->userId)->count();
         return $this->success($info);
     }