Commit 21afaf68 authored by hujun's avatar hujun

商铺列表返回值

parent cb1eb08f
...@@ -91,6 +91,8 @@ class GHouses extends BaseModel ...@@ -91,6 +91,8 @@ class GHouses extends BaseModel
if ($v2['type'] == 2) { if ($v2['type'] == 2) {
$dish_name .= $v2['name'].','; $dish_name .= $v2['name'].',';
$result[$k]['dish_name'] = rtrim($dish_name,','); $result[$k]['dish_name'] = rtrim($dish_name,',');
} else {
$result[$k]['dish_name'] = '';
} }
} }
} }
...@@ -248,4 +250,40 @@ class GHouses extends BaseModel ...@@ -248,4 +250,40 @@ class GHouses extends BaseModel
$agents->addAgents($params['exclusive_ids'], $house_id,3); $agents->addAgents($params['exclusive_ids'], $house_id,3);
return $house_id; return $house_id;
} }
/**
* 商铺列表独家编辑
*
* @param $data
* @param $house_id
* @return bool
* @throws \Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function exclusive($data, $house_id) {
$this->startTrans();
$result = $this->save(['is_exclusive_type'=>$data['is_exclusive_type']],['id'=>$house_id]);
if ($result) {
$ext = new GHousesExt();
$update_data['agent_start_time'] = $data['agent_start_time'];
$update_data['agent_end_time'] = $data['agent_end_time'];
$ext_result = $ext->save($update_data,['house_id'=>$data['houses_id']]);
}
if ($result == 1 || $ext_result == 1) {
$agents = new GHousesToAgents();
$agents->addAgents($data['exclusive_id'], $house_id,3);
$this->commit();
$return = true;
} else {
$this->rollback();
$return = false;
}
return $return;
}
} }
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