Commit 7e3f3535 authored by hujun's avatar hujun

图片异常处理

parent 56356a6a
......@@ -76,7 +76,13 @@ class HouseService
if ($data['id'] == '') {
$house_img->add($data, $house_id); //只记录新增图片
} else {
$house_img->edit($data, $house_id); //编辑图片
$image_result = $house_img->edit($data, $house_id); //编辑图片
if ($image_result['status'] == 'fail') {
$result['status'] = 'fail';
$result['msg'] = '编辑图片失败,'.$validate->getError();
return $result;
}
}
//案场权限人
......
......@@ -78,13 +78,10 @@ class GHousesImgs extends BaseModel
*
* @param $params
* @param $house_id
* @return array|false
* @throws \Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @return mixed
*/
public function edit($params, $house_id) {
try {
//编辑图片
$house_img_data = $this->field('id,img_name,img_type')
->where('img_status <> 1 AND house_id = ' . $house_id)->select();
......@@ -169,8 +166,16 @@ class GHousesImgs extends BaseModel
}
}
$this->add($params, $house_id);
return $this->saveAll($house_img_edit);
$this->saveAll($house_img_edit);
$result['status'] = 'successful';
} catch (\Exception $e) {
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
}
return $result;
}
/****** zw start *******/
......
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