Przeglądaj źródła

mall 待付款订单显示改花材

shish 5 lat temu
rodzic
commit
a028358630

+ 12 - 19
app-ghs/controllers/OrderController.php

@@ -66,31 +66,24 @@ class OrderController extends BaseController
     public function actionCreateOrder()
     {
         $post = Yii::$app->request->post();
-        $adminId = $this->adminId;
         $shopId = $this->shopId;
         $customId = $post['customId'] ?? 0;
-        if (!empty($shopId)) {
-            //供货商 员工 开单
-            $post['customId'] = $customId;
-            $post['adminId'] = $adminId;
-            $post['shopId'] = $shopId;
-        } else {
-            //供货商 商城 客户 开单
-            $post['adminId'] = $adminId;
-            $shopId = $post['shopId'] ?? 0;
-            if (empty($shopId)) {
-                util::fail('请选择供货商');
-            }
-            $post['shopId'] = $shopId;
-            $shop = ShopClass::getById($shopId);
-            if (empty($shop)) {
-                util::fail('没有找到供货商');
-            }
+        $post['customId'] = $customId;
+        if (!empty($customId)) {
+            $custom = CustomClass::getCustom($customId);
+            CustomClass::valid($custom, $this->sjId);
+            $post['customMobile'] = $custom['mobile'] ?? '';
+            $customName = $custom['name'] ?? '';
+            $post['customName'] = $customName;
+            $post['customNamePy'] = stringUtil::getSpelling($customName);
+            $post['customAvatar'] = $custom['shortSmallAvatar'] ?? '';
         }
 
+        $post['shopAdminId'] = $this->shopAdminId;
+        $post['shopId'] = $shopId;
         $post['payWay'] = $this->isWx == true ? 0 : 1;
         $post['merchantId'] = $this->sjId;
-        $post['fromType'] = 1;//商城
+        $post['fromType'] = 1;
         $post['prePrice'] = 0.01;
         $post['actPrice'] = 0.01;
         $post['expressId'] = $post['expressId'] ?? 0;

+ 110 - 109
biz-ghs/custom/classes/CustomClass.php

@@ -12,113 +12,114 @@ use bizHd\base\classes\BaseClass;
 
 class CustomClass extends BaseClass
 {
-	
-	public static $baseFile = '\bizGhs\custom\models\Custom';
-	
-	//申请开店建立客户关系 shish 2021.2.28
-	public static function buildCustom($applyData, $sjId, $shopId, $isOpen)
-	{
-		if ($applyData['style'] == MerchantClass::STYLE_RETAIL) {
-			if ($applyData['introStyle'] == MerchantClass::STYLE_SUPPLIER) {
-				$has = CustomClass::getByCondition(['sjId' => $applyData['introSjId'], 'customSjId' => $sjId, 'customShopId' => $shopId]);
-				if (empty($has)) {
-					$customData = [
-						'customSjId' => $sjId,
-						'customShopId' => $shopId,
-						'sjId' => $applyData['introSjId'],
-						'name' => $applyData['name'],
-						'mobile' => $applyData['mobile'],
-						'isOpen' => $isOpen,
-					];
-					CustomClass::addCustom($customData);
-				}
-			}
-		}
-		if ($applyData['style'] == MerchantClass::STYLE_SUPPLIER) {
-			if ($applyData['introStyle'] == MerchantClass::STYLE_RETAIL) {
-				$has = CustomClass::getByCondition(['sjId' => $sjId, 'customSjId' => $applyData['introSjId'], 'customShopId' => $applyData['introShopId']]);
-				if (empty($has)) {
-					$introSjId = $applyData['introSjId'] ?? 0;
-					$introShopId = $applyData['introShopId'] ?? 0;
-					$shop = ShopClass::getShopInfo($introShopId);
-					$name = $shop['shopName'] ?? '';
-					$super = ShopClass::getSuper($introShopId);
-					$mobile = $super['mobile'] ?? '';
-					$customData = [
-						'customSjId' => $introSjId,
-						'customShopId' => $introShopId,
-						'sjId' => $sjId,
-						'name' => $name,
-						'mobile' => $mobile,
-						'isOpen' => 1,
-					];
-					CustomClass::addCustom($customData);
-				}
-			}
-		}
-	}
-	
-	//添加客户 shish 2021.2.24
-	public static function addCustom($data)
-	{
-		return self::add($data);
-	}
-	
-	//获取客户信息 shish 2021.2.4
-	public static function getCustom($id)
-	{
-		$info = self::getById($id);
-		$respond = self::groupBaseInfo([$info]);
-		return current($respond);
-	}
-	
-	public static function getCustomByIds($ids)
-	{
-		$list = self::getByIds($ids, null, 'id');
-		return self::groupBaseInfo($list);
-	}
-	
-	//整合头像等信息 shish 2021.1.8
-	public static function groupBaseInfo($list)
-	{
-		if (empty($list)) {
-			return $list;
-		}
-		//获取客户信息
-		$customSjIdList = array_unique(array_filter(array_column($list, 'customSjId')));
-		$retailInfo = MerchantClass::getByIds($customSjIdList, null, 'id');
-		foreach ($list as $key => $val) {
-			$customSjId = $val['customSjId'];
-			$currentInfo = isset($retailInfo[$customSjId]) ? $retailInfo[$customSjId] : [];
-			//组合头像
-			$currentInfo = business::formatMerchantLogo($currentInfo);
-			$smallAvatar = !empty($currentInfo['smallLogoUrl']) ? $currentInfo['smallLogoUrl'] : imgUtil::getPrefix() . '/hhb_small.png';
-			$avatar = !empty($currentInfo['logoUrl']) ? $currentInfo['logoUrl'] : imgUtil::getPrefix() . '/hhb_small.png';
-			$list[$key]['smallAvatar'] = $smallAvatar;
-			$list[$key]['avatar'] = $avatar;
-			$list[$key]['visitTime'] = '06-11 12:50';
-			$list[$key]['level'] = 0;
-		}
-		return $list;
-	}
-	
-	//欠款权限开关 shish 2021.1.8
-	public static function debt($custom, $debt)
-	{
-		$id = isset($custom['id']) ? $custom['id'] : 0;
-		self::updateById($id, ['debt' => $debt]);
-		return true;
-	}
-	
-	//权限判断 shish 2021.1.8
-	public static function valid($custom, $merchantId)
-	{
-		if (empty($custom)) {
-			util::fail('没有找到客户');
-		}
-		if ($custom['sjId'] != $merchantId) {
-			util::fail('您没有权限操作此客户');
-		}
-	}
-	
+
+    public static $baseFile = '\bizGhs\custom\models\Custom';
+
+    //申请开店建立客户关系 shish 2021.2.28
+    public static function buildCustom($applyData, $sjId, $shopId, $isOpen)
+    {
+        if ($applyData['style'] == MerchantClass::STYLE_RETAIL) {
+            if ($applyData['introStyle'] == MerchantClass::STYLE_SUPPLIER) {
+                $has = CustomClass::getByCondition(['sjId' => $applyData['introSjId'], 'customSjId' => $sjId, 'customShopId' => $shopId]);
+                if (empty($has)) {
+                    $customData = [
+                        'customSjId' => $sjId,
+                        'customShopId' => $shopId,
+                        'sjId' => $applyData['introSjId'],
+                        'name' => $applyData['name'],
+                        'mobile' => $applyData['mobile'],
+                        'isOpen' => $isOpen,
+                    ];
+                    CustomClass::addCustom($customData);
+                }
+            }
+        }
+        if ($applyData['style'] == MerchantClass::STYLE_SUPPLIER) {
+            if ($applyData['introStyle'] == MerchantClass::STYLE_RETAIL) {
+                $has = CustomClass::getByCondition(['sjId' => $sjId, 'customSjId' => $applyData['introSjId'], 'customShopId' => $applyData['introShopId']]);
+                if (empty($has)) {
+                    $introSjId = $applyData['introSjId'] ?? 0;
+                    $introShopId = $applyData['introShopId'] ?? 0;
+                    $shop = ShopClass::getShopInfo($introShopId);
+                    $name = $shop['shopName'] ?? '';
+                    $super = ShopClass::getSuper($introShopId);
+                    $mobile = $super['mobile'] ?? '';
+                    $customData = [
+                        'customSjId' => $introSjId,
+                        'customShopId' => $introShopId,
+                        'sjId' => $sjId,
+                        'name' => $name,
+                        'mobile' => $mobile,
+                        'isOpen' => 1,
+                    ];
+                    CustomClass::addCustom($customData);
+                }
+            }
+        }
+    }
+
+    //添加客户 shish 2021.2.24
+    public static function addCustom($data)
+    {
+        return self::add($data);
+    }
+
+    //获取客户信息 shish 2021.2.4
+    public static function getCustom($id)
+    {
+        $info = self::getById($id);
+        $respond = self::groupBaseInfo([$info]);
+        return current($respond);
+    }
+
+    public static function getCustomByIds($ids)
+    {
+        $list = self::getByIds($ids, null, 'id');
+        return self::groupBaseInfo($list);
+    }
+
+    //整合头像等信息 shish 2021.1.8
+    public static function groupBaseInfo($list)
+    {
+        if (empty($list)) {
+            return $list;
+        }
+        //获取客户信息
+        $customSjIdList = array_unique(array_filter(array_column($list, 'customSjId')));
+        $sjInfo = MerchantClass::getByIds($customSjIdList, null, 'id');
+        foreach ($list as $key => $val) {
+            $customSjId = $val['customSjId'];
+            $currentInfo = isset($sjInfo[$customSjId]) ? $sjInfo[$customSjId] : [];
+            $currentInfo = business::formatMerchantLogo($currentInfo);
+            $smallAvatar = !empty($currentInfo['smallLogoUrl']) ? $currentInfo['smallLogoUrl'] : imgUtil::getPrefix() . '/hhb_small.png';
+            $avatar = !empty($currentInfo['logoUrl']) ? $currentInfo['logoUrl'] : imgUtil::getPrefix() . '/hhb_small.png';
+            $list[$key]['smallAvatar'] = $smallAvatar;
+            $list[$key]['shortSmallAvatar'] = $currentInfo['shortSmallLogoUrl'];
+            $list[$key]['avatar'] = $avatar;
+            $list[$key]['shortAvatar'] = $currentInfo['shortLogoUrl'];
+            $list[$key]['visitTime'] = date("m-d H:i", strtotime($val['visitTime']));
+            $list[$key]['level'] = 0;
+        }
+        return $list;
+    }
+
+    //欠款权限开关 shish 2021.1.8
+    public static function debt($custom, $debt)
+    {
+        $id = isset($custom['id']) ? $custom['id'] : 0;
+        self::updateById($id, ['debt' => $debt]);
+        return true;
+    }
+
+    //权限判断 shish 2021.1.8
+    public static function valid($custom, $merchantId)
+    {
+        if (empty($custom)) {
+            util::fail('没有找到客户');
+        }
+        if ($custom['sjId'] != $merchantId) {
+            util::fail('您没有权限操作此客户');
+        }
+    }
+
 }

+ 6 - 5
biz-ghs/order/classes/OrderClass.php

@@ -256,13 +256,14 @@ class OrderClass extends BaseClass
             $list[$key]['product'] = $showItem['list'];
             $list[$key]['productStat'] = $showItem['itemStat'];
 
-            //显示重选花材按钮
-            $showResetItem = 1;
-            //配送中和已完成的不显示重选花材按钮
-            if (in_array($val['sendStatus'], [self::SEND_STATUS_SENDING, self::SEND_STATUS_COMPLETE])) {
-                $showResetItem = 0;
+            $showResetItem = 0;
+            //待付款订单显示改花材按钮
+            if ($val['status'] == self::PAY_STATUS_UN_PAY) {
+                $showResetItem = 1;
             }
+
             $list[$key]['showResetItem'] = $showResetItem;
+
             //获取配送进展
             $list[$key]['expressProgress'] = OrderExpressClass::getProgress($showExpress, $val);
         }

+ 231 - 228
common/components/business.php

@@ -12,249 +12,252 @@ use yii\imagine\Image;
 class business
 {
 
-	//支付方式对应资金要保存的字段 shish 2019.8.20
-	public static function savePayWayAmount($object, $amount, $payWay)
-	{
-		switch ($payWay) {
-			case 0:
-				$object->weixin += $amount;
-				break;
-			case 1:
-				$object->alipay += $amount;
-				break;
-			case 2:
-				$object->balancePay += $amount;
-				break;
-			case 3:
-				$object->cash += $amount;
-				break;
-			default:
-				util::fail('付款方式不存在');
-		}
-		return $object;
-	}
+    //支付方式对应资金要保存的字段 shish 2019.8.20
+    public static function savePayWayAmount($object, $amount, $payWay)
+    {
+        switch ($payWay) {
+            case 0:
+                $object->weixin += $amount;
+                break;
+            case 1:
+                $object->alipay += $amount;
+                break;
+            case 2:
+                $object->balancePay += $amount;
+                break;
+            case 3:
+                $object->cash += $amount;
+                break;
+            default:
+                util::fail('付款方式不存在');
+        }
+        return $object;
+    }
 
-	//对商品图片转化 shish 2019.12.2
-	public static function formatGoodsImg($info)
-	{
-		$shopImg = isset($info['shopImg']) ? $info['shopImg'] : [];
-		unset($info['shopImg']);
-		//没有保存图片返回空
-		if (empty($shopImg)) {
-			$info['shortImgList'] = [];
-			$info['imgList'] = [];
-			$info['smallImgList'] = [];
-			return $info;
-		}
-		$arr = json_decode($shopImg, true);
-		//图片内容转化失败返回空
-		if (is_array($arr) == false) {
-			$info['shortImgList'] = [];
-			$info['imgList'] = [];
-			$info['smallImgList'] = [];
-			return $info;
-		}
-		$imgList = [];
-		$smallImgList = [];
-		$prefixImgUrl = imgUtil::getPrefix();
-		$imageRoot = dirUtil::getImgUploadDir();
-		foreach ($arr as $imgUrl) {
-			$smallImg = self::getSmallImg($imgUrl);
-			$small = $prefixImgUrl . $smallImg;
-			$normal = $prefixImgUrl . $imgUrl;
+    //对商品图片转化 shish 2019.12.2
+    public static function formatGoodsImg($info)
+    {
+        $shopImg = isset($info['shopImg']) ? $info['shopImg'] : [];
+        unset($info['shopImg']);
+        //没有保存图片返回空
+        if (empty($shopImg)) {
+            $info['shortImgList'] = [];
+            $info['imgList'] = [];
+            $info['smallImgList'] = [];
+            return $info;
+        }
+        $arr = json_decode($shopImg, true);
+        //图片内容转化失败返回空
+        if (is_array($arr) == false) {
+            $info['shortImgList'] = [];
+            $info['imgList'] = [];
+            $info['smallImgList'] = [];
+            return $info;
+        }
+        $imgList = [];
+        $smallImgList = [];
+        $prefixImgUrl = imgUtil::getPrefix();
+        $imageRoot = dirUtil::getImgUploadDir();
+        foreach ($arr as $imgUrl) {
+            $smallImg = self::getSmallImg($imgUrl);
+            $small = $prefixImgUrl . $smallImg;
+            $normal = $prefixImgUrl . $imgUrl;
 
-			/*
-			$preImg = $imageRoot . str_replace('/uploads', '', $imgUrl);
-			if (file_exists($preImg)) {
-				//没有小图则生成小图,兼容旧系统
-				if (file_exists($imageRoot . $smallImg) == false) {
-					$imgInfo = getimagesize($preImg);
-					$width = isset($imgInfo[0]) ? $imgInfo[0] : 0;
-					$height = isset($imgInfo[1]) ? $imgInfo[1] : 0;
-					if ($width > 0) {
-						//生成小图 300px
-						$smallWidth = 300;
-						$smallHeight = ceil((300 * $height) / $width);
-						$smallFullPathFile = $imageRoot . str_replace('/uploads', '', $smallImg);
-						Image::thumbnail($preImg, $smallWidth, $smallHeight)->save($smallFullPathFile, ['quality' => 100]);
-					}
-				}
-			}
-			*/
+            /*
+            $preImg = $imageRoot . str_replace('/uploads', '', $imgUrl);
+            if (file_exists($preImg)) {
+                //没有小图则生成小图,兼容旧系统
+                if (file_exists($imageRoot . $smallImg) == false) {
+                    $imgInfo = getimagesize($preImg);
+                    $width = isset($imgInfo[0]) ? $imgInfo[0] : 0;
+                    $height = isset($imgInfo[1]) ? $imgInfo[1] : 0;
+                    if ($width > 0) {
+                        //生成小图 300px
+                        $smallWidth = 300;
+                        $smallHeight = ceil((300 * $height) / $width);
+                        $smallFullPathFile = $imageRoot . str_replace('/uploads', '', $smallImg);
+                        Image::thumbnail($preImg, $smallWidth, $smallHeight)->save($smallFullPathFile, ['quality' => 100]);
+                    }
+                }
+            }
+            */
 
-			$imgList[] = $normal;
-			$smallImgList[] = $small;
-		}
-		$info['shortImgList'] = $arr;
-		$info['imgList'] = $imgList;
-		$info['smallImgList'] = $smallImgList;
-		return $info;
-	}
+            $imgList[] = $normal;
+            $smallImgList[] = $small;
+        }
+        $info['shortImgList'] = $arr;
+        $info['imgList'] = $imgList;
+        $info['smallImgList'] = $smallImgList;
+        return $info;
+    }
 
-	//对商品款式的转化 shish 2019.12.4
-	public static function formatGoodsStyleImg($info)
-	{
-		$imgUrl = isset($info['picture']) ? $info['picture'] : '';
-		if (empty($imgUrl)) {
-			$info['img'] = '';
-		}
-		$prefixImgUrl = imgUtil::getPrefix();
-		$smallImg = self::getSmallImg($imgUrl);
-		$small = $prefixImgUrl . $smallImg;
+    //对商品款式的转化 shish 2019.12.4
+    public static function formatGoodsStyleImg($info)
+    {
+        $imgUrl = isset($info['picture']) ? $info['picture'] : '';
+        if (empty($imgUrl)) {
+            $info['img'] = '';
+        }
+        $prefixImgUrl = imgUtil::getPrefix();
+        $smallImg = self::getSmallImg($imgUrl);
+        $small = $prefixImgUrl . $smallImg;
 
 
-		//没有小图的生成小图(兼容旧系统) shish 2020.6.4
-		$imageRoot = dirUtil::getImgUploadDir();
-		$preImg = $imageRoot . str_replace('/uploads', '', $imgUrl);
-		if (file_exists($preImg)) {
-			//没有小图则生成小图,兼容旧系统
-			if (file_exists($imageRoot . $smallImg) == false) {
-				$imgInfo = getimagesize($preImg);
-				$width = isset($imgInfo[0]) ? $imgInfo[0] : 0;
-				$height = isset($imgInfo[1]) ? $imgInfo[1] : 0;
-				if ($width > 0) {
-					//生成小图 150px
-					$smallWidth = 150;
-					$smallHeight = ceil((150 * $height) / $width);
-					$smallFullPathFile = $imageRoot . str_replace('/uploads', '', $smallImg);
-					Image::thumbnail($preImg, $smallWidth, $smallHeight)->save($smallFullPathFile, ['quality' => 100]);
-				}
-			}
-		}
+        //没有小图的生成小图(兼容旧系统) shish 2020.6.4
+        $imageRoot = dirUtil::getImgUploadDir();
+        $preImg = $imageRoot . str_replace('/uploads', '', $imgUrl);
+        if (file_exists($preImg)) {
+            //没有小图则生成小图,兼容旧系统
+            if (file_exists($imageRoot . $smallImg) == false) {
+                $imgInfo = getimagesize($preImg);
+                $width = isset($imgInfo[0]) ? $imgInfo[0] : 0;
+                $height = isset($imgInfo[1]) ? $imgInfo[1] : 0;
+                if ($width > 0) {
+                    //生成小图 150px
+                    $smallWidth = 150;
+                    $smallHeight = ceil((150 * $height) / $width);
+                    $smallFullPathFile = $imageRoot . str_replace('/uploads', '', $smallImg);
+                    Image::thumbnail($preImg, $smallWidth, $smallHeight)->save($smallFullPathFile, ['quality' => 100]);
+                }
+            }
+        }
 
 
-		$info['img'] = $small;
-		return $info;
-	}
+        $info['img'] = $small;
+        return $info;
+    }
 
-	//图库图片的转化
-	public static function formatPic($info)
-	{
-		$imgUrl = isset($info['img']) ? $info['img'] : '';
-		if (empty($imgUrl)) {
-			$info['imgUrl'] = '';
-		}
-		$prefixImgUrl = imgUtil::getPrefix();
-		$smallImg = self::getSmallImg($imgUrl);
-		$small = $prefixImgUrl . $smallImg;
-		$info['imgUrl'] = $small;
-		return $info;
-	}
+    //图库图片的转化
+    public static function formatPic($info)
+    {
+        $imgUrl = isset($info['img']) ? $info['img'] : '';
+        if (empty($imgUrl)) {
+            $info['imgUrl'] = '';
+        }
+        $prefixImgUrl = imgUtil::getPrefix();
+        $smallImg = self::getSmallImg($imgUrl);
+        $small = $prefixImgUrl . $smallImg;
+        $info['imgUrl'] = $small;
+        return $info;
+    }
 
-	//分类图的处理
-	public static function formatCategoryImg($info)
-	{
-		$imgUrl = isset($info['img']) ? $info['img'] : '';
-		if (empty($imgUrl)) {
-			$info['imgUrl'] = '';
-		}
-		$prefixImgUrl = imgUtil::getPrefix();
-		$smallImg = self::getSmallImg($imgUrl);
-		$small = $prefixImgUrl . $smallImg;
-		$info['imgUrl'] = $small;
-		return $info;
-	}
+    //分类图的处理
+    public static function formatCategoryImg($info)
+    {
+        $imgUrl = isset($info['img']) ? $info['img'] : '';
+        if (empty($imgUrl)) {
+            $info['imgUrl'] = '';
+        }
+        $prefixImgUrl = imgUtil::getPrefix();
+        $smallImg = self::getSmallImg($imgUrl);
+        $small = $prefixImgUrl . $smallImg;
+        $info['imgUrl'] = $small;
+        return $info;
+    }
 
-	//客户头像处理 shish 2019.12.20
-	public static function formatUserAvatar($info)
-	{
-		$imgUrl = isset($info['avatar']) ? $info['avatar'] : '';
-		$prefixImgUrl = imgUtil::getPrefix();
-		$dir = dirUtil::getImgDir();
-		if (empty($imgUrl) || file_exists($dir . $imgUrl) == false) {
-			$defaultImg = $prefixImgUrl . '/retail/default-img.png';
-			$info['avatarUrl'] = $defaultImg;
-			$info['smallAvatarUrl'] = $defaultImg;
-			return $info;
-		}
-		$smallImg = self::getSmallImg($imgUrl);
-		$small = $prefixImgUrl . $smallImg;
-		$info['smallAvatarUrl'] = $small;
-		$info['avatarUrl'] = $prefixImgUrl . $imgUrl;
-		$info['avatar'] = $prefixImgUrl . $imgUrl;
-		return $info;
-	}
+    //客户头像处理 shish 2019.12.20
+    public static function formatUserAvatar($info)
+    {
+        $imgUrl = isset($info['avatar']) ? $info['avatar'] : '';
+        $prefixImgUrl = imgUtil::getPrefix();
+        $dir = dirUtil::getImgDir();
+        if (empty($imgUrl) || file_exists($dir . $imgUrl) == false) {
+            $defaultImg = $prefixImgUrl . '/retail/default-img.png';
+            $info['avatarUrl'] = $defaultImg;
+            $info['smallAvatarUrl'] = $defaultImg;
+            return $info;
+        }
+        $smallImg = self::getSmallImg($imgUrl);
+        $small = $prefixImgUrl . $smallImg;
+        $info['smallAvatarUrl'] = $small;
+        $info['avatarUrl'] = $prefixImgUrl . $imgUrl;
+        $info['avatar'] = $prefixImgUrl . $imgUrl;
+        return $info;
+    }
 
-	public static function formatOrderGoodsCover($info)
-	{
-		$imgUrl = isset($info['cover']) ? $info['cover'] : '';
-		if (empty($imgUrl)) {
-			$info['coverUrl'] = '';
-			$info['smallCoverUrl'] = '';
-			return $info;
-		}
-		$prefixImgUrl = imgUtil::getPrefix();
-		$smallImg = self::getSmallImg($imgUrl);
-		$small = $prefixImgUrl . $smallImg;
-		$info['smallCoverUrl'] = $small;
-		$info['coverUrl'] = $prefixImgUrl . $imgUrl;
-		return $info;
-	}
+    public static function formatOrderGoodsCover($info)
+    {
+        $imgUrl = isset($info['cover']) ? $info['cover'] : '';
+        if (empty($imgUrl)) {
+            $info['coverUrl'] = '';
+            $info['smallCoverUrl'] = '';
+            return $info;
+        }
+        $prefixImgUrl = imgUtil::getPrefix();
+        $smallImg = self::getSmallImg($imgUrl);
+        $small = $prefixImgUrl . $smallImg;
+        $info['smallCoverUrl'] = $small;
+        $info['coverUrl'] = $prefixImgUrl . $imgUrl;
+        return $info;
+    }
 
-	//商家公众号logo处理 shish 2019.12.20
-	public static function formatMerchantLogo($info)
-	{
-		$imgUrl = isset($info['logo']) ? $info['logo'] : '';
-		$prefixImgUrl = imgUtil::getPrefix();
-		if (empty($imgUrl)) {
-			$info['logoUrl'] = $prefixImgUrl . '/retail/default-img.png';
-			$info['smallLogoUrl'] = $prefixImgUrl . '/retail/default-img.png';
-			$info['smallWxQrCodeUrl'] = $prefixImgUrl . '/retail/default-img.png';
-			$info['wxQrCodeUrl'] = $prefixImgUrl . '/retail/default-img.png';
-			return $info;
-		}
-		//logo
-		$smallImg = self::getSmallImg($imgUrl);
-		$small = $prefixImgUrl . $smallImg;
-		$info['smallLogoUrl'] = $small;
-		$info['logoUrl'] = $prefixImgUrl . $imgUrl;
-		//二维码
-		$smallImg = self::getSmallImg($info['wxQrCodeUrl']);
-		$small = $prefixImgUrl . $smallImg;
-		$info['smallWxQrCodeUrl'] = $small;
-		$info['wxQrCodeUrl'] = $prefixImgUrl . $imgUrl;
+    //商家公众号logo处理 shish 2019.12.20
+    public static function formatMerchantLogo($info)
+    {
+        $imgUrl = isset($info['logo']) ? $info['logo'] : '';
+        $prefixImgUrl = imgUtil::getPrefix();
+        if (empty($imgUrl)) {
+            $info['logoUrl'] = $prefixImgUrl . '/retail/default-img.png';
+            $info['shortLogoUrl'] = 'retail/default-img.png';
+            $info['smallLogoUrl'] = $prefixImgUrl . '/retail/default-img.png';
+            $info['shortSmallLogoUrl'] = 'retail/default-img.png';
+            $info['smallWxQrCodeUrl'] = $prefixImgUrl . '/retail/default-img.png';
+            $info['wxQrCodeUrl'] = $prefixImgUrl . '/retail/default-img.png';
+            return $info;
+        }
+        //logo
+        $smallImg = self::getSmallImg($imgUrl);
+        $small = $prefixImgUrl . $smallImg;
+        $info['smallLogoUrl'] = $small;
+        $info['shortSmallLogoUrl'] = $smallImg;
+        $info['logoUrl'] = $prefixImgUrl . $imgUrl;
+        $info['shortLogoUrl'] = $imgUrl;
+        //二维码
+        $smallImg = self::getSmallImg($info['wxQrCodeUrl']);
+        $small = $prefixImgUrl . $smallImg;
+        $info['smallWxQrCodeUrl'] = $small;
+        $info['wxQrCodeUrl'] = $prefixImgUrl . $imgUrl;
+        return $info;
+    }
 
-		return $info;
-	}
+    //上传的图片进行转换 shish 2019.12.28
+    public static function formatUploadImg($imgUrl)
+    {
+        $prefix = imgUtil::getPrefix();
+        $small = self::getSmallImg($imgUrl);
+        $url = $prefix . $imgUrl;
+        $smallUrl = $prefix . $small;
+        return ['url' => $url, 'smallUrl' => $smallUrl];
+    }
 
-	//上传的图片进行转换 shish 2019.12.28
-	public static function formatUploadImg($imgUrl)
-	{
-		$prefix = imgUtil::getPrefix();
-		$small = self::getSmallImg($imgUrl);
-		$url = $prefix . $imgUrl;
-		$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);
+        $ext = substr($imgUrl, ($pos + 1));
+        $smallImg = $pre . '_small.' . $ext;
+        return $smallImg;
+    }
 
-	//取小图,尺寸 200px shish 2019.12.4
-	public static function getSmallImg($imgUrl)
-	{
-	    //2021.3.18 去除尺寸,之后可以用oss裁剪
-	    return $imgUrl;
-		//如果没有小图需要生成小图
-		$pos = strrpos($imgUrl, '.');
-		$pre = substr($imgUrl, 0, $pos);
-		$ext = substr($imgUrl, ($pos + 1));
-		$smallImg = $pre . '_small.' . $ext;
-		return $smallImg;
-	}
-
-	//平台员工头像处理 shish 2020.1.5
-	public static function formatStaffAvatar($info)
-	{
-		$imgUrl = isset($info['avatar']) ? $info['avatar'] : '';
-		if (empty($imgUrl)) {
-			$info['avatarUrl'] = '';
-			$info['smallAvatarUrl'] = '';
-			return $info;
-		}
-		$prefixImgUrl = imgUtil::getPrefix();
-		$smallImg = self::getSmallImg($imgUrl);
-		$small = $prefixImgUrl . $smallImg;
-		$info['smallAvatarUrl'] = $small;
-		$info['avatarUrl'] = $prefixImgUrl . $imgUrl;
-		return $info;
-	}
+    //平台员工头像处理 shish 2020.1.5
+    public static function formatStaffAvatar($info)
+    {
+        $imgUrl = isset($info['avatar']) ? $info['avatar'] : '';
+        if (empty($imgUrl)) {
+            $info['avatarUrl'] = '';
+            $info['smallAvatarUrl'] = '';
+            return $info;
+        }
+        $prefixImgUrl = imgUtil::getPrefix();
+        $smallImg = self::getSmallImg($imgUrl);
+        $small = $prefixImgUrl . $smallImg;
+        $info['smallAvatarUrl'] = $small;
+        $info['avatarUrl'] = $prefixImgUrl . $imgUrl;
+        return $info;
+    }
 
 }