Commit 457b77b4 authored by clone's avatar clone

1

parent f4a727a5
......@@ -31,6 +31,8 @@ use app\model\Evaluate;
use app\model\GOperatingRecords;
use app\model\NoteLog;
use app\model\OBargainModel;
use app\model\OfficeFollowUpLogModel;
use app\model\OfficeUPhoneFollowUp;
use app\model\SecretReport;
use app\model\UPhoneFollowUp;
use app\model\UPhoneFollowUpTemporary;
......@@ -460,6 +462,61 @@ class Broker extends Basic
}
}
/**客户电话跟进
* @return \think\Response
* @throws Exception
* @throws \think\exception\PDOException
*/
public function addUserPhoneFollowUpV2()
{
$params = $this->params;
/* $params = array(
'content' => '跟进内容',
'labels_id' => 1,//g_labels表主键
'user_id' => 1,
'agent_id' => 1,
'type' => 1,//0电话跟进 1普通跟进
'user_status' => 1,//客户状态
'entrust_type' => 1,//委托类型 0找铺 1找办公楼
);*/
$checkResult = $this->validate($params, "BrokerValidate.add_phone_follow_up_verify");
if (true !== $checkResult) {
return $this->response("300", $checkResult);
}
if ($params['agent_id'] != $this->agentId) {
return $this->response("101", "失败!");
}
$user_id = $params['user_id'];
$user_status = $params['user_status'];
$entrust_type = $params["entrust_type"];
$Users = new Users();
$result = [];
if($entrust_type == 0){
$s_phone_follow_up = new UPhoneFollowUpTemporary($this->siteId);
$result = $s_phone_follow_up->savePhoneFollow($params);
}else{
$office_follow_up = new OfficeUPhoneFollowUp($this->siteId);
$result = $office_follow_up->savePhoneFollow($params);
}
if ($result > 0) {
//跟进,对客户状态进行更新 0:求租;1:已租;-1:无效
$Users->update_user_status([ 'id' => $user_id, 'user_status' => $user_status ]);
$redis_service = new RedisCacheService();
$redis_service->delRecordCallRedis($this->agentId, $params['user_id'], $this->siteId);
return $this->response("200", "success!", $result);
} else {
return $this->response("101", "失败!");
}
}
/**
* 客户搜索
*
......
......@@ -17,6 +17,7 @@ use app\model\OfficeUPhoneFollowUp;
use app\model\ULabels;
use app\model\UPhoneFollowUp;
use app\model\UPhoneFollowUpTemporary;
use app\model\Users;
use app\search\service\SearchService;
use app\task\controller\FollowUpTask;
use think\Log;
......
<?php
namespace app\api_broker\validate;
use think\Validate;
/**
......@@ -8,32 +10,36 @@ use think\Validate;
* Date: 2018/8/3
* Time: 上午10:11
*/
class BrokerValidate extends Validate{
class BrokerValidate extends Validate
{
protected $rule = [
'type' => 'require|in:0,1,2',
'agent_id' => 'require|number|gt:0',
'labels_id' => 'number',
'user_id' => 'require|number|gt:0',
// 'user_status' => 'require|in:-1,0,1'
'type' => 'require|in:0,1,2',
'agent_id' => 'require|number|gt:0',
'labels_id' => 'number',
'user_id' => 'require|number|gt:0',
'entrust_type' => 'require|in:0,1,2',
// 'user_status' => 'require|in:-1,0,1'
];
protected $message = [
'type.require' => '网络异常,请再次提交!错误代码:bv1',//type为必填字段
'type.in' => '网络异常,请再次提交!错误代码:bv2',//type只能0,1,2中间
'agent_id.require' => '网络异常,请再次提交!错误代码:bv3',//agent_id为必填字段
'agent_id.number' => '网络异常,请再次提交!错误代码:bv4',//agent_id只能为数字
'agent_id.gt' => '网络异常,请再次提交!错误代码:bv10',//agent_id必须大于0
'labels_id.number' => '普通标签为必选',//labels_id只能为数字
'user_id.require' => '网络异常,请再次提交!错误代码:bv6',//user_id为必填字段
'user_id.number' => '网络异常,请再次提交!错误代码:bv7',//user_id只能为数字
'user_id.gt' => '网络异常,请再次提交!错误代码:bv11',//user_id必须大于0
// 'user_status.require' => '状态标签为必选',//user_status为必填字段
// 'user_status.number' => '状态标签为必选'//user_status只能为数字
'type.require' => '网络异常,请再次提交!错误代码:bv1',//type为必填字段
'type.in' => '网络异常,请再次提交!错误代码:bv2',//type只能0,1,2中间
'agent_id.require' => '网络异常,请再次提交!错误代码:bv3',//agent_id为必填字段
'agent_id.number' => '网络异常,请再次提交!错误代码:bv4',//agent_id只能为数字
'agent_id.gt' => '网络异常,请再次提交!错误代码:bv10',//agent_id必须大于0
'labels_id.number' => '普通标签为必选',//labels_id只能为数字
'user_id.require' => '网络异常,请再次提交!错误代码:bv6',//user_id为必填字段
'user_id.number' => '网络异常,请再次提交!错误代码:bv7',//user_id只能为数字
'user_id.gt' => '网络异常,请再次提交!错误代码:bv11',//user_id必须大于0
// 'user_status.require' => '状态标签为必选',//user_status为必填字段
// 'user_status.number' => '状态标签为必选'//user_status只能为数字
'entrust_type.require' => '客户找铺类型不能为空',//type为必填字段
'entrust_type.in' => '客户找铺类型错误',//type只能0,1,2中间
];
protected $scene = [
// 'add_phone_follow_up_verify' => [ 'labels_id', 'user_id', 'agent_id', 'user_status', 'type' ],
'add_phone_follow_up_verify' => [ 'labels_id', 'user_id', 'agent_id', 'type' ],
'add_phone_follow_up_verify' => ['labels_id', 'user_id', 'agent_id', 'type', 'entrust_type'],
];
}
......@@ -714,6 +714,7 @@ Route::group('broker', [
'getLabelsList' => ['api_broker/label/getLabelsList', ['method' => 'get']], //标签列表
'add_phone_follow_up' => ['api_broker/broker/add_phone_follow_up', ['method' => 'get|post']],//新增-客户电话跟进
'addUserPhoneFollowUp' => ['api_broker/broker/addUserPhoneFollowUp', ['method' => 'get|post']],//新增-客户电话跟进
'addUserPhoneFollowUpV2' => ['api_broker/broker/addUserPhoneFollowUpV2', ['method' => 'get|post']],//新增-客户电话跟进
'useraction_search' => ['api_broker/broker/useraction_search', ['method' => 'get|post']],//客户电话跟进
'vip' => ['api_broker/broker/vip', ['method' => 'get|post']],
'userStateSearch' => ['api_broker/broker/userStateSearch', ['method' => 'get|post']],//新增-客户电话跟进
......@@ -1003,8 +1004,8 @@ Route::group('office', [
'bargainMain' => ['api_broker/OfficeBargain/bargainList', ['method' => 'POST|GET']],
'bargainMainV2' => ['api_broker/OfficeBargain/bargainListV2', ['method' => 'POST|GET']],
'userFollowUpList' => ['api_broker/OfficeHomePageLog/userFollowUpList', ['method' => 'POST|GET']],
'houseFollowUpList' => ['api_broker/OfficeHomePageLog/houseFollowUpList', ['method' => 'POST|GET']],
'userFollowUpList' => ['api_broker/OfficeHomePageLog/userFollowUpList', ['method' => 'POST|GET']],
'houseFollowUpList' => ['api_broker/OfficeHomePageLog/houseFollowUpList', ['method' => 'POST|GET']],
]);
Route::group('office_index', [
......
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