Commit 41cdd145 authored by hujun's avatar hujun

2

parent 68296667
......@@ -11,7 +11,6 @@ namespace app\api_broker\extend;
*/
use app\extra\RedisExt;
use app\model\AAgents;
use app\model\ASite;
use app\model\GOperatingRecords;
use think\Exception;
use UnexpectedValueException;
......
......@@ -11,7 +11,6 @@ namespace app\index\extend;
*/
use app\extra\RedisExt;
use app\model\AAgents;
use app\model\ASite;
use app\model\GHousesToAgents;
use app\model\GOperatingRecords;
use app\model\Users;
......@@ -299,7 +298,7 @@ class Basic extends Controller
public function getCity($agentId)
{
try {
if (empty($this->userId)) {
if (empty($agentId)) {
return ; //没有登陆
}
......@@ -310,21 +309,13 @@ class Basic extends Controller
}
if(empty($this->city) || empty($this->siteId)){
$m_agent = new AAgents();
$m_site = new ASite();
$site_id = $m_agent->getAgentsById($agentId, 'site_id');
if ($site_id) {
$this->siteId = $site_id;
$city = $m_site->getSiteById($site_id, 'city');
if ($city) {
$this->city = $city;
} else {
echo json_encode(array( "code" => "300", "msg" => '账号位置信息错误,请联系运营', "data" => [], "type" => "json" ));
exit;
}
} else {
echo json_encode(array( "code" => "300", "msg" => '账号位置信息错误,请联系运营', "data" => [], "type" => "json" ));
$site_city = $m_agent->getAgentsSite(['a.id'=>$agentId], 'a.site_id,b.city');
if (empty($site_city['city']) || empty($site_city['site_id'])) {
echo json_encode(array( "code" => "300", "msg" => '账号位置信息错误,请联系运营', "data" => [], "type" => "json" ));
exit;
} else {
$this->city = $site_city['city'];
$this->siteId = $site_city['site_id'];
}
}
} catch (\Exception $exception) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment