Commit 4a323edb authored by zw's avatar zw

跟进区分城市

parent 4c532c49
...@@ -29,6 +29,7 @@ class Basic extends Controller ...@@ -29,6 +29,7 @@ class Basic extends Controller
public $request; public $request;
public $params; public $params;
public $city; public $city;
public $siteId;
protected $authToken; protected $authToken;
/** /**
...@@ -121,13 +122,15 @@ class Basic extends Controller ...@@ -121,13 +122,15 @@ class Basic extends Controller
try { try {
$redis_ = RedisExt::getRedis(); $redis_ = RedisExt::getRedis();
if ($redis_) { if ($redis_) {
$city = $redis_->get("agent_city_" . $agentId); $this->city = $redis_->get("agent_city_" . $agentId);
$this->city = empty($city) ? "上海市" : $city; $this->siteId = $redis_->get("agent_site_id_" . $agentId);
} else { }
$this->city = "上海市"; if(empty($this->city) || empty($this->siteId)){
//取数据库
} }
} catch (Exception $exception) { } catch (Exception $exception) {
$this->city = "上海市"; echo json_encode(array( "code" => "300", "msg" => $exception, "data" => [], "type" => "json" ));
exit;
} }
......
...@@ -2,10 +2,8 @@ ...@@ -2,10 +2,8 @@
namespace app\index\controller; namespace app\index\controller;
use app\extra\RedisExt;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\model\GBusinessDistrict; use app\model\GBusinessDistrict;
use app\model\UPhoneFollowPp;
use think\Log; use think\Log;
/** /**
...@@ -92,45 +90,5 @@ class BatchProcessing extends Basic ...@@ -92,45 +90,5 @@ class BatchProcessing extends Basic
} }
/**
* 设置电话跟进保护期
*/
public function updatePhoneFollowUpIsShow(){
$success_num_ = 0;
$success_num = 0;
$model = new UPhoneFollowPp();
$redis = RedisExt::getRedis();
//$redis->set('set_user_save_time_1', 1, 24 * 3600);
$field = 'id,user_id';
$params = '';
$result = $model->getPhoneFollow($field, $params);
//dump($result);
foreach($result as $k=>$v)
{
$success_num_ ++;
//$is_show = 1 ;
//todo 查询redis 是否过保护期
$redis_res = $redis->get('set_user_save_time_'. $v["id"]);//找到返回'1' 找不到返回'false'
if($redis_res){
$success_num ++;
$is_show = 0 ;
//todo 更新记录
$insert=[];
$insert["id"] = $v["id"];
$insert["is_show"] = $is_show;
$res = $model->updatePhoneFollow($insert);//int(1)
}
}
return $this->response("200", "处理完成",['处理数'=>$success_num_,'修改数'=>$success_num]);
}
} }
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