|
|
|
@ -38,16 +38,12 @@ class Controller extends BaseController |
|
|
|
} |
|
|
|
|
|
|
|
//检查代理商
|
|
|
|
$this->agent_id = Cache::get($appid); |
|
|
|
if (!$this->agent_id) { |
|
|
|
$this->error('商户不存在或已被禁用'); |
|
|
|
exit(); |
|
|
|
} |
|
|
|
$agent = Agent::query()->firstWhere(['id' => $this->agent_id, 'status' => 1]); |
|
|
|
$agent = Agent::query()->firstWhere(['appid' => $appid, 'status' => 1]); |
|
|
|
if (!$agent) { |
|
|
|
$this->error('商户不存在或已被禁用'); |
|
|
|
exit(); |
|
|
|
} |
|
|
|
$this->agent_id = $agent->id; |
|
|
|
} |
|
|
|
|
|
|
|
protected function success($data = [], $msg = 'success', $code = 0, $status = 200) |
|
|
|
@ -57,7 +53,7 @@ class Controller extends BaseController |
|
|
|
'msg' => $msg, |
|
|
|
'data' => $data, |
|
|
|
'status' => $status, |
|
|
|
'time' => microtime(true) - LARAVEL_START |
|
|
|
'debug_time' => microtime(true) - LARAVEL_START |
|
|
|
])->send(); |
|
|
|
} |
|
|
|
|
|
|
|
@ -68,7 +64,7 @@ class Controller extends BaseController |
|
|
|
'msg' => $msg, |
|
|
|
'data' => [], |
|
|
|
'status' => $status, |
|
|
|
'time' => microtime(true) - LARAVEL_START |
|
|
|
'debug_time' => microtime(true) - LARAVEL_START |
|
|
|
])->send(); |
|
|
|
} |
|
|
|
} |