Commit 065274fe authored by hujun's avatar hujun

exclusive

parent f3980a4b
...@@ -531,7 +531,7 @@ class Houses extends Basic ...@@ -531,7 +531,7 @@ class Houses extends Basic
*/ */
public function editExclusive() public function editExclusive()
{ {
if (empty($this->params['houses_id']) || empty($this->params['exclusive_id'])) { if (empty($this->params['houses_id'])) {
return $this->response(101, '参数错误'); return $this->response(101, '参数错误');
} }
...@@ -547,7 +547,7 @@ class Houses extends Basic ...@@ -547,7 +547,7 @@ class Houses extends Basic
$this->msg = $this->data['msg']; $this->msg = $this->data['msg'];
} }
} else { } else {
$result = $house->delAgentHouse(3, $this->params['houses_id'], $this->params['exclusive_id']); $result = $house->delAgentHouse(3, $this->params['houses_id']);
if (!$result) { if (!$result) {
$this->code = 101; $this->code = 101;
$this->msg = '解除独家关系失败'; $this->msg = '解除独家关系失败';
......
...@@ -944,18 +944,17 @@ class HouseService ...@@ -944,18 +944,17 @@ class HouseService
* @param $agent_id * @param $agent_id
* @return GHousesToAgents|bool * @return GHousesToAgents|bool
*/ */
public function delAgentHouse($type, $house_id, $agent_id) { public function delAgentHouse($type, $house_id) {
if (empty($type) || empty($house_id) || empty($agent_id)) { if (empty($type) || empty($house_id)) {
return false; return false;
} }
$id = $this->m_house->getTotal(['id'=>$house_id]); $id = $this->m_house->getTotal(['id'=>$house_id,'is_exclusive_type'=>1]);
if (empty($id)) { if (empty($id)) {
return false; return false;
} }
$where['houses_id'] = $house_id; $where['houses_id'] = $house_id;
$where['agents_id'] = $agent_id;
$where['type'] = $type; $where['type'] = $type;
$is_ok = $this->agent_house->updateData($where, ['is_del'=>1]); $is_ok = $this->agent_house->updateData($where, ['is_del'=>1]);
if ($type == 3) { if ($type == 3) {
......
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