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,117 +85,123 @@ class Houses extends Basic ...@@ -89,117 +85,123 @@ class Houses extends Basic
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function getHouseList() { public function getHouseList() {
$data['status'] = 200; if ($this->request->isAjax()) {
$data['msg'] = ''; $data['status'] = 200;
$data['msg'] = '';
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo']; $pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$fields = ''; $fields = '';
/*精选商铺--0是1否*/ /*精选商铺--0是1否*/
if ($this->params['is_carefully_chosen'] != NULL) { if ($this->params['is_carefully_chosen'] != NULL) {
$where['is_carefully_chosen'] = $this->params['is_carefully_chosen']; $where['is_carefully_chosen'] = $this->params['is_carefully_chosen'];
} }
/*0是1否显示在c端用户*/ /*0是1否显示在c端用户*/
if ($this->params['is_show'] != NULL) { if ($this->params['is_show'] != NULL) {
$where['is_show'] = $this->params['is_show']; $where['is_show'] = $this->params['is_show'];
} }
/*商铺类型(0商场,1街铺)*/ /*商铺类型(0商场,1街铺)*/
if ($this->params['shop_type'] != NULL) { if ($this->params['shop_type'] != NULL) {
$where['shop_type'] = $this->params['shop_type']; $where['shop_type'] = $this->params['shop_type'];
} }
/*所在城市*/ /*所在城市*/
if (!empty($this->params['city'])) { if (!empty($this->params['city'])) {
$where['city'] = $this->params['city']; $where['city'] = $this->params['city'];
} }
/*所在区*/ /*所在区*/
if (!empty($this->params['disc'])) { if (!empty($this->params['disc'])) {
$where['disc'] = $this->params['disc']; $where['disc'] = $this->params['disc'];
} }
/*状态 0待审批 1上架 2下架 3回收*/ /*状态 0待审批 1上架 2下架 3回收*/
if (!empty($this->params['status'])) { if (!empty($this->params['status'])) {
$where['status'] = $this->params['status']; $where['status'] = $this->params['status'];
} }
/*价格 -1表示营业额扣点 存分*/ /*价格 -1表示营业额扣点 存分*/
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];
case 2: break;
$where['rent_price'] = ['between','10000,30000'];break; case 2:
default : $where['rent_price'] = ['between', '10000,30000'];
$where['rent_price'] = ['>', '30000']; break;
default :
$where['rent_price'] = ['>', '30000'];
}
} }
}
/*对内楼盘名*/ /*对内楼盘名*/
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'];
} }
/*根据库存判断是否已租*/ /*根据库存判断是否已租*/
if ($this->params['leased'] != NULL) { if ($this->params['leased'] != NULL) {
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'] . '%'];
} }
//案场权限人搜索 //案场权限人搜索
if (empty($params['dish'])) { if (empty($params['dish'])) {
/*楼盘编号*/ /*楼盘编号*/
if (!empty($params['id'])) { if (!empty($params['id'])) {
$where['id'] = $params['id']; $where['id'] = $params['id'];
}
$where['status'] = ['<>', 3];
$data['data']['list'] = $this->house->getHouseList($pageNo, $pageSize, 'id DESC', $fields, $where, $this->userId);
$data['data']['total'] = $this->house->getTotal($where);
} else {
//盘方人搜索
/*楼盘编号*/
if ($params['id'] != NULL) {
$where['a.id'] = $params['id'];
}
$where['a.status'] = ['<>', 3];
$where['c.name'] = ['LIKE', $params['dish'] . '%'];
$where['b.type'] = ['=', 1];
$data['data']['list'] = $this->house->getHouseListDish($pageNo, $pageSize, 'a.id DESC', $fields, $where, $this->userId);
$data['data']['total'] = $this->house->getHouseListDishTotal($where);
} }
$where['status'] = ['<>',3]; return $this->response($data['status'], $data['msg'], $data['data']);
$data['data']['list'] = $this->house->getHouseList($pageNo, $pageSize, 'id DESC', $fields, $where, $this->userId);
$data['data']['total'] = $this->house->getTotal($where);
} else { } else {
//盘方人搜索 return view('houseList');
/*楼盘编号*/
if ($params['id'] != NULL) {
$where['a.id'] = $params['id'];
}
$where['a.status'] = ['<>',3];
$where['c.name'] = ['LIKE',$params['dish'].'%'];
$where['b.type'] = ['=',1];
$data['data']['list'] = $this->house->getHouseListDish($pageNo, $pageSize, 'a.id DESC', $fields, $where, $this->userId);
$data['data']['total'] = $this->house->getHouseListDishTotal($where);
} }
return $this->response($data['status'], $data['msg'], $data['data']);
} }
/** /**
......
...@@ -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