Commit ad4700ff authored by hujun's avatar hujun

登陆默认城市

parent ce4f97b6
......@@ -127,13 +127,18 @@ class Login extends Basic
$this->m_agent->updateData($user_data['id'], $update_data);
$redis_ = RedisExt::getRedis();
$site_city = [];
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']);
$redis_->set("agent_site_id_" . $user_data['id'], $site_city[0]['city']);
} else {
$redis_->set("agent_city_" . $user_data['id'], '全部');
$redis_->set("agent_site_id_" . $user_data['id'], 10000);
}
$user_data['city'] = $site_city[0]['city'];
} 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