|
|
|
@ -30,17 +30,18 @@ class Controller extends BaseController |
|
|
|
$this->user_id = Cache::get($auth); |
|
|
|
if ($this->user_id) { |
|
|
|
$user = User::query()->firstWhere(['id' => $this->user_id, 'status' => 1]); |
|
|
|
} |
|
|
|
if (empty($user)) { |
|
|
|
$this->error('用户不存在或已被禁用' . $this->user_id); |
|
|
|
$this->user_id = 0; |
|
|
|
$this->error('登录信息已过期,请重新登录')->send(); |
|
|
|
exit(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//检查代理商
|
|
|
|
$agent = Agent::query()->firstWhere(['appid' => $appid, 'status' => 1]); |
|
|
|
if (!$agent) { |
|
|
|
$this->error('商户不存在或已被禁用'); |
|
|
|
$this->error('商户不存在或已被禁用')->send(); |
|
|
|
exit(); |
|
|
|
} |
|
|
|
$this->agent_id = $agent->id; |
|
|
|
@ -54,7 +55,7 @@ class Controller extends BaseController |
|
|
|
'data' => $data, |
|
|
|
'status' => $status, |
|
|
|
'debug_time' => microtime(true) - LARAVEL_START |
|
|
|
])->send(); |
|
|
|
]); |
|
|
|
} |
|
|
|
|
|
|
|
protected function error($msg = 'error', $code = -1, $status = 500) |
|
|
|
@ -65,6 +66,6 @@ class Controller extends BaseController |
|
|
|
'data' => [], |
|
|
|
'status' => $status, |
|
|
|
'debug_time' => microtime(true) - LARAVEL_START |
|
|
|
])->send(); |
|
|
|
]); |
|
|
|
} |
|
|
|
} |