Commit b514ee5c authored by clone's avatar clone

bug

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