Commit 1e92ed8b authored by hujun's avatar hujun

登陆设置城市

parent 278a30fb
......@@ -4,8 +4,10 @@ namespace app\index\controller;
use app\api\untils\JwtUntils;
use app\api_broker\service\BrokerService;
use app\extra\RedisExt;
use app\index\extend\Basic;
use app\model\AAgents;
use app\model\ASite;
use app\model\AStore;
use app\model\AuthGroup;
use app\model\AuthRule;
......@@ -60,7 +62,7 @@ class Login extends Basic
}
$fields = 'a.id,a.store_id,a.auth_group_id,a.district_id,a.level,a.name,a.phone,a.sex,a.img,a.status,a.admin_off
,b.store_name,c.district_name';
,b.store_name,c.district_name,a.site_id';
try {
$where['password'] = md5($password);
......@@ -123,6 +125,15 @@ class Login extends Basic
$update_data['last_login_time'] = date('Y-m-d H:i:s');
$update_data['last_login_ip'] = $last_login_ip;
$this->m_agent->updateData($user_data['id'], $update_data);
$redis_ = RedisExt::getRedis();
if (!empty($user_data['site_id']) && $user_data['id'] != 1) {
$m_site = new ASite();
$site_city = $m_site->getSite('city', ['id'=>$user_data['site_id'], ['is_del'=>0]]);
$redis_->set("agent_city_" . $user_data['id'], $site_city[0]['city']);
} else {
$redis_->set("agent_city_" . $user_data['id'], '全部');
}
} catch (\Exception $e) {
return $this->response(101, '内部错误,请联系运营!' . $e->getMessage());
}
......
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