Commit 4ab2e94b authored by zhuwei's avatar zhuwei

1

parent a653d25a
...@@ -10,6 +10,7 @@ use app\index\service\BrokerService; ...@@ -10,6 +10,7 @@ use app\index\service\BrokerService;
use app\index\service\UserService; use app\index\service\UserService;
use app\model\AAgents; use app\model\AAgents;
use app\model\GOperatingRecords; use app\model\GOperatingRecords;
use app\model\OfficeUPhoneFollowUpTemporary;
use app\model\UPhoneFollowUp; use app\model\UPhoneFollowUp;
use app\model\UPhoneFollowUpTemporary; use app\model\UPhoneFollowUpTemporary;
use app\model\Users; use app\model\Users;
...@@ -464,35 +465,38 @@ class Member extends Basic{ ...@@ -464,35 +465,38 @@ class Member extends Basic{
/** /**
* 添加跟进 * 添加跟进
*
* @return \think\Response * @return \think\Response
*/ */
public function pcAddFollow(){ public function pcAddFollow(){
$status = 200;
$msg = '成功!';
$params = $this->request->param(); $params = $this->request->param();
if(empty($params['content']) || empty($params['user_id'])) { $checkResult = $this->validate($params, "MemberValidate.pcAddFollow");
return $this->response(101, $msg = '缺少参数', $params); if (true !== $checkResult) {
return $this->response(101, $checkResult);
} }
//$params['id'] = '';
$params['labels_id'] = 0; $params['labels_id'] = 0;
$params['agent_id'] = Session::get("user_info.id"); $params['agent_id'] = Session::get("user_info.id");
$params['type'] = 1; $params['type'] = 1;
$params['agent_id'] = $this->userId; $params['agent_id'] = $this->userId;
// $model = new UPhoneFollowUp($this->siteId);
$s_phone_follow_up = new UPhoneFollowUpTemporary($this->siteId);
$result = $s_phone_follow_up->savePhoneFollow($params);
//$redis = RedisExt::getRedis(); if($params['entrust_type'] == 1){
//$user_key = 'call_phone_user_'.date('Y-m-d'); $model = new OfficeUPhoneFollowUpTemporary($this->siteId);
//$hash_key = $this->userId.'-'.$params['user_id']; }else{
//$redis->hDel($user_key, $hash_key); $model = new UPhoneFollowUpTemporary($this->siteId);
$redis_service = new RedisCacheService(); }
$redis_service->delRecordCallRedis($this->userId, $params['user_id'], $this->siteId); $result = $model->savePhoneFollow($params);
return $this->response($status, $msg, $params); big_log($result);
if($result){
$redis_service = new RedisCacheService();
$redis_service->delRecordCallRedis($this->userId, $params['user_id'], $this->siteId);
return $this->response(200, '成功!', $params);
}else{
$redis_service = new RedisCacheService();
$redis_service->delRecordCallRedis($this->userId, $params['user_id'], $this->siteId);
return $this->response(200, '成功!', $params);
}
} }
......
...@@ -14,7 +14,7 @@ class MemberValidate extends Validate ...@@ -14,7 +14,7 @@ class MemberValidate extends Validate
{ {
protected $regex = [ 'phone' => '/^1[23456789]{1}\d{9}$/' ]; protected $regex = [ 'phone' => '/^1[23456789]{1}\d{9}$/' ];
protected $rule = [ protected $rule = [ //content user_id entrust_type
'agent_id_for_bind' => 'require|number|gt:0', 'agent_id_for_bind' => 'require|number|gt:0',
'user_nick' => 'length:0,80', 'user_nick' => 'length:0,80',
'user_name' => 'length:0,80', 'user_name' => 'length:0,80',
...@@ -26,6 +26,9 @@ class MemberValidate extends Validate ...@@ -26,6 +26,9 @@ class MemberValidate extends Validate
'source_intro'=>'in:0,1,2,3,4,5,6,7', 'source_intro'=>'in:0,1,2,3,4,5,6,7',
'user_status'=>'in:0,1,-1', 'user_status'=>'in:0,1,-1',
'user_label' => 'in:0,1,2', 'user_label' => 'in:0,1,2',
'content' => 'require',
'user_id' => 'require|between:1,9999999999',
'entrust_type' => 'require|number',
]; ];
protected $message = [ protected $message = [
...@@ -42,11 +45,20 @@ class MemberValidate extends Validate ...@@ -42,11 +45,20 @@ class MemberValidate extends Validate
'source.in'=>'注册来源参数错误', 'source.in'=>'注册来源参数错误',
'source_intro.in' => '来源简述参数错误', 'source_intro.in' => '来源简述参数错误',
'user_status.in' => '客户状态参数错误', 'user_status.in' => '客户状态参数错误',
'user_label.in' => '用户标签' 'user_label.in' => '用户标签',
'content.require' => '内容不能为空',
'user_id.require' => 'user_id不能为空',
'user_id.between' => 'user_id必须在1-9999999999之间',
'entrust_type.require' => 'entrust_type不能为空',
'entrust_type.number' => 'entrust_type只能为数字',
]; ];
protected $scene = [ protected $scene = [
'getUserList' => [ 'agent_id_for_bind' ], 'getUserList' => [ 'agent_id_for_bind' ],
'add' => 'user_phonp,user_name,user_nick,user_pswd,sex,referrer_source,source,source_intro,user_status,user_label' 'add' => 'user_phonp,user_name,user_nick,user_pswd,sex,referrer_source,source,source_intro,user_status,user_label',
'pcAddFollow' => 'content,user_id,entrust_type'
]; ];
} }
\ No newline at end of file
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