|
|
@@ -11,7 +11,7 @@ use yii\imagine\Image;
|
|
|
|
|
|
class business
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
//支付方式对应资金要保存的字段 shish 2019.8.20
|
|
|
public static function savePayWayAmount($object, $amount, $payWay)
|
|
|
{
|
|
|
@@ -33,7 +33,7 @@ class business
|
|
|
}
|
|
|
return $object;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//对商品图片转化 shish 2019.12.2
|
|
|
public static function formatGoodsImg($info)
|
|
|
{
|
|
|
@@ -62,7 +62,7 @@ class business
|
|
|
$smallImg = self::getSmallImg($imgUrl);
|
|
|
$small = $prefixImgUrl . $smallImg;
|
|
|
$normal = $prefixImgUrl . $imgUrl;
|
|
|
-
|
|
|
+
|
|
|
/*
|
|
|
$preImg = $imageRoot . str_replace('/uploads', '', $imgUrl);
|
|
|
if (file_exists($preImg)) {
|
|
|
@@ -81,7 +81,7 @@ class business
|
|
|
}
|
|
|
}
|
|
|
*/
|
|
|
-
|
|
|
+
|
|
|
$imgList[] = $normal;
|
|
|
$smallImgList[] = $small;
|
|
|
}
|
|
|
@@ -90,7 +90,7 @@ class business
|
|
|
$info['smallImgList'] = $smallImgList;
|
|
|
return $info;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//对商品款式的转化 shish 2019.12.4
|
|
|
public static function formatGoodsStyleImg($info)
|
|
|
{
|
|
|
@@ -101,8 +101,8 @@ class business
|
|
|
$prefixImgUrl = imgUtil::getPrefix();
|
|
|
$smallImg = self::getSmallImg($imgUrl);
|
|
|
$small = $prefixImgUrl . $smallImg;
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
//没有小图的生成小图(兼容旧系统) shish 2020.6.4
|
|
|
$imageRoot = dirUtil::getImgUploadDir();
|
|
|
$preImg = $imageRoot . str_replace('/uploads', '', $imgUrl);
|
|
|
@@ -121,12 +121,12 @@ class business
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
$info['img'] = $small;
|
|
|
return $info;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//图库图片的转化
|
|
|
public static function formatPic($info)
|
|
|
{
|
|
|
@@ -140,7 +140,7 @@ class business
|
|
|
$info['imgUrl'] = $small;
|
|
|
return $info;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//分类图的处理
|
|
|
public static function formatCategoryImg($info)
|
|
|
{
|
|
|
@@ -154,7 +154,7 @@ class business
|
|
|
$info['imgUrl'] = $small;
|
|
|
return $info;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//客户头像处理 shish 2019.12.20
|
|
|
public static function formatUserAvatar($info)
|
|
|
{
|
|
|
@@ -174,7 +174,7 @@ class business
|
|
|
$info['avatar'] = $prefixImgUrl . $imgUrl;
|
|
|
return $info;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static function formatOrderGoodsCover($info)
|
|
|
{
|
|
|
$imgUrl = isset($info['cover']) ? $info['cover'] : '';
|
|
|
@@ -190,7 +190,7 @@ class business
|
|
|
$info['coverUrl'] = $prefixImgUrl . $imgUrl;
|
|
|
return $info;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//商家公众号logo处理 shish 2019.12.20
|
|
|
public static function formatMerchantLogo($info)
|
|
|
{
|
|
|
@@ -213,10 +213,10 @@ class business
|
|
|
$small = $prefixImgUrl . $smallImg;
|
|
|
$info['smallWxQrCodeUrl'] = $small;
|
|
|
$info['wxQrCodeUrl'] = $prefixImgUrl . $imgUrl;
|
|
|
-
|
|
|
+
|
|
|
return $info;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//上传的图片进行转换 shish 2019.12.28
|
|
|
public static function formatUploadImg($imgUrl)
|
|
|
{
|
|
|
@@ -226,10 +226,12 @@ class business
|
|
|
$smallUrl = $prefix . $small;
|
|
|
return ['url' => $url, 'smallUrl' => $smallUrl];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//取小图,尺寸 200px shish 2019.12.4
|
|
|
public static function getSmallImg($imgUrl)
|
|
|
{
|
|
|
+ //2021.3.18 去除尺寸,之后可以用oss裁剪
|
|
|
+ return $imgUrl;
|
|
|
//如果没有小图需要生成小图
|
|
|
$pos = strrpos($imgUrl, '.');
|
|
|
$pre = substr($imgUrl, 0, $pos);
|
|
|
@@ -237,7 +239,7 @@ class business
|
|
|
$smallImg = $pre . '_small.' . $ext;
|
|
|
return $smallImg;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//平台员工头像处理 shish 2020.1.5
|
|
|
public static function formatStaffAvatar($info)
|
|
|
{
|
|
|
@@ -254,5 +256,5 @@ class business
|
|
|
$info['avatarUrl'] = $prefixImgUrl . $imgUrl;
|
|
|
return $info;
|
|
|
}
|
|
|
-
|
|
|
-}
|
|
|
+
|
|
|
+}
|