Selaa lähdekoodia

初始化花材

林琦海 5 vuotta sitten
vanhempi
commit
8cc6147b89

+ 2 - 2
app-ghs/controllers/UploadController.php

@@ -51,7 +51,7 @@ class UploadController extends BaseController
 			if (file_put_contents($fullPathFile, base64_decode(str_replace($result[1], '', $base64_image_content))) == false) {
 				util::fail('上传失败!!');
 			}
-			$img = "/uploads/{$merchantId}/{$month}/{$date}/" . $newFile;
+			$img = "uploads/{$merchantId}/{$month}/{$date}/" . $newFile;
 			$imgInfo = getimagesize($fullPathFile);
 			$width = $imgInfo[0];
 			$height = $imgInfo[1];
@@ -66,7 +66,7 @@ class UploadController extends BaseController
 				Image::thumbnail($fullPathFile, $newWidth, $newHeight)->save($newFullPathFile, ['quality' => 100]);
 				$width = $newWidth;
 				$height = $newHeight;
-				$img = "/uploads/{$merchantId}/{$month}/{$date}/" . $newFile;
+				$img = "uploads/{$merchantId}/{$month}/{$date}/" . $newFile;
 				unlink($fullPathFile);
 				$fullPathFile = $newFullPathFile;
 			}

+ 3 - 3
biz-ghs/item/services/ItemService.php

@@ -214,9 +214,9 @@ class ItemService extends BaseService
                     $itemData['classId'] = $ghsClassId;
                     $itemData['merchantId'] = $sjId;
                     $itemData['itemId'] = $v['id'];
-                    unset($v['id']);
+                    unset($itemData['id']);
                     $itemData['rank'] = 'A';
-                    ItemClassClass::add($itemData);
+                    ItemClass::add($itemData);
                 }
                 //写入product
                 foreach ($ptItem as $v){
@@ -226,7 +226,7 @@ class ItemService extends BaseService
                     $productData['merchantId'] = $sjId;
                     $productData['shopId'] = $shopId;
                     $productData['itemId'] = $v['id'];
-                    unset($v['id']);
+                    unset($productData['id']);
                     $productData['rank'] = 'A';
                     ProductClass::add($productData);
                 }