Browse Source

优化代理商部分判断

dev
李可松 5 years ago
parent
commit
cd33c3f398
  1. 12
      app/Http/Controllers/Controller.php

12
app/Http/Controllers/Controller.php

@ -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();
}
}
Loading…
Cancel
Save