|
|
@@ -7,6 +7,7 @@ use common\components\dirUtil;
|
|
|
use common\components\stringUtil;
|
|
|
use Yii;
|
|
|
use common\components\util;
|
|
|
+use yii\imagine\Image;
|
|
|
|
|
|
class UploadController extends BaseController
|
|
|
{
|
|
|
@@ -38,9 +39,10 @@ class UploadController extends BaseController
|
|
|
}
|
|
|
$img = "/uploads/{$merchantId}/{$month}/{$date}/" . $newFile;
|
|
|
|
|
|
- //缩略宽 200px 中
|
|
|
- $dstImg200 = $path . $preFileName . '_small_' . $type;
|
|
|
- util::img2thumb($fullPath, $dstImg200, 200, 0, 0, 0);
|
|
|
+ $new = $path.$preFileName.'_small.'.$type;
|
|
|
+ //压缩
|
|
|
+ Image::thumbnail($fullPath, 120, 120)->save($new, ['quality' => 100]);
|
|
|
+
|
|
|
|
|
|
$data = business::formatUploadImg($img);
|
|
|
$data['shortUrl'] = $img;
|