|
|
@ -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']; |
|
|
} |
|
|
} |
|
|
|