Commit 28ca87e3 authored by zhuwei's avatar zhuwei

客方搜索(select_by_phone)

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