Commit 6feaf643 authored by hujun's avatar hujun

1

parent 34f7a909
......@@ -1012,17 +1012,12 @@ class Shop extends Basic
public function getExclusive()
{
if ($this->params['houses_id']) {
if ($this->params['is_exclusive_type'] == 1) {
$res = $this->gHousesModel->getExclusive($this->params['houses_id']);
// dump($res);
foreach ($res['exclusive_img'] as $key => $val) {
$res['exclusive_img'][$key]['file_name'] = CURRENT_URL.'resource/lib/Attachments/images/'.$val['img_name'];
$res['exclusive_img'][$key]['save_path'] = $val['img_name'];
}
} else {
$res = $this->gHousesModel->editData(['is_exclusive_type'=>0], $this->params['houses_id']);
$res = $this->gHousesModel->getExclusive($this->params['houses_id']);
// dump($res);
foreach ($res['exclusive_img'] as $key => $val) {
$res['exclusive_img'][$key]['file_name'] = CURRENT_URL.'resource/lib/Attachments/images/'.$val['img_name'];
$res['exclusive_img'][$key]['save_path'] = $val['img_name'];
}
} else {
return $this->response("101", "houses_id is null");
}
......@@ -1035,14 +1030,23 @@ class Shop extends Basic
public function editExclusive()
{
// $res = $this->gHousesModel->exclusive($this->params, $this->params['houses_id'], $this->agentId, $this->siteId);
$code = 200;
$msg = "";
$house = new HouseService();
$result = $house->addHouse($this->params, $this->agentId, 1, 0, 'exclusive');
if ($result['status'] == 'fail') {
$code = 101;
$msg = $result['msg'];
if (empty($this->params['houses_id'])) {
return $this->response(101, '参数错误');
}
if ($this->params['is_exclusive_type'] == 1) {
$code = 200;
$msg = "";
$house = new HouseService();
$result = $house->addHouse($this->params, $this->agentId, 1, 0, 'exclusive');
if ($result['status'] == 'fail') {
$code = 101;
$msg = $result['msg'];
}
} else {
$res = $this->gHousesModel->editData(['is_exclusive_type'=>0], $this->params['houses_id']);
}
return $this->response($code, $msg);
}
}
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