Commit b514ee5c authored by clone's avatar clone

bug

parent 20620bf2
......@@ -12,6 +12,7 @@ namespace app\api_broker\extend;
use app\extra\RedisExt;
use app\model\AAgents;
use app\model\GOperatingRecords;
use think\Exception;
use UnexpectedValueException;
use InvalidArgumentException;
use think\Controller;
......@@ -114,14 +115,19 @@ class Basic extends Controller
*/
public function getCity($agentId)
{
$redis_ = RedisExt::getRedis();
if ($redis_) {
$city = $redis_->get("agent_city_" . $agentId);
$this->city = empty($city) ? "上海市" : $city;
} else {
try {
$redis_ = RedisExt::getRedis();
if ($redis_) {
$city = $redis_->get("agent_city_" . $agentId);
$this->city = empty($city) ? "上海市" : $city;
} else {
$this->city = "上海市";
}
} catch (Exception $exception) {
$this->city = "上海市";
}
}
/**
......
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