shish 5 жил өмнө
parent
commit
c79dfbd559

+ 2 - 2
biz-hd/wx/classes/WxBaseClass.php

@@ -18,7 +18,7 @@ class WxBaseClass extends BaseClass
 	public static function saveLogo($url, $merchantId)
 	{
 		$path = dirUtil::getImgDir();
-		$middle = "/wx/merchant/logo/";
+		$middle = "wx/merchant/logo/";
 		if (!file_exists($path . $middle)) {
 			mkdir($path . $middle, 0777, true);
 		}
@@ -63,7 +63,7 @@ class WxBaseClass extends BaseClass
 	public static function saveQrCode($url, $merchantId)
 	{
 		$path = dirUtil::getImgDir();
-		$middle = "/wx/merchant/qrCode/";
+		$middle = "wx/merchant/qrCode/";
 		if (!file_exists($path . $middle)) {
 			mkdir($path . $middle, 0777, true);
 		}

+ 2 - 2
biz-mall/wx/classes/WxBaseClass.php

@@ -18,7 +18,7 @@ class WxBaseClass extends BaseClass
 	public static function saveLogo($url, $merchantId)
 	{
 		$path = dirUtil::getImgDir();
-		$middle = "/wx/merchant/logo/";
+		$middle = "wx/merchant/logo/";
 		if (!file_exists($path . $middle)) {
 			mkdir($path . $middle, 0777, true);
 		}
@@ -63,7 +63,7 @@ class WxBaseClass extends BaseClass
 	public static function saveQrCode($url, $merchantId)
 	{
 		$path = dirUtil::getImgDir();
-		$middle = "/wx/merchant/qrCode/";
+		$middle = "wx/merchant/qrCode/";
 		if (!file_exists($path . $middle)) {
 			mkdir($path . $middle, 0777, true);
 		}

+ 18 - 18
common/components/dirUtil.php

@@ -6,22 +6,22 @@ use Yii;
 
 class dirUtil
 {
-	
-	//整个项目的根目录 ssh 2020.1.7
-	public static function getRootDir()
-	{
-		return Yii::getAlias('@vendor') . '/..';
-	}
-	
-	//图片上传保存的目录 ssh 2020.1.7
-	public static function getImgUploadDir()
-	{
-		return Yii::getAlias('@vendor') . '/../../resource/images/uploads';
-	}
-	
-	public static function getImgDir()
-	{
-		return Yii::getAlias('@vendor') . '/../../resource/images';
-	}
-	
+
+    //整个项目的根目录 ssh 2020.1.7
+    public static function getRootDir()
+    {
+        return Yii::getAlias('@vendor') . '/..';
+    }
+
+    //图片上传保存的目录 ssh 2020.1.7
+    public static function getImgUploadDir()
+    {
+        return Yii::getAlias('@vendor') . '/../../resource/images/uploads';
+    }
+
+    public static function getImgDir()
+    {
+        return Yii::getAlias('@vendor') . '/../../resource/images/';
+    }
+
 }

+ 3 - 3
common/components/miniUtil.php

@@ -1426,7 +1426,7 @@ class miniUtil
         $url = "https://api.weixin.qq.com/wxa/get_qrcode?access_token={$accessToken}&path=" . $path;
         $curl = new curl\Curl();
         $result = $curl->get($url);
-        $file = dirUtil::getImgDir() . '/retail/miniExperience/' . $merchant['id'] . '.jpg';
+        $file = dirUtil::getImgDir() . 'retail/miniExperience/' . $merchant['id'] . '.jpg';
         file_put_contents($file, $result);
         echo "<b /><img src='" . imgUtil::getPrefix() . "/retail/miniExperience/" . $merchant['id'] . ".jpg' />";
     }
@@ -1566,7 +1566,7 @@ class miniUtil
     public static function generateMemberCode($merchant, $shopId, $isOpen = 0)
     {
         $fileName = $merchant['id'] . '_' . $shopId . '_apply_member.jpg';
-        $behind = '/retail/mimiMemberCode/';
+        $behind = 'retail/mimiMemberCode/';
         $filePath = dirUtil::getImgDir() . $behind;
         if (!file_exists($filePath)) {
             mkdir($filePath, 0777, true);
@@ -1593,7 +1593,7 @@ class miniUtil
     {
         $id = isset($merchant['id']) ? $merchant['id'] : 0;
         $fileName = stringUtil::shortUniqueId($id) . '.jpg';
-        $behind = '/retail/mimiCode/' . date("Ym") . '/' . date("d") . '/' . $id . '/';
+        $behind = 'retail/mimiCode/' . date("Ym") . '/' . date("d") . '/' . $id . '/';
         $filePath = dirUtil::getImgDir() . $behind;
         if (!file_exists($filePath)) {
             mkdir($filePath, 0777, true);

+ 2 - 2
common/components/qrCodeUtil.php

@@ -176,7 +176,7 @@ class qrCodeUtil
 		$errorCorrectionLevel = 'H';
 		$matrixPointSize = $size;//生成图片大小
 		$prefix = dirUtil::getImgDir();
-		$middle = '/retail/qrCode/gathering/';
+		$middle = 'retail/qrCode/gathering/';
 		if (file_exists($prefix . $middle) == false) {
 			mkdir($prefix . $middle, 0777, true);
 		}
@@ -196,7 +196,7 @@ class qrCodeUtil
 		$errorCorrectionLevel = 'H';
 		$matrixPointSize = $size;//生成图片大小
 		$prefix = dirUtil::getImgDir();
-		$middle = '/retail/qrCode/h5Mall/';
+		$middle = 'retail/qrCode/h5Mall/';
 		if (file_exists($prefix . $middle) == false) {
 			mkdir($prefix . $middle, 0777, true);
 		}

+ 3 - 3
common/components/wxUtil.php

@@ -1454,7 +1454,7 @@ class wxUtil
         $url = "https://api.weixin.qq.com/wxa/get_qrcode?access_token={$accessToken}&path=" . $path;
         $curl = new curl\Curl();
         $result = $curl->get($url);
-        $file = dirUtil::getImgDir() . '/retail/miniExperience/' . $merchant['id'] . '.jpg';
+        $file = dirUtil::getImgDir() . 'retail/miniExperience/' . $merchant['id'] . '.jpg';
         file_put_contents($file, $result);
         //上传oss
         $obj = 'retail/miniExperience/' . $merchant['id'] . '.jpg';
@@ -1585,7 +1585,7 @@ class wxUtil
     public static function generateMemberCode($merchant, $shopId, $isOpen = 0)
     {
         $fileName = $merchant['id'] . '_' . $shopId . '_apply_member.jpg';
-        $behind = '/retail/mimiMemberCode/';
+        $behind = 'retail/mimiMemberCode/';
         $filePath = dirUtil::getImgDir() . $behind;
         if (!file_exists($filePath)) {
             mkdir($filePath, 0777, true);
@@ -1611,7 +1611,7 @@ class wxUtil
     public static function generateGatheringMiniCode($merchant, $shopId, $isOpen = 0)
     {
         $fileName = $merchant['id'] . '_' . $shopId . '_apply_member.jpg';
-        $behind = '/retail/gatheringMimiCode/';
+        $behind = 'retail/gatheringMimiCode/';
         $filePath = dirUtil::getImgDir() . $behind;
         if (!file_exists($filePath)) {
             mkdir($filePath, 0777, true);