|
|
|
@ -41,6 +41,33 @@ class Client extends Common{ |
|
|
|
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(){ |
|
|
|
|
|
|
|
@ -273,14 +300,14 @@ class Client extends Common{ |
|
|
|
$data['pro'] = Request::param('pro'); |
|
|
|
$data['city'] = Request::param('city'); |
|
|
|
$data['area'] = Request::param('area'); |
|
|
|
$data['house'] = Request::param('house'); |
|
|
|
$data['building'] = Request::param('building'); |
|
|
|
$data['number'] = Request::param('number'); |
|
|
|
$data['house'] = trim(Request::param('house')); |
|
|
|
$data['building'] = trim(Request::param('building')); |
|
|
|
$data['number'] = trim(Request::param('number')); |
|
|
|
|
|
|
|
$wdata = array( |
|
|
|
'pro'=>$data['pro'], |
|
|
|
'city'=>$data['city'], |
|
|
|
'area'=>$data['area'], |
|
|
|
// 'pro'=>$data['pro'], |
|
|
|
// 'city'=>$data['city'], |
|
|
|
// 'area'=>$data['area'], |
|
|
|
'house'=>$data['house'], |
|
|
|
'building'=>$data['building'], |
|
|
|
'number'=>$data['number'] |
|
|
|
@ -347,10 +374,13 @@ class Client extends Common{ |
|
|
|
if (Request::isAjax()){ |
|
|
|
$data = Request::param(); |
|
|
|
$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( |
|
|
|
'pro'=>$data['pro'], |
|
|
|
'city'=>$data['city'], |
|
|
|
'area'=>$data['area'], |
|
|
|
// 'pro'=>$data['pro'], |
|
|
|
// 'city'=>$data['city'], |
|
|
|
// 'area'=>$data['area'], |
|
|
|
'house'=>$data['house'], |
|
|
|
'building'=>$data['building'], |
|
|
|
'number'=>$data['number'] |
|
|
|
|