Commit 69944169 authored by hujun's avatar hujun

商铺列表修改

parent e7eb4ffc
...@@ -31,10 +31,6 @@ class Houses extends Basic ...@@ -31,10 +31,6 @@ class Houses extends Basic
$this->house = new GHouses(); $this->house = new GHouses();
} }
public function index() {
return view('houseList');
}
/** /**
* 新增和编辑商铺 * 新增和编辑商铺
* *
...@@ -89,6 +85,7 @@ class Houses extends Basic ...@@ -89,6 +85,7 @@ class Houses extends Basic
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function getHouseList() { public function getHouseList() {
if ($this->request->isAjax()) {
$data['status'] = 200; $data['status'] = 200;
$data['msg'] = ''; $data['msg'] = '';
...@@ -131,9 +128,11 @@ class Houses extends Basic ...@@ -131,9 +128,11 @@ class Houses extends Basic
if ($this->params['rent_price'] != NULL) { if ($this->params['rent_price'] != NULL) {
switch ($this->params['rent_price']) { switch ($this->params['rent_price']) {
case 1: case 1:
$where['rent_price'] = ['>',10000];break; $where['rent_price'] = ['>', 10000];
break;
case 2: case 2:
$where['rent_price'] = ['between','10000,30000'];break; $where['rent_price'] = ['between', '10000,30000'];
break;
default : default :
$where['rent_price'] = ['>', '30000']; $where['rent_price'] = ['>', '30000'];
} }
...@@ -141,27 +140,27 @@ class Houses extends Basic ...@@ -141,27 +140,27 @@ class Houses extends Basic
/*对内楼盘名*/ /*对内楼盘名*/
if ($this->params['internal_title'] != NULL) { if ($this->params['internal_title'] != NULL) {
$where['internal_title'] = ['LIKE', $this->params['internal_title'].'%']; $where['internal_title'] = ['LIKE', '%'.$this->params['internal_title'] . '%'];
} }
/*是否独家0否1是*/ /*是否独家0否1是*/
if ($this->params['is_exclusive_type'] != NULL) { if ($this->params['is_exclusive_type'] != NULL) {
$where['is_exclusive_type'] = ['LIKE', $this->params['is_exclusive_type'].'%']; $where['is_exclusive_type'] = $this->params['is_exclusive_type'];
} }
/*开始时间*/ /*开始时间*/
if ($this->params['start_date'] != NULL) { if ($this->params['start_date'] != NULL) {
$where['create_time'] = ['> time', $this->params['start_date']. ' 00:00:00']; $where['create_time'] = ['> time', $this->params['start_date'] . ' 00:00:00'];
} }
/*结束时间*/ /*结束时间*/
if ($this->params['end_date'] != NULL) { if ($this->params['end_date'] != NULL) {
$where['create_time'] = ['< time',$this->params['end_date']. ' 23:59:59']; $where['create_time'] = ['< time', $this->params['end_date'] . ' 23:59:59'];
} }
/*开始结束时间*/ /*开始结束时间*/
if ($this->params['start_date'] != NULL && $this->params['end_date'] != NULL) { if ($this->params['start_date'] != NULL && $this->params['end_date'] != NULL) {
$where['create_time'] = ['between time',[$this->params['start_date'].' 00:00:00'],$this->params['end_date']. ' 23:59:59']; $where['create_time'] = ['between time', [$this->params['start_date'] . ' 00:00:00'], $this->params['end_date'] . ' 23:59:59'];
} }
/*根据库存判断是否已租*/ /*根据库存判断是否已租*/
...@@ -169,13 +168,13 @@ class Houses extends Basic ...@@ -169,13 +168,13 @@ class Houses extends Basic
if ($this->params['leased'] == 0) { if ($this->params['leased'] == 0) {
$where['residue_num'] = 0; $where['residue_num'] = 0;
} else { } else {
$where['residue_num'] = ['<>',0]; $where['residue_num'] = ['<>', 0];
} }
} }
/*业态*/ /*业态*/
if ($this->params['industry_type'] != NULL) { if ($this->params['industry_type'] != NULL) {
$where['industry_type'] = ['LIKE',$this->params['industry_type'].'%']; $where['industry_type'] = ['LIKE', '%'.$this->params['industry_type'] . '%'];
} }
//案场权限人搜索 //案场权限人搜索
...@@ -184,7 +183,7 @@ class Houses extends Basic ...@@ -184,7 +183,7 @@ class Houses extends Basic
if (!empty($params['id'])) { if (!empty($params['id'])) {
$where['id'] = $params['id']; $where['id'] = $params['id'];
} }
$where['status'] = ['<>',3]; $where['status'] = ['<>', 3];
$data['data']['list'] = $this->house->getHouseList($pageNo, $pageSize, 'id DESC', $fields, $where, $this->userId); $data['data']['list'] = $this->house->getHouseList($pageNo, $pageSize, 'id DESC', $fields, $where, $this->userId);
$data['data']['total'] = $this->house->getTotal($where); $data['data']['total'] = $this->house->getTotal($where);
} else { } else {
...@@ -193,13 +192,16 @@ class Houses extends Basic ...@@ -193,13 +192,16 @@ class Houses extends Basic
if ($params['id'] != NULL) { if ($params['id'] != NULL) {
$where['a.id'] = $params['id']; $where['a.id'] = $params['id'];
} }
$where['a.status'] = ['<>',3]; $where['a.status'] = ['<>', 3];
$where['c.name'] = ['LIKE',$params['dish'].'%']; $where['c.name'] = ['LIKE', $params['dish'] . '%'];
$where['b.type'] = ['=',1]; $where['b.type'] = ['=', 1];
$data['data']['list'] = $this->house->getHouseListDish($pageNo, $pageSize, 'a.id DESC', $fields, $where, $this->userId); $data['data']['list'] = $this->house->getHouseListDish($pageNo, $pageSize, 'a.id DESC', $fields, $where, $this->userId);
$data['data']['total'] = $this->house->getHouseListDishTotal($where); $data['data']['total'] = $this->house->getHouseListDishTotal($where);
} }
return $this->response($data['status'], $data['msg'], $data['data']); return $this->response($data['status'], $data['msg'], $data['data']);
} else {
return view('houseList');
}
} }
/** /**
......
...@@ -145,7 +145,6 @@ Route::group('index', [ ...@@ -145,7 +145,6 @@ Route::group('index', [
//商铺 //商铺
'BusinessList' => ['index/BusinessDistrict/getBusiness', ['method' => 'get']], //获取商铺列表数据 'BusinessList' => ['index/BusinessDistrict/getBusiness', ['method' => 'get']], //获取商铺列表数据
'houseList' => ['index/Houses/index', ['method' => 'get']], //商铺列表
'houseEdit' => ['index/Houses/edit', ['method' => 'get|post']], //编辑商铺 'houseEdit' => ['index/Houses/edit', ['method' => 'get|post']], //编辑商铺
'houseDel' => ['index/Houses/del', ['method' => 'post']], //删除商铺 'houseDel' => ['index/Houses/del', ['method' => 'post']], //删除商铺
'regions' => ['index/BusinessDistrict/regions', ['method' => 'get']], //获取省市区数据 'regions' => ['index/BusinessDistrict/regions', ['method' => 'get']], //获取省市区数据
......
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