Commit c66a313c authored by zhuwei's avatar zhuwei Committed by hujun

客方搜索(select_by_phone)

parent b52c7b7d
...@@ -191,20 +191,20 @@ class Remark extends Basic ...@@ -191,20 +191,20 @@ class Remark extends Basic
return $this->response("200", "success!", ['user_info'=>$user_res,'user_date'=>$UPhoneFollowPp_res,'user_history'=>$records_result]); return $this->response("200", "success!", ['user_info'=>$user_res,'user_date'=>$UPhoneFollowPp_res,'user_history'=>$records_result]);
} }
/**
* 客方搜索
*/
public function select_by_phone() { public function select_by_phone() {
$params = $this->params; $params = $this->params;
$params['phone'] ='181'; //$params['phone'] ='181';
$phone = $params['phone']; $phone = trim($params['phone']);
dump($phone);
$table= new Agents(); $table= new Agents();
$Agents_res =$table->select_by_phone($phone); $Agents_res =$table->select_by_phone($phone);
// dump($Agents_res); //dump($Agents_res);
if ($Agents_res) { return $this->response("200", "success!", $Agents_res);
return $this->response("200", "success!", $Agents_res);
} else {
return $this->response("201", "success!", ['user_date'=>'']);
}
} }
......
...@@ -261,8 +261,7 @@ class Agents extends Model ...@@ -261,8 +261,7 @@ class Agents extends Model
$agents = db('agents') $agents = db('agents')
->where('phone','like','%'.$phone.'%') ->where('phone','like','%'.$phone.'%')
->where('level', 2) ->where('level', 'in',[2,5])
->whereor('level', 5)
->field('id,realname,agentshopname,phone') ->field('id,realname,agentshopname,phone')
->limit(10) ->limit(10)
->page(1) ->page(1)
......
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