Commit e1d70e2f authored by hujun's avatar hujun

exclusive

parent 065274fe
...@@ -1032,20 +1032,23 @@ class Shop extends Basic ...@@ -1032,20 +1032,23 @@ class Shop extends Basic
*/ */
public function editExclusive() public function editExclusive()
{ {
if (empty($this->params['id']) || empty($this->params['exclusive_ids'])) { if (empty($this->params['id'])) {
return $this->response(101, '参数错误'); return $this->response(101, '参数错误');
} }
$code = 200; $code = 200;
$msg = ""; $msg = "";
$house = new HouseService(); $house = new HouseService();
if ($this->params['is_exclusive_type'] == 1) { if ($this->params['is_exclusive_type'] == 1) {
if (empty($this->params['exclusive_ids'])) {
return $this->response(101, '参数错误');
}
$result = $house->addHouse($this->params, $this->agentId, 1, 0, 'exclusive'); $result = $house->addHouse($this->params, $this->agentId, 1, 0, 'exclusive');
if ($result['status'] == 'fail') { if ($result['status'] == 'fail') {
$code = 101; $code = 101;
$msg = $result['msg']; $msg = $result['msg'];
} }
} else { } else {
$result = $house->delAgentHouse(3, $this->params['id'], $this->params['exclusive_ids']); $result = $house->delAgentHouse(3, $this->params['id']);
if (!$result) { if (!$result) {
$code = 101; $code = 101;
$msg = '解除独家关系失败'; $msg = '解除独家关系失败';
......
...@@ -537,6 +537,9 @@ class Houses extends Basic ...@@ -537,6 +537,9 @@ class Houses extends Basic
$house = new HouseService(); $house = new HouseService();
if ($this->params['is_exclusive_type'] == 1) { if ($this->params['is_exclusive_type'] == 1) {
if (empty($this->params['exclusive_ids'])) {
return $this->response(101, '参数错误');
}
$data = $this->params; $data = $this->params;
$data['id'] = $this->params['houses_id']; $data['id'] = $this->params['houses_id'];
unset($data['houses_id']); unset($data['houses_id']);
......
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