Commit 9af87024 authored by hujun's avatar hujun

商铺地址搜索

parent 23b898df
......@@ -116,57 +116,62 @@ class Houses extends Basic
/*精选商铺--0是1否*/
if ($this->params['is_carefully_chosen'] != -1) {
$where['is_carefully_chosen'] = $this->params['is_carefully_chosen'];
$where['a.is_carefully_chosen'] = $this->params['is_carefully_chosen'];
}
/*0是1否显示在c端用户*/
if ($this->params['is_show'] != -1) {
$where['is_show'] = $this->params['is_show'];
$where['a.is_show'] = $this->params['is_show'];
}
/*商铺类型(0商场,1街铺)*/
if ($this->params['shop_type'] != -1) {
$where['shop_type'] = $this->params['shop_type'];
$where['a.shop_type'] = $this->params['shop_type'];
}
/*所在城市*/
if (!empty($this->params['city'])) {
$where['city'] = $this->params['city'];
$where['a.city'] = $this->params['city'];
}
/*所在区*/
if (!empty($this->params['disc'])) {
$where['disc'] = $this->params['disc'];
$where['a.disc'] = $this->params['disc'];
}
/*状态 0待审批 1上架 2下架 3回收*/
if (!empty($this->params['status'])) {
$where['status'] = $this->params['status'];
$where['a.status'] = $this->params['status'];
}
/*价格 -1表示营业额扣点 存分*/
if ($this->params['rent_price'] != NULL && $this->params['rent_price'] != -1) {
$where['rent_type'] = 1;
$where['a.rent_type'] = 1;
switch ($this->params['rent_price']) {
case 1:
$where['rent_price'] = [ '<=', 1000000 ];
$where['a.rent_price'] = [ '<=', 1000000 ];
break;
case 2:
$where['rent_price'] = [ 'between', '1000000,3000000' ];
$where['a.rent_price'] = [ 'between', '1000000,3000000' ];
break;
default :
$where['rent_price'] = [ '>', '3000000' ];
$where['a.rent_price'] = [ '>', '3000000' ];
}
}
/*对内楼盘名*/
if ($this->params['internal_title'] != NULL) {
$where['internal_title'] = [ 'LIKE', '%' . $this->params['internal_title'] . '%' ];
$where['a.internal_title'] = [ 'LIKE', '%' . $this->params['internal_title'] . '%' ];
}
/*楼盘地址搜索*/
if ($this->params['internal_address'] != NULL) {
$where['a.internal_address'] = [ 'LIKE', '%' . $this->params['internal_address'] . '%' ];
}
/*是否独家0否1是*/
if ($this->params['is_exclusive_type'] != -1) {
$where['is_exclusive_type'] = $this->params['is_exclusive_type'];
$where['a.is_exclusive_type'] = $this->params['is_exclusive_type'];
}
/*开始时间*/
......@@ -187,15 +192,15 @@ class Houses extends Basic
/*根据库存判断是否已租*/
if ($this->params['leased'] != -1) {
if ($this->params['leased'] == 0) {
$where['residue_num'] = 0;
$where['a.residue_num'] = 0;
} else {
$where['residue_num'] = [ '<>', 0 ];
$where['a.residue_num'] = [ '<>', 0 ];
}
}
/*业态*/
if ($this->params['industry_type'] != NULL) {
$where['industry_type'] = [ 'LIKE', '%' . $this->params['industry_type'] . '%' ];
$where['a.industry_type'] = [ 'LIKE', '%' . $this->params['industry_type'] . '%' ];
}
$fields = 'a.id,a.shop_type,a.internal_title,a.rent_price,a.is_show,a.create_time,a.residue_num,a.rent_type,
......
......@@ -268,6 +268,7 @@ class GHouses extends BaseModel
->order($order_)
->limit($pageSize)
->page($pageNo)
->group('a.id')
->select();
$house_id = array();
......
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