|
|
@ -41,6 +41,33 @@ class Client extends Common{ |
|
|
return $this->fetch(); |
|
|
return $this->fetch(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//查询30天内 是否为第一报备人 |
|
|
|
|
|
public function searchClient() |
|
|
|
|
|
{ |
|
|
|
|
|
$id = Request::param('id'); |
|
|
|
|
|
//查询所有管理员(去除admin) |
|
|
|
|
|
$adminResult = Db::name('admin')->where('group_id', '<>', 1)->field('admin_id,username')->select(); |
|
|
|
|
|
$this->assign('adminResult', $adminResult); |
|
|
|
|
|
|
|
|
|
|
|
if (Request::isAjax()) { |
|
|
|
|
|
// |
|
|
|
|
|
$_data = Db::table('crm_leads')->where(['id' => $id])->field('house,building,number')->find(); |
|
|
|
|
|
if (empty($_data)) { |
|
|
|
|
|
return json(['code' => -200, 'msg' => '数据不存在!', 'data' => []]); |
|
|
|
|
|
} |
|
|
|
|
|
//小于30天判断 |
|
|
|
|
|
$now = date('Y-m-d H:i:s',strtotime('-1 month')); |
|
|
|
|
|
$data_list = Db::table('crm_leads')->where($_data)->where('at_time', '>', $now)->order('at_time','ASC')->select(); |
|
|
|
|
|
if (isset($data_list[0]['id']) && $id == $data_list[0]['id']) { |
|
|
|
|
|
$msg = ['code' => 0, 'msg' => '是否为第一报备:是', 'data' => []]; |
|
|
|
|
|
} else { |
|
|
|
|
|
$msg = ['code' => -200, 'msg' => '是否为第一报备:否', 'data' => []]; |
|
|
|
|
|
} |
|
|
|
|
|
return json($msg); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//(我的客户)列表 |
|
|
//(我的客户)列表 |
|
|
public function perCliList(){ |
|
|
public function perCliList(){ |
|
|
|
|
|
|
|
|
@ -73,14 +100,14 @@ class Client extends Common{ |
|
|
return $this->fetch('personclient/index'); |
|
|
return $this->fetch('personclient/index'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//成交客户列表 |
|
|
//成交客户列表 |
|
|
public function successCliList(){ |
|
|
public function successCliList(){ |
|
|
|
|
|
|
|
|
if(request()->isPost()){ |
|
|
if(request()->isPost()){ |
|
|
$where = []; |
|
|
$where = []; |
|
|
$where['issuccess'] = 1; |
|
|
$where['issuccess'] = 1; |
|
|
if(session('aid')!=1){ |
|
|
if(session('aid')!=1){ |
|
|
$where['pr_user'] = Session::get('username'); |
|
|
$where['pr_user'] = Session::get('username'); |
|
|
} |
|
|
} |
|
|
$key=input('post.key'); |
|
|
$key=input('post.key'); |
|
|
$page =input('page')?input('page'):1; |
|
|
$page =input('page')?input('page'):1; |
|
|
@ -100,7 +127,7 @@ class Client extends Common{ |
|
|
$this -> assign('khRankList',$khRankList); |
|
|
$this -> assign('khRankList',$khRankList); |
|
|
$this -> assign('khStatusList',$khStatusList); |
|
|
$this -> assign('khStatusList',$khStatusList); |
|
|
$this -> assign('xsSourceList',$xsSourceList); //线索/客户来源 |
|
|
$this -> assign('xsSourceList',$xsSourceList); //线索/客户来源 |
|
|
//查询所有管理员(去除admin) |
|
|
//查询所有管理员(去除admin) |
|
|
$adminResult = Db::name('admin')->where('group_id','<>', 1)->field('admin_id,username')->select(); |
|
|
$adminResult = Db::name('admin')->where('group_id','<>', 1)->field('admin_id,username')->select(); |
|
|
$this -> assign('adminResult',$adminResult); |
|
|
$this -> assign('adminResult',$adminResult); |
|
|
return $this->fetch('client/chengjiao'); |
|
|
return $this->fetch('client/chengjiao'); |
|
|
@ -273,14 +300,14 @@ class Client extends Common{ |
|
|
$data['pro'] = Request::param('pro'); |
|
|
$data['pro'] = Request::param('pro'); |
|
|
$data['city'] = Request::param('city'); |
|
|
$data['city'] = Request::param('city'); |
|
|
$data['area'] = Request::param('area'); |
|
|
$data['area'] = Request::param('area'); |
|
|
$data['house'] = Request::param('house'); |
|
|
$data['house'] = trim(Request::param('house')); |
|
|
$data['building'] = Request::param('building'); |
|
|
$data['building'] = trim(Request::param('building')); |
|
|
$data['number'] = Request::param('number'); |
|
|
$data['number'] = trim(Request::param('number')); |
|
|
|
|
|
|
|
|
$wdata = array( |
|
|
$wdata = array( |
|
|
'pro'=>$data['pro'], |
|
|
// 'pro'=>$data['pro'], |
|
|
'city'=>$data['city'], |
|
|
// 'city'=>$data['city'], |
|
|
'area'=>$data['area'], |
|
|
// 'area'=>$data['area'], |
|
|
'house'=>$data['house'], |
|
|
'house'=>$data['house'], |
|
|
'building'=>$data['building'], |
|
|
'building'=>$data['building'], |
|
|
'number'=>$data['number'] |
|
|
'number'=>$data['number'] |
|
|
@ -347,10 +374,13 @@ class Client extends Common{ |
|
|
if (Request::isAjax()){ |
|
|
if (Request::isAjax()){ |
|
|
$data = Request::param(); |
|
|
$data = Request::param(); |
|
|
$data['ut_time'] = date("Y-m-d H:i:s",time()); |
|
|
$data['ut_time'] = date("Y-m-d H:i:s",time()); |
|
|
|
|
|
$data['house'] = trim($data['house']); |
|
|
|
|
|
$data['building'] = trim($data['building']); |
|
|
|
|
|
$data['number'] = trim($data['number']); |
|
|
$wdata = array( |
|
|
$wdata = array( |
|
|
'pro'=>$data['pro'], |
|
|
// 'pro'=>$data['pro'], |
|
|
'city'=>$data['city'], |
|
|
// 'city'=>$data['city'], |
|
|
'area'=>$data['area'], |
|
|
// 'area'=>$data['area'], |
|
|
'house'=>$data['house'], |
|
|
'house'=>$data['house'], |
|
|
'building'=>$data['building'], |
|
|
'building'=>$data['building'], |
|
|
'number'=>$data['number'] |
|
|
'number'=>$data['number'] |
|
|
@ -441,7 +471,7 @@ class Client extends Common{ |
|
|
public function rankEdit(){ |
|
|
public function rankEdit(){ |
|
|
if (Request::isAjax()){ |
|
|
if (Request::isAjax()){ |
|
|
$data = Request::param(); |
|
|
$data = Request::param(); |
|
|
// 获取原状态 |
|
|
// 获取原状态 |
|
|
$oldstatus = Db::table('crm_client_rank')->where(['id'=>$data['id']])->find(); |
|
|
$oldstatus = Db::table('crm_client_rank')->where(['id'=>$data['id']])->find(); |
|
|
$oldstatusname = $oldstatus['rank_name']; |
|
|
$oldstatusname = $oldstatus['rank_name']; |
|
|
$ischange = false; |
|
|
$ischange = false; |
|
|
@ -582,7 +612,7 @@ class Client extends Common{ |
|
|
|
|
|
|
|
|
//移入公海 |
|
|
//移入公海 |
|
|
public function toMoveGh(){ |
|
|
public function toMoveGh(){ |
|
|
//1,获取提交的线索ID 【1,2,3,4,】 |
|
|
//1,获取提交的线索ID 【1,2,3,4,】 |
|
|
$ids = Request::param('ids'); |
|
|
$ids = Request::param('ids'); |
|
|
$this -> assign('ids',$ids); |
|
|
$this -> assign('ids',$ids); |
|
|
if (Request::isAjax()){ |
|
|
if (Request::isAjax()){ |
|
|
@ -672,21 +702,21 @@ class Client extends Common{ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$cid = Session::get('aid'); //获取当前登录账号 |
|
|
$cid = Session::get('aid'); //获取当前登录账号 |
|
|
$curname = Session::get('username'); //获取当前登录账号 |
|
|
$curname = Session::get('username'); //获取当前登录账号 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//$this ->assign('cid',$cid); //获取当前登录账号$data['id'] |
|
|
//$this ->assign('cid',$cid); //获取当前登录账号$data['id'] |
|
|
$group_id = Db::table('admin')->where(['admin_id'=>$cid])->field('group_id')->find(); |
|
|
$group_id = Db::table('admin')->where(['admin_id'=>$cid])->field('group_id')->find(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this ->assign('group_id',$group_id['group_id']); //获取当前登录权限组账号 |
|
|
$this ->assign('group_id',$group_id['group_id']); //获取当前登录权限组账号 |
|
|
|
|
|
|
|
|
$this ->assign('curname',$curname); //获取当前登录账号 |
|
|
$this ->assign('curname',$curname); //获取当前登录账号 |
|
|
|
|
|
|
|
|
$this ->assign('result',$result); |
|
|
$this ->assign('result',$result); |
|
|
//$this ->assign('result1',integer($result['id'])); //跟进上一个 下一个 获取当前id。 |
|
|
//$this ->assign('result1',integer($result['id'])); //跟进上一个 下一个 获取当前id。 |
|
|
return $this -> fetch('client/dialogue'); |
|
|
return $this -> fetch('client/dialogue'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -819,7 +849,7 @@ class Client extends Common{ |
|
|
return $this -> fetch('personclient/alter_pr_user'); |
|
|
return $this -> fetch('personclient/alter_pr_user'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//客户行业 |
|
|
//客户行业 |
|
|
public function hangyeList(){ |
|
|
public function hangyeList(){ |
|
|
if(request()->isPost()){ |
|
|
if(request()->isPost()){ |
|
|
$page =input('page')?input('page'):1; |
|
|
$page =input('page')?input('page'):1; |
|
|
@ -851,7 +881,7 @@ class Client extends Common{ |
|
|
public function hangyeEdit(){ |
|
|
public function hangyeEdit(){ |
|
|
if (Request::isAjax()){ |
|
|
if (Request::isAjax()){ |
|
|
$data = Request::param(); |
|
|
$data = Request::param(); |
|
|
// 获取原状态 |
|
|
// 获取原状态 |
|
|
$oldstatus = Db::table('crm_client_hangye')->where(['id'=>$data['id']])->find(); |
|
|
$oldstatus = Db::table('crm_client_hangye')->where(['id'=>$data['id']])->find(); |
|
|
$oldstatusname = $oldstatus['hy_name']; |
|
|
$oldstatusname = $oldstatus['hy_name']; |
|
|
$ischange = false; |
|
|
$ischange = false; |
|
|
|