Commit af882aac authored by zw's avatar zw

Merge branch 'test'

parents 6940e98b 16a3697d
...@@ -5,6 +5,7 @@ namespace app\api\controller; ...@@ -5,6 +5,7 @@ namespace app\api\controller;
use app\api\extend\Basic; use app\api\extend\Basic;
use app\api_broker\service\VerifyRepetitionService; use app\api_broker\service\VerifyRepetitionService;
use app\model\AAgents; use app\model\AAgents;
use app\model\AAgentsPhone;
use app\model\Evaluate; use app\model\Evaluate;
use app\model\EvaluateSign; use app\model\EvaluateSign;
use app\model\OBargainModel; use app\model\OBargainModel;
...@@ -288,7 +289,7 @@ class Broker extends Basic ...@@ -288,7 +289,7 @@ class Broker extends Basic
if (empty($this->params['phone'])) { if (empty($this->params['phone'])) {
$agents_data = $m_agents->getAgentInfo('id,update_time,call_number', $this->params['agent_id']); $agents_data = $m_agents->getAgentInfo('id,update_time,call_number', $this->params['agent_id']);
} else { } else {
$agents_data = $m_agents->getAgentInfo('id,update_time,call_number', '', ['agent_id', $this->params['agent_id']]); $agents_data = $m_agents->getAgentInfo('id,update_time,call_number', '', ['agent_id'=>$this->params['agent_id']]);
} }
$insert_data['update_time'] = $agents_data['update_time']; $insert_data['update_time'] = $agents_data['update_time'];
...@@ -303,4 +304,47 @@ class Broker extends Basic ...@@ -303,4 +304,47 @@ class Broker extends Basic
return $this->response($data['status'], $data['msg'], $data['data']); return $this->response($data['status'], $data['msg'], $data['data']);
} }
/**
* 记录客户拨打经纪人次数(分享使用)
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function recordCallNumShare()
{
$data['status'] = 200;
$data['data'] = [];
$data['msg'] = '';
if (empty($this->params['phone'])) {
$data['status'] = 101;
$data['msg'] = 'phone is null';
} else {
$m_agents = new AAgents();
$redis = new VerifyRepetitionService();
$agents_data = $m_agents->getAgentInfo('id,update_time,call_number', '', ['phone'=>$this->params['phone']]);
if (empty($agents_data['id'])) {
$m_agent_phone = new AAgentsPhone();
$agent_data_phone = $m_agent_phone->getList(1, 1, '', 'agents_id', ['phone'=>$this->params['phone']]);
$agent_id = $agent_data_phone['agents_id'];
} else {
$agent_id = $agents_data['id'];
}
$is = $redis->verifyStart(2, $agent_id, 0);
if ($is) {
$agents_data = $m_agents->getAgentInfo('id,update_time,call_number', $agent_id);
$insert_data['update_time'] = $agents_data['update_time'];
$insert_data['call_number'] = $agents_data['call_number'] + 1;
$data['data'] = $m_agents->editData($insert_data, $agent_id);
}
}
return $this->response($data['status'], $data['msg'], $data['data']);
}
} }
...@@ -66,6 +66,8 @@ class Basic extends Controller ...@@ -66,6 +66,8 @@ class Basic extends Controller
"api/getVersionNoV2", "api/getVersionNoV2",
"api/getMarchInList", "api/getMarchInList",
"api/addSublet", "api/addSublet",
"api/getSiteListApp",
"api/recordCallNumShare"
); );
/** /**
......
...@@ -15,7 +15,7 @@ use app\extra\RedisExt; ...@@ -15,7 +15,7 @@ use app\extra\RedisExt;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\index\service\UserService; use app\index\service\UserService;
use app\model\AAgents; use app\model\AAgents;
use app\model\Agents; use app\model\AAgentsPhone;
use app\model\GOperatingRecords; use app\model\GOperatingRecords;
use app\model\Remarks; use app\model\Remarks;
use app\model\ULabels; use app\model\ULabels;
...@@ -48,19 +48,19 @@ class Remark extends Basic ...@@ -48,19 +48,19 @@ class Remark extends Basic
$u_phone_follow = new UPhoneFollowPp(); $u_phone_follow = new UPhoneFollowPp();
if (!empty($this->params['start_date']) && empty($this->params['end_date'])) { if (!empty($this->params['start_date']) && empty($this->params['end_date'])) {
$where['create_time'] = [ '> time', $this->params['start_date'] . ' 00:00:00' ]; $where['create_time'] = ['> time', $this->params['start_date'] . ' 00:00:00'];
} }
if (!empty($this->params['end_date']) && empty($this->params['start_date'])) { if (!empty($this->params['end_date']) && empty($this->params['start_date'])) {
$where['create_time'] = [ '< time', $this->params['end_date'] . ' 23:59:59' ];; $where['create_time'] = ['< time', $this->params['end_date'] . ' 23:59:59'];;
} }
if (!empty($this->params['end_date']) && !empty($this->params['start_date'])) { if (!empty($this->params['end_date']) && !empty($this->params['start_date'])) {
$where['create_time'] = [ 'between', [ $this->params['start_date'] . ' 00:00:00', $this->params['end_date'] . ' 23:59:59' ] ]; $where['create_time'] = ['between', [$this->params['start_date'] . ' 00:00:00', $this->params['end_date'] . ' 23:59:59']];
} }
if (!empty($this->params['content'])) { if (!empty($this->params['content'])) {
$where['content'] = [ 'LIKE', "%{$this->params['content']}%" ]; $where['content'] = ['LIKE', "%{$this->params['content']}%"];
} }
//跟进人名字 //跟进人名字
...@@ -68,7 +68,7 @@ class Remark extends Basic ...@@ -68,7 +68,7 @@ class Remark extends Basic
if (mb_strlen($this->params['remark_name']) < 2) { if (mb_strlen($this->params['remark_name']) < 2) {
return $this->response(101, '名字长度不足2位'); return $this->response(101, '名字长度不足2位');
} }
$agent_where['name'] = [ 'LIKE', '%' . $this->params['remark_name'] . '%' ]; $agent_where['name'] = ['LIKE', '%' . $this->params['remark_name'] . '%'];
} }
//跟进人手机号 //跟进人手机号
...@@ -114,7 +114,7 @@ class Remark extends Basic ...@@ -114,7 +114,7 @@ class Remark extends Basic
foreach ($agent_id_arr as $K => $v) { foreach ($agent_id_arr as $K => $v) {
$agent_id[] = $v['id']; $agent_id[] = $v['id'];
} }
$where['agent_id'] = [ 'in', $agent_id ]; $where['agent_id'] = ['in', $agent_id];
} }
} }
$field = 'id,user_id,create_time,content,user_status,labels_id,agent_id as f_agent_id'; $field = 'id,user_id,create_time,content,user_status,labels_id,agent_id as f_agent_id';
...@@ -137,30 +137,53 @@ class Remark extends Basic ...@@ -137,30 +137,53 @@ class Remark extends Basic
$is_outpace_call_num = 1; $is_outpace_call_num = 1;
} }
$model = new AAgents(); $model = new AAgents();
$result = $model->searchAgentsByKeyword("id,name,phone", [ "id" => $this->params["agent_id"]]); $result = $model->searchAgentsByKeyword("id,name,phone", ["id" => $this->params["agent_id"]]);
//$call = new CallPhoneService(); //$call = new CallPhoneService();
//$result = $call->getBindNum($v['user_phone'],$result[0]['phone']); //$result = $call->getBindNum($v['user_phone'],$result[0]['phone']);
//if($result != 0){ //if($result != 0){
// $is_outpace_call_num = 0; // $is_outpace_call_num = 0;
//} //}
$is_privacy = $redis->get('s_is_privacy');//判断是否当前经纪人跟当前客户是否有电话绑定 从redis查询
if(!empty($is_privacy)) { if ($is_outpace_call_num == 1) {
$call_key = 'call_'.$this->userId.'_'.$result[0]['phone'].'_'.$v['user_phone'].'_'.$is_privacy; $is_privacy = $redis->get('s_is_privacy');//判断是否当前经纪人跟当前客户是否有电话绑定 从redis查询
if (empty($result[0]['phone'])) {
$m_agent_phone = new AAgentsPhone();
$agent_phone = $m_agent_phone->getList(1, 1, '', 'phone', ['agent_id' => $this->userId]);
$phone = $agent_phone[0]['phone'];
} else {
$phone = $result[0]['phone'];
}
$call_key = 'call_' . $this->userId . '_' . $phone . '_' . $v['user_phone'] . '_' . $is_privacy;
$redis_res = $redis->get($call_key); $redis_res = $redis->get($call_key);
if(!empty($redis_res)){
$is_outpace_call_num = 0;
if ($is_outpace_call_num == 1) {
$is_privacy = $redis->get('s_is_privacy');//判断是否当前经纪人跟当前客户是否有电话绑定 从redis查询
if (empty($result[0]['phone'])) {
$m_agent_phone = new AAgentsPhone();
$agent_phone = $m_agent_phone->getList(1, 1, '', 'phone', ['agent_id' => $this->userId]);
$phone = $agent_phone[0]['phone'];
} else {
$phone = $result[0]['phone'];
}
$call_key = 'call_' . $this->userId . '_' . $phone . '_' . $v['user_phone'] . '_' . $is_privacy;
$redis_res = $redis->get($call_key);
if (empty($redis_res)) {
$is_outpace_call_num = 1;
}
} }
}//判断是否当前经纪人跟当前客户是否有电话绑定 从redis查询
$data['data']['list'][$k]['is_outpace_call_num'] = $is_outpace_call_num; $data['data']['list'][$k]['is_outpace_call_num'] = $is_outpace_call_num;
/* 判断当天被拨打是否超过5次,同时判断是否当前经纪人跟当前客户是否有电话绑定 end*/ /* 判断当天被拨打是否超过5次,同时判断是否当前经纪人跟当前客户是否有电话绑定 end*/
$data['data']['list'][$k]['user_phone'] = substr_replace($data['data']['list'][$k]['user_phone'], '****', 3, 4); $data['data']['list'][$k]['user_phone'] = substr_replace($data['data']['list'][$k]['user_phone'], '****', 3, 4);
} }
$data['data']['total'] = 40000; $data['data']['total'] = 40000;
return $this->response(200, '成功', $data); return $this->response(200, '成功', $data);
}
} }
/** /**
......
...@@ -351,6 +351,7 @@ Route::group('api', [ ...@@ -351,6 +351,7 @@ Route::group('api', [
//post broker //post broker
'appraiser' => [ 'api/broker/appraiser', [ 'method' => 'post' ] ], //评价经纪人 'appraiser' => [ 'api/broker/appraiser', [ 'method' => 'post' ] ], //评价经纪人
'recordCallNum' => [ 'api/broker/recordCallNum', [ 'method' => 'post' ] ], //记录拨打经纪人号码 'recordCallNum' => [ 'api/broker/recordCallNum', [ 'method' => 'post' ] ], //记录拨打经纪人号码
'recordCallNumShare' => [ 'api/broker/recordCallNumShare', [ 'method' => 'post' ] ], //记录拨打经纪人号码
//get member //get member
'logout' => [ 'api/member/logout', [ 'method' => 'get' ] ], 'logout' => [ 'api/member/logout', [ 'method' => 'get' ] ],
......
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
} }
//点击拨打 记录拨打次数 //点击拨打 记录拨打次数
$("#fix_tel").click(function() { $("#fix_tel").click(function() {
if($.cookie("isCallShop") != 'yes'){ // if($.cookie("isCallShop") != 'yes'){
$.ajax({ $.ajax({
url: '/api/recordCallNumShare', url: '/api/recordCallNumShare',
type: 'POST', type: 'POST',
...@@ -282,12 +282,12 @@ ...@@ -282,12 +282,12 @@
}, },
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
$.cookie("isCallShop",'yes',{ expires: 1}); // $.cookie("isCallShop",'yes',{ expires: 1});
} }
}); });
} // }
}); });
$("#fix_area_bottom_btn").click(function() { $("#fix_area_bottom_btn").click(function() {
......
...@@ -1527,7 +1527,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1527,7 +1527,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
}; };
}, },
error: function() { error: function() {
alert('error'); alert('error 客户跟进列表');
}, },
complete: function(xhr, textStatus){ complete: function(xhr, textStatus){
if(textStatus === 'timeout'){ if(textStatus === 'timeout'){
......
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