Commit cb1eb08f authored by hujun's avatar hujun

接收参数修改

parent 06daf716
...@@ -30,13 +30,12 @@ class Broker extends Basic ...@@ -30,13 +30,12 @@ class Broker extends Basic
$data['data'] = ''; $data['data'] = '';
$data['code'] = ''; $data['code'] = '';
$data['msg'] = ''; $data['msg'] = '';
$params = $this->request->param();
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo']; $pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($params['pageSize']) ? 10 : $params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$where = '';
if ($params['phone']) { if ($this->params['phone']) {
$where = 'phone like "'.$params['phone'].'%" or realname like "'.$params['phone'].'%"'; $where = 'phone like "'.$this->params['phone'].'%" or realname like "'.$this->params['phone'].'%"';
} }
if ($where) { if ($where) {
...@@ -62,13 +61,12 @@ class Broker extends Basic ...@@ -62,13 +61,12 @@ class Broker extends Basic
$data['status'] = 200; $data['status'] = 200;
$data['data'] = ''; $data['data'] = '';
$data['msg'] = ''; $data['msg'] = '';
$params = $this->request->param();
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 10 : $params['pageSize'];
if ($params['phone']) { $pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$where = 'phone like "'.$params['phone'].'%" or name like "'.$params['phone'].'%"'; $pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$where = '';
if ($this->params['phone']) {
$where = 'phone like "'.$this->params['phone'].'%" or name like "'.$this->params['phone'].'%"';
} }
if ($where) { if ($where) {
...@@ -95,15 +93,14 @@ class Broker extends Basic ...@@ -95,15 +93,14 @@ class Broker extends Basic
$data['status'] = 200; $data['status'] = 200;
$data['data'] = ''; $data['data'] = '';
$data['msg'] = ''; $data['msg'] = '';
$params = $this->request->param();
if ($params['houses_id']) { if ($this->params['houses_id']) {
$hg = new GHousesToAgents(); $hg = new GHousesToAgents();
switch ($params['type']) { switch ($this->params['type']) {
case 1: case 1:
$res = $hg->addAgents($params['agents_id'], $params['houses_id'], $params['type']);break; $res = $hg->addAgents($this->params['agents_id'], $this->params['houses_id'], $this->params['type']);break;
case 2: case 2:
$res = $hg->addAgents($params['agents_id'], $params['houses_id'], $params['type']);break; $res = $hg->addAgents($this->params['agents_id'], $this->params['houses_id'], $this->params['type']);break;
default : default :
$data['status'] = 101; $data['status'] = 101;
$data['msg'] = 'type is null'; $data['msg'] = 'type is null';
...@@ -132,11 +129,10 @@ class Broker extends Basic ...@@ -132,11 +129,10 @@ class Broker extends Basic
$data['status'] = 200; $data['status'] = 200;
$data['data'] = ''; $data['data'] = '';
$data['msg'] = ''; $data['msg'] = '';
$params = $this->request->param();
if ($params['id'] && $params['houses_id']) { if ($this->params['id'] && $this->params['houses_id']) {
$hg = new GHousesToAgents(); $hg = new GHousesToAgents();
$hg->del($params['id'], $params['houses_id']); $hg->del($this->params['id'], $this->params['houses_id']);
} else { } else {
$data['status'] = 101; $data['status'] = 101;
$data['msg'] = 'id or houses_id is null'; $data['msg'] = 'id or houses_id is null';
...@@ -153,16 +149,16 @@ class Broker extends Basic ...@@ -153,16 +149,16 @@ class Broker extends Basic
$data['status'] = 200; $data['status'] = 200;
$data['data'] = ''; $data['data'] = '';
$data['msg'] = ''; $data['msg'] = '';
$params = $this->request->param();
if ($params['houses_id']) { if ($this->params['houses_id']) {
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo']; $pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($params['pageSize']) ? 10 : $params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$hg = new GHousesToAgents(); $hg = new GHousesToAgents();
$fields = 'b.id,b.name,b.phone'; $fields = 'b.id,b.name,b.phone';
$where['a.is_del'] = ['=',0]; $where['a.is_del'] = ['=',0];
$where['b.status'] = ['=',0]; $where['b.status'] = ['=',0];
$where['a.type'] = $params['type']; $where['a.type'] = $this->params['type'];
$where['a.houses_id'] = $params['houses_id']; $where['a.houses_id'] = $this->params['houses_id'];
$data['data'] = $hg->getAgentsHousesList($pageNo, $pageSize, 'id DESC', $fields, $where); $data['data'] = $hg->getAgentsHousesList($pageNo, $pageSize, 'id DESC', $fields, $where);
} else { } else {
$data['status'] = 101; $data['status'] = 101;
......
...@@ -38,10 +38,10 @@ class Houses extends Basic ...@@ -38,10 +38,10 @@ class Houses extends Basic
public function edit() { public function edit() {
$result['code'] = 200; $result['code'] = 200;
$result['msg'] = ''; $result['msg'] = '';
$params = $this->request->param();
if ($this->request->isPost()) { if ($this->request->isPost()) {
$this->house->startTrans(); $this->house->startTrans();
$house_id = $this->house->add($params); //添加或编辑商铺 $house_id = $this->house->add($this->params); //添加或编辑商铺
if ($house_id) { if ($house_id) {
$this->house->commit(); $this->house->commit();
$return = $this->response($result['code'], $result['msg'],['id',$house_id]); $return = $this->response($result['code'], $result['msg'],['id',$house_id]);
...@@ -49,11 +49,11 @@ class Houses extends Basic ...@@ -49,11 +49,11 @@ class Houses extends Basic
$this->house->rollback(); $this->house->rollback();
$return = $this->response(101, 'add houses is error'); $return = $this->response(101, 'add houses is error');
} }
} elseif ($params['id']){ } elseif ($this->params['id']){
if ($this->request->isAjax()) { if ($this->request->isAjax()) {
//获取商铺详情 //获取商铺详情
$house = new GHouses(); $house = new GHouses();
$result['data'] = $house->getHouseById($params['id']); $result['data'] = $house->getHouseById($this->params['id']);
$return = $this->response($result['code'], $result['msg'], $result['data']); $return = $this->response($result['code'], $result['msg'], $result['data']);
} else { } else {
//商铺添加页面 //商铺添加页面
...@@ -77,45 +77,45 @@ class Houses extends Basic ...@@ -77,45 +77,45 @@ class Houses extends Basic
public function getHouseList() { public function getHouseList() {
$data['status'] = 200; $data['status'] = 200;
$data['msg'] = ''; $data['msg'] = '';
$params = $this->request->param();
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo']; $pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$fields = ''; $fields = '';
/*精选商铺--0是1否*/ /*精选商铺--0是1否*/
if ($params['is_carefully_chosen'] != NULL) { if ($this->params['is_carefully_chosen'] != NULL) {
$where['is_carefully_chosen'] = $params['is_carefully_chosen']; $where['is_carefully_chosen'] = $this->params['is_carefully_chosen'];
} }
/*0是1否显示在c端用户*/ /*0是1否显示在c端用户*/
if ($params['is_show'] != NULL) { if ($this->params['is_show'] != NULL) {
$where['is_show'] = $params['is_show']; $where['is_show'] = $this->params['is_show'];
} }
/*商铺类型(0商场,1街铺)*/ /*商铺类型(0商场,1街铺)*/
if ($params['shop_type'] != NULL) { if ($this->params['shop_type'] != NULL) {
$where['shop_type'] = $params['shop_type']; $where['shop_type'] = $this->params['shop_type'];
} }
/*所在城市*/ /*所在城市*/
if ($params['city'] != NULL) { if ($this->params['city'] != NULL) {
$where['city'] = $params['city']; $where['city'] = $this->params['city'];
} }
/*所在区*/ /*所在区*/
if ($params['disc'] != NULL) { if ($this->params['disc'] != NULL) {
$where['disc'] = $params['disc']; $where['disc'] = $this->params['disc'];
} }
/*状态 0待审批 1上架 2下架 3回收*/ /*状态 0待审批 1上架 2下架 3回收*/
if ($params['status'] != NULL) { if ($this->params['status'] != NULL) {
$where['status'] = $params['status']; $where['status'] = $this->params['status'];
} }
/*价格 -1表示营业额扣点 存分*/ /*价格 -1表示营业额扣点 存分*/
if ($params['rent_price'] != NULL) { if ($this->params['rent_price'] != NULL) {
switch ($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:
...@@ -126,33 +126,33 @@ class Houses extends Basic ...@@ -126,33 +126,33 @@ class Houses extends Basic
} }
/*对内楼盘名*/ /*对内楼盘名*/
if ($params['internal_title'] != NULL) { if ($this->params['internal_title'] != NULL) {
$where['internal_title'] = ['LIKE', $params['internal_title'].'%']; $where['internal_title'] = ['LIKE', $this->params['internal_title'].'%'];
} }
/*是否独家0否1是*/ /*是否独家0否1是*/
if ($params['is_exclusive_type'] != NULL) { if ($this->params['is_exclusive_type'] != NULL) {
$where['is_exclusive_type'] = ['LIKE', $params['is_exclusive_type'].'%']; $where['is_exclusive_type'] = ['LIKE', $this->params['is_exclusive_type'].'%'];
} }
/*开始时间*/ /*开始时间*/
if ($params['start_date'] != NULL) { if ($this->params['start_date'] != NULL) {
$where['create_time'] = ['> time', $params['start_date']. ' 00:00:00']; $where['create_time'] = ['> time', $this->params['start_date']. ' 00:00:00'];
} }
/*结束时间*/ /*结束时间*/
if ($params['end_date'] != NULL) { if ($this->params['end_date'] != NULL) {
$where['create_time'] = ['< time',$params['end_date']. ' 23:59:59']; $where['create_time'] = ['< time',$this->params['end_date']. ' 23:59:59'];
} }
/*开始结束时间*/ /*开始结束时间*/
if ($params['start_date'] != NULL && $params['end_date'] != NULL) { if ($this->params['start_date'] != NULL && $this->params['end_date'] != NULL) {
$where['create_time'] = ['between time',[$params['start_date'].' 00:00:00'],$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 ($params['leased'] != NULL) { if ($this->params['leased'] != NULL) {
if ($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];
...@@ -160,8 +160,8 @@ class Houses extends Basic ...@@ -160,8 +160,8 @@ class Houses extends Basic
} }
/*业态*/ /*业态*/
if ($params['industry_type'] != NULL) { if ($this->params['industry_type'] != NULL) {
$where['industry_type'] = ['LIKE',$params['industry_type'].'%']; $where['industry_type'] = ['LIKE',$this->params['industry_type'].'%'];
} }
//案场权限人搜索 //案场权限人搜索
...@@ -198,9 +198,9 @@ class Houses extends Basic ...@@ -198,9 +198,9 @@ class Houses extends Basic
$data['status'] = 200; $data['status'] = 200;
$data['msg'] = ''; $data['msg'] = '';
$data['data'] = ''; $data['data'] = '';
$params = $this->request->param();
if ($params['id']) { if ($this->params['id']) {
$this->house->isUpdate(true)->save(['status'=>3],['id'=>$params['id']]); $this->house->isUpdate(true)->save(['status'=>3],['id'=>$this->params['id']]);
$data['msg'] = 'successfully deleted'; $data['msg'] = 'successfully deleted';
} else { } else {
$data['status'] = 101; $data['status'] = 101;
...@@ -219,11 +219,10 @@ class Houses extends Basic ...@@ -219,11 +219,10 @@ class Houses extends Basic
$data['status'] = 200; $data['status'] = 200;
$data['msg'] = ''; $data['msg'] = '';
$data['data'] = ''; $data['data'] = '';
$params = $this->request->param();
if ($params['houses_id'] != NULL && $params['is_carefully_chosen'] != NULL) { if ($this->params['houses_id'] != NULL && $this->params['is_carefully_chosen'] != NULL) {
$data['is_carefully_chosen'] = $params['is_carefully_chosen']; $data['is_carefully_chosen'] = $this->params['is_carefully_chosen'];
$data['data'] = $this->house->editData($data,$params['houses_id'],'id'); $data['data'] = $this->house->editData($data,$this->params['houses_id'],'id');
} else { } else {
$data['status'] = 101; $data['status'] = 101;
$data['msg'] = 'houses_id or is_carefully_chosen is null'; $data['msg'] = 'houses_id or is_carefully_chosen is null';
......
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