Commit 6d0eda3c authored by hujun's avatar hujun

Merge branch 'test' into test-hujun1.15

# Conflicts: # application/api/controller/Member.php # application/model/Users.php
parents 68c90527 d8095bf0
......@@ -232,11 +232,19 @@ class Member extends Basic
if (!empty($user_data->id) && ($user_data->status != -1)) {
return $this->response(101, '该手机号已注册');
}
<<<<<<< HEAD
if ($this->request->param('code') == $code && $code != '') {
$referrer_source = $this->request->param('referrer_source');
$referrer_id = $this->request->param('referrer_id');
=======
if ($this->request->param('code') == $code && $code != '') {
$referrer_source = $this->request->param('referrer_source');
$referrer_id = $this->request->param('referrer_id');
>>>>>>> test
if (!isset($user_data->status) && ($user_data->status != -1)) {
if ($referrer_source == 20) {
//经纪人id 计算佣金的字段
......
......@@ -139,17 +139,22 @@ class Broker extends Basic
$content = $params['content'];
$labels_id = $params['labels_id'];
$user_id = $params['user_id'];
$agent_id = $params['agent_id'];
$type = $params['type'];
$agent_id = $params['agent_id'];
$user_status = $params['user_status'];
$type = $params['type'];//0电话跟进 1普通跟进
//主表查询商铺详细信息
$UPhoneFollowPp = new UPhoneFollowPp();
$UPhoneFollowPp->content =$content;
$UPhoneFollowPp->content = $content;
$UPhoneFollowPp->labels_id = $labels_id;
$UPhoneFollowPp->user_id =$user_id;
$UPhoneFollowPp->agent_id =$agent_id;
$UPhoneFollowPp->type =$type;
$UPhoneFollowPp->user_id = $user_id;
$UPhoneFollowPp->agent_id = $agent_id;
$UPhoneFollowPp->type = $type;
$UPhoneFollowPp->user_status = $user_status;
$UPhoneFollowPp->save();
//dump($UPhoneFollowPp->id);exit;
//跟进,对客户状态进行更新 0:求租;1:已租;-1:无效
$Users = new Users();
$Users -> update_user_status(['id'=>$user_id,'user_status'=>$user_status]);
if ($UPhoneFollowPp->id) {
return $this->response("200", "success!", $UPhoneFollowPp->id);
......
......@@ -140,7 +140,7 @@ class Client extends Basic
//搜索客户--可以搜索自己的客户and 不在保护期的客户
// $where = " (agent_id in(0,{$params['agent_id']}) or agent_id is null or TIMESTAMPDIFF(MINUTE,create_time,'{$time}') > 2880 )
// and ( user_nick like '%{$params['search']}%' or user_phone like '%{$params['search']}%' ) ";
$where = " (agent_id in(0,{$params['agent_id']}) or agent_id is null or TIMESTAMPDIFF(MINUTE,create_time,'{$time}') > 0 )
$where = "agent_id in({$params['agent_id']} )
and ( user_nick like '%{$params['search']}%' or user_phone like '%{$params['search']}%' ) ";
$data['search'] = $params['search'];
}
......@@ -251,22 +251,26 @@ class Client extends Basic
if($search_type == '0')
{//客户电话
$conditions['user_phone'] = ['LIKE', "%$phone_or_name%"];
}elseif ($search_type == '1'){//客户电话
$conditions['user_nick'] = ['LIKE', "%$phone_or_name%"];
$conditions['user_phone'] = ['LIKE', $phone_or_name.'%'];
}elseif ($search_type == '1'){//客户
$conditions['user_nick'] = ['LIKE', $phone_or_name.'%'];
}
if ($search_type != '2')
{//全部客户
if($type == '0')
{//求租:0 ;已租:1 数据库0:求租;1:已租;-1:无效
$conditions['user_status'] = 0;
}else{//
$conditions['user_status'] = 1;
if($search_type == ''){
if($type == '0')
{//求租:0 ;已租:1 数据库0:求租;1:已租;-1:无效
$conditions['user_status'] = 0;
}else{//
$conditions['user_status'] = 1;
}
}
$user = new Users();
$user_res = $user->all_user($conditions,$pagesize,$pagenum);
$total = $user->all_user_count($conditions);
//dump($conditions);//exit;
}else{//跟进
$UPhoneFollowPp = new UPhoneFollowPp();
$user_res = $UPhoneFollowPp->all_user_search($phone_or_name,$pagesize,$pagenum);
......@@ -286,15 +290,15 @@ class Client extends Basic
{
$label[] = '我的';
}
/*dump($v['create_time']);
$time=strtotime(date("Y-m-d h:i:s"))-strtotime($v['create_time']);
dump(strtotime(date("Y-m-d h:i:s"))-strtotime($v['create_time']));//48时(h)=172800秒(s)
exit;*/
if((strtotime(date("Y-m-d h:i:s")) - strtotime($v['create_time'])) < 172800)
/*if((strtotime(date("Y-m-d h:i:s")) - strtotime($v['create_time'])) < 172800)
{
$label[] = '保护期内';
}*/
//无效客户不显示标签
if($v['user_status'] != -1){
$user_res[$k]['label'] = implode(',',$label);
}
$user_res[$k]['label'] = implode(',',$label);
}
}else{//跟进数据处理
foreach($user_res as $k=>$v)
......
......@@ -150,7 +150,7 @@ class Label extends Basic
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$labels = New ULabels;
$field = 'id,name,create_time';
$field = 'id,name,create_time,free';
$where['type'] = 1;
$result['data']['list'] = $labels->getList($pageNo, $pageSize, 'id DESC', $field, $where);
$result['data']['total'] = $labels->getTotal($where);
......
......@@ -347,4 +347,11 @@ class Users extends Model
->where($params)
->count();
}
/**
* 普通跟进,对客户状态进行更新
*/
public function update_user_status($conditions='')
{
return db('u_users')->update($conditions);
}
}
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