修复错误

This commit is contained in:
mkm 2023-11-02 15:13:11 +08:00
parent 2f279a701e
commit 6b568c255c

View File

@ -132,7 +132,8 @@ class ProductLibrary extends BaseController
} }
$arr=[]; $arr=[];
foreach($param['imgList'] as $k=>$v){ foreach($param['imgList'] as $k=>$v){
$arr[] = $upload->to($dir)->stream(file_get_contents($v)); $oss=$upload->to($dir)->stream(file_get_contents($v));
$arr[] = $oss->filePath;
} }
if(count($arr)>0){ if(count($arr)>0){
$data['slider_image'] =implode(',',$arr); $data['slider_image'] =implode(',',$arr);
@ -141,6 +142,7 @@ class ProductLibrary extends BaseController
} }
$data['images'] = ''; $data['images'] = '';
$res = Db::name('product_library')->insert($data); $res = Db::name('product_library')->insert($data);
if ($res) { if ($res) {
return app('json')->success('添加成功'); return app('json')->success('添加成功');
} else { } else {