Browse Source

修复上传图片方法explode函数报错

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
f141de9bc7
  1. 4
      vendor/antgoods/goods/src/controllers/GoodsController.php

4
vendor/antgoods/goods/src/controllers/GoodsController.php

@ -85,7 +85,7 @@ class GoodsController extends Controller
$file_id_str = $model->imageId; $file_id_str = $model->imageId;
$model->save(); $model->save();
$goods_manager = new GoodsManager(); $goods_manager = new GoodsManager();
$save_file_res = $goods_manager->saveFile(explode($file_id_str), $model);
$save_file_res = $goods_manager->saveFile(explode(',', $file_id_str), $model);
if($save_file_res['status']){ if($save_file_res['status']){
$model->image = $save_file_res['first_file_id']; $model->image = $save_file_res['first_file_id'];
$model->save(); $model->save();
@ -115,7 +115,7 @@ class GoodsController extends Controller
$file_id_str = $model->imageId; $file_id_str = $model->imageId;
$model->save(); $model->save();
$goods_manager = new GoodsManager(); $goods_manager = new GoodsManager();
$save_file_res = $goods_manager->saveFile(explode($file_id_str), $model, $old_id_arr);
$save_file_res = $goods_manager->saveFile(explode(',', $file_id_str), $model, $old_id_arr);
if($save_file_res['status']){ if($save_file_res['status']){
$model->image = $save_file_res['first_file_id']; $model->image = $save_file_res['first_file_id'];
$model->save(); $model->save();

Loading…
Cancel
Save