Commit 0c0cbfb4 authored by hujun's avatar hujun

解除楼盘和经纪人关系

parent 1617f180
...@@ -134,12 +134,12 @@ class Broker extends Basic ...@@ -134,12 +134,12 @@ class Broker extends Basic
$data['msg'] = ''; $data['msg'] = '';
$params = $this->request->param(); $params = $this->request->param();
if ($params['id']) { if ($params['id'] && $params['houses_id']) {
$hg = new GHousesToAgents(); $hg = new GHousesToAgents();
$hg->del($params['id']); $hg->del($params['id'], $params['houses_id']);
} else { } else {
$data['status'] = 101; $data['status'] = 101;
$data['msg'] = 'id is null'; $data['msg'] = 'id or houses_id is null';
} }
return $this->response($data['status'], $data['msg'], $data['data']); return $this->response($data['status'], $data['msg'], $data['data']);
} }
...@@ -158,7 +158,7 @@ class Broker extends Basic ...@@ -158,7 +158,7 @@ class Broker extends Basic
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo']; $pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 10 : $params['pageSize']; $pageSize = empty($params['pageSize']) ? 10 : $params['pageSize'];
$hg = new GHousesToAgents(); $hg = new GHousesToAgents();
$fields = 'a.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'] = $params['type'];
......
...@@ -56,9 +56,9 @@ class GHousesToAgents extends BaseModel ...@@ -56,9 +56,9 @@ class GHousesToAgents extends BaseModel
* @param $id * @param $id
* @return bool|false|int * @return bool|false|int
*/ */
public function del($id) { public function del($id, $houses_id) {
if ($id) { if ($id) {
$res = $this->save(['is_del' => 1],['id'=>$id]); $res = $this->save(['is_del' => 1],['agents_id'=>$id,'houses_id'=>$houses_id]);
} else { } else {
$res = false; $res = false;
} }
......
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