Browse Source

活动商品复制--修复旧图片复制问题

master
liangyuyan 5 years ago
parent
commit
178eea66a9
  1. 12
      app/Admin/Forms/v3/GoodsActivityCopyForm.php

12
app/Admin/Forms/v3/GoodsActivityCopyForm.php

@ -144,10 +144,16 @@ class GoodsActivityCopyForm extends Form implements LazyRenderable
public function copyImage($ossImageDir, $imagePath) public function copyImage($ossImageDir, $imagePath)
{ {
$return = ''; $return = '';
$oldCoverImg = $imagePath;
$customFile = new CustomFileController(); $customFile = new CustomFileController();
$result = $customFile->autoCopyFile($ossImageDir, $oldCoverImg);
// 判断图片是否包含http
if(stripos($imagePath,'http') !== false && @getimagesize($imagePath)){
// 上传模式
$result = $customFile->autoUploadFile($ossImageDir, $imagePath);
}else{
// 复制模式
$result = $customFile->autoCopyFile($ossImageDir, $imagePath);
};
if($result['status']){ if($result['status']){
$return = $result['path']; $return = $result['path'];
} }

Loading…
Cancel
Save