正在显示
1 个修改的文件
包含
5 行增加
和
1 行删除
| @@ -40,12 +40,16 @@ class WebSettingImageController extends BaseController | @@ -40,12 +40,16 @@ class WebSettingImageController extends BaseController | ||
| 40 | */ | 40 | */ |
| 41 | public function save(WebSettingImage $webSettingImage){ | 41 | public function save(WebSettingImage $webSettingImage){ |
| 42 | try { | 42 | try { |
| 43 | - $webSettingImage->del(['project_id'=>$this->user['project_id']]); | ||
| 44 | foreach ($this->param['data'] as $v){ | 43 | foreach ($this->param['data'] as $v){ |
| 44 | + if(isset($v['id']) && !empty($v['id'])){ | ||
| 45 | + $v['image'] = str_replace_url($v['image']); | ||
| 46 | + $webSettingImage->edit($v,['id'=>$v['id']]); | ||
| 47 | + }else{ | ||
| 45 | $v['project_id'] = $this->user['project_id']; | 48 | $v['project_id'] = $this->user['project_id']; |
| 46 | $v['image'] = str_replace_url($v['image']); | 49 | $v['image'] = str_replace_url($v['image']); |
| 47 | $webSettingImage->add($v); | 50 | $webSettingImage->add($v); |
| 48 | } | 51 | } |
| 52 | + } | ||
| 49 | }catch (\Exception $e){ | 53 | }catch (\Exception $e){ |
| 50 | $this->response('系统错误请联系管理员'); | 54 | $this->response('系统错误请联系管理员'); |
| 51 | } | 55 | } |
-
请 注册 或 登录 后发表评论