Commit 986e8741 authored by hujun's avatar hujun

自定义价格搜索

parent a7f10733
......@@ -246,19 +246,37 @@ class Houses extends Basic
$where['status'] = $this->params['status'];
}
/*价格 -1表示营业额扣点 存分*/
if ($this->params['rent_price'] != NULL && $this->params['rent_price'] != -1) {
// /*价格 -1表示营业额扣点 存分*/
// if ($this->params['rent_price'] != NULL && $this->params['rent_price'] != -1) {
// $where['rent_type'] = 1;
// switch ($this->params['rent_price']) {
// case 1:
// $where['rent_price'] = [ '<=', 1000000 ];
// break;
// case 2:
// $where['rent_price'] = [ 'between', '1000000,3000000' ];
// break;
// default :
// $where['rent_price'] = [ '>', '3000000' ];
// }
// }
if (!empty($this->params['rent_price']) && $this->params['rent_price'] == -1) {
$where['rent_type'] = -1;
}
if (!empty($this->params['price_start']) && empty($this->params['price_end'])) {
$where['rent_type'] = 1;
switch ($this->params['rent_price']) {
case 1:
$where['rent_price'] = [ '<=', 1000000 ];
break;
case 2:
$where['rent_price'] = [ 'between', '1000000,3000000' ];
break;
default :
$where['rent_price'] = [ '>', '3000000' ];
}
$where['rent_price'] = [ '>=', $this->params['price_start'] * 100 ];
}
if (empty($this->params['price_start']) && !empty($this->params['price_end'])) {
$where['rent_type'] = 1;
$where['rent_price'] = [ '<=', $this->params['price_end'] * 100 ];
}
if (!empty($this->params['price_start']) && !empty($this->params['price_end'])) {
$where['rent_type'] = 1;
$where['rent_price'] = [ 'between', [$this->params['price_start'], $this->params['price_end']] ];
}
/*对内楼盘名*/
......@@ -405,17 +423,14 @@ class Houses extends Basic
}
if (!empty($this->params['area_start']) && empty($this->params['area_end'])) {
$where['rent_type'] = 1;
$where['shop_area_start'] = ['>=', $this->params['area_start']];
}
if (!empty($this->params['area_end']) && empty($this->params['area_start'])) {
$where['rent_type'] = 1;
if (!empty($this->params['area_end']) && empty($this->params['area_start'])) {
$where['shop_area_start'] = ['<=', $this->params['area_end']];
}
if (!empty($this->params['area_end']) && !empty($this->params['area_start'])) {
$where['rent_type'] = 1;
$where['shop_area_start'] = ['between', [$this->params['area_start'], $this->params['area_end']]];
}
......
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