Commit 219c9328 authored by hujun's avatar hujun

根据手机号判断

parent e81cca8a
......@@ -5,6 +5,7 @@ namespace app\api\controller;
use app\api\extend\Basic;
use app\api_broker\service\VerifyRepetitionService;
use app\model\AAgents;
use app\model\AAgentsPhone;
use app\model\Evaluate;
use app\model\EvaluateSign;
use app\model\OBargainModel;
......@@ -318,23 +319,28 @@ class Broker extends Basic
$data['data'] = [];
$data['msg'] = '';
if ($this->params['agent_id'] > 0) {
if (empty($this->params['phone'])) {
$data['status'] = 101;
$data['msg'] = 'phone is null';
} else {
$m_agents = new AAgents();
$redis = new VerifyRepetitionService();
$is = $redis->verifyStart(2, $this->params['phone'], 0);
if ($is) {
$m_agents = new AAgents();
$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', '', ['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'];
}
$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, $agents_data['id']);
}
} else {
$data['status'] = 101;
$data['msg'] = 'agent_id is null';
}
return $this->response($data['status'], $data['msg'], $data['data']);
......
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