Commit 159bc7a8 authored by zhuwei's avatar zhuwei

客户来电统计H5

parent b69a5f88
......@@ -9,6 +9,7 @@ namespace app\api\controller;
use app\api\extend\Basic;
use app\model\AAgents;
use app\model\AUserCallAgent;
use think\Request;
......@@ -59,7 +60,32 @@ class CallAgent extends Basic
* @return \think\Response
*/
public function addUserCallAgentV2(){
$params = $this->params;
/*$params = array(
"user_id" => 1,
"agent_id" => 4,
);*/
if (!isset($params["phone"]) ) {
return $this->response("101", "请求参数错误");
}
$model = new AAgents();
$params_['phone'] = $params["phone"];
$agents_id = $model->getAgentsManagerID($params_);
//先判断是否已经存在数据
$insert["user_id"] = 0;
$insert["agent_id"] = $agents_id[0]['id'] ? $agents_id[0]['id'] : 0;
$insert["status"] = 0;
$res = $this->aUserCallAgent->saveUserCallAgent($insert);//int(1)
if ($res) {
return $this->response("200", "成功");
} else {
return $this->response("101", "失败");
}
}
}
\ No newline at end of file
......@@ -68,7 +68,8 @@ class Basic extends Controller
"api/getMarchInList",
"api/addSublet",
"api/getSiteListApp",
"api/recordCallNumShare"
"api/recordCallNumShare",
"api/addUserCallAgentV2"
);
/**
......
......@@ -426,6 +426,8 @@ Route::group('api', [
'getSiteListApp' => [ 'api/Site/getSiteList', [ 'method' => 'POST|GET' ] ], //获取站点列表 朱伟 2018-10-18
'addUserCallAgent' => [ 'api/CallAgent/addUserCallAgent', [ 'method' => 'POST|GET' ] ],//客户来电记录
'addUserCallAgentV2' => [ 'api/CallAgent/addUserCallAgentV2', [ 'method' => 'POST|GET' ] ],//客户来电记录h5
]);
......
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