Commit cf7fdffd authored by hujun's avatar hujun

经纪人搜索优化

parent e0d831d5
...@@ -83,29 +83,29 @@ class Broker extends Basic ...@@ -83,29 +83,29 @@ class Broker extends Basic
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
if (empty($this->params['all'])) { if (empty($this->params['all'])) {
$where = 'status = 0'; $where['status'] = 0;
} else { } else {
$where = ''; $where = [];
} }
if ($this->params['phone']) { if ($this->params['phone']) {
$where .= ' AND concat(phone,name) like "%'.$this->params['phone'].'%"'; $where['concat(phone,name)'] = ['LIKE', '%'.$this->params['phone'].'%'];
} }
if ($this->params['level']) { if ($this->params['level']) {
$where .= ' AND level in ('.$this->params['level'].')'; $where['level'] = ['IN', $this->params['level'] ];
} }
if ($this->params['store_id']) { if ($this->params['store_id']) {
$where .= ' AND store_id='.$this->params['store_id']; $where['store_id'] = $this->params['store_id'];
} }
if ($this->params['district_id']) { if ($this->params['district_id']) {
$where .= ' AND district_id='.$this->params['district_id']; $where['district_id'] = $this->params['district_id'];
} }
if ($this->params['site_id'] && ($this->userId != 1)) { if ($this->params['site_id'] && ($this->userId != 1)) {
$where .= ' AND site_id='. $this->params['site_id']; $where['site_id'] = $this->params['site_id'];
} }
if ($where) { if ($where) {
......
...@@ -470,7 +470,8 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', ' ...@@ -470,7 +470,8 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
type: 'GET', type: 'GET',
url: '/index/getBroker_new', url: '/index/getBroker_new',
data: { data: {
'phone': $.trim(_this.val()) 'phone': $.trim(_this.val()),
'all':1
}, },
timeout: 30000, timeout: 30000,
dataType: 'json', dataType: 'json',
...@@ -632,7 +633,8 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', ' ...@@ -632,7 +633,8 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
type: 'GET', type: 'GET',
async: true, async: true,
data: { data: {
"phone": $("#partical_name").val() "phone": $("#partical_name").val(),
'all' : 1
}, },
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
......
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