Commit 0c0cbfb4 authored by hujun's avatar hujun

解除楼盘和经纪人关系

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