|
|
|
@ -119,9 +119,13 @@ class GoodsController extends BaseController |
|
|
|
$banners = $this->request->input('banner',0); |
|
|
|
$res = $this->goodsService->update($data); |
|
|
|
if(!empty($banners)){ |
|
|
|
$banners = explode(',',$banners); |
|
|
|
$banners = json_decode($banners,true); |
|
|
|
foreach ($banners as $banner){ |
|
|
|
$this->goodsService->bannerCreate($data['id'],$banner,1); |
|
|
|
if(!empty($banner['id'])){ |
|
|
|
$this->goodsService->bannerUpdate($banner['id'],$data['id'],$banner['path'],1); |
|
|
|
}else{ |
|
|
|
$this->goodsService->bannerCreate($data['id'],$banner['path'],1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return $this->success($res); |
|
|
|
@ -175,9 +179,9 @@ class GoodsController extends BaseController |
|
|
|
$banners = $this->request->input('banner',0); |
|
|
|
$res = $this->goodsService->create($data); |
|
|
|
if(!empty($banners)){ |
|
|
|
$banners = explode(',',$banners); |
|
|
|
$banners = json_decode($banners,true); |
|
|
|
foreach ($banners as $banner){ |
|
|
|
$this->goodsService->bannerCreate($res['id'],$banner,1); |
|
|
|
$this->goodsService->bannerCreate($res['id'],$banner['path'],1); |
|
|
|
} |
|
|
|
} |
|
|
|
return $this->success($res); |
|
|
|
|