shish 1 tahun lalu
induk
melakukan
4046fbd90d

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

@@ -703,7 +703,7 @@ class TestController extends BaseController
     //零售订单查询 ssh 20231031
     public function actionLsTradeQuery()
     {
-        $shopId = 726;
+        $shopId = 17117;
         $shop = ShopClass::getById($shopId, true);
         if (empty($shop)) {
             util::stop('没有找到门店21');
@@ -720,7 +720,7 @@ class TestController extends BaseController
         ];
         $laResource = new Lakala($params);
         $queryParams = [
-            'orderSn' => 'KD26615112',
+            'orderSn' => 'KD26615540',
             //'tradeNo' => '20231029110113130266215259252887',
         ];
         $response = $laResource->query($queryParams, 0);

+ 1 - 1
app-hd/controllers/GoodsController.php

@@ -186,7 +186,7 @@ class GoodsController extends BaseController
             GoodsClass::updateGoods($info, $data, $staff);
             $transaction->commit();
             util::complete();
-        } catch (Exception $e) {
+        } catch (\Exception $e) {
             $transaction->rollBack();
             util::fail();
         }

+ 0 - 50
biz-hd/goods/classes/GoodsStyleClass.php

@@ -38,54 +38,4 @@ class GoodsStyleClass extends BaseClass
 		return $new;
 	}
 
-	/*
-	更新商品的款式 ssh 2020.2.27
-	输入的数据格式 [
-	['styleName' => '红色1', 'price' => 0.1, 'picture' => '', 'action' => 'add', 'id' => 0],
-	['styleName' => '蓝色', 'price' => 0.1, 'picture' => '', 'action' => 'update', 'id' => 1],
-	['styleName' => '黑色2', 'price' => 0.1, 'picture' => '', 'action' => 'delete', 'id' => 2]
-	];
-	 */
-	public static function updateGoodsStyle($goodsStyleList, $goodsId)
-	{
-		$add = [];
-		$update = [];
-		$delete = [];
-		foreach ($goodsStyleList as $goodsStyle) {
-			$action = $goodsStyle['action'];
-			$id = $goodsStyle['id'];
-			switch ($action) {
-				case 'add':
-					unset($goodsStyle['id']);
-					$add[] = $goodsStyle;
-					break;
-				case 'update':
-					$update[] = $goodsStyle;
-					break;
-				case 'delete':
-					$delete[] = $id;
-					break;
-				default:
-					$add[] = $goodsStyle;
-			}
-		}
-		if (!empty($add)) {
-			$addStyle = [];
-			foreach ($add as $style) {
-				$addStyle[] = ['styleName' => $style['styleName'], 'goodsId' => $goodsId, 'picture' => $style['picture'], 'price' => $style['price']];
-			}
-			GoodsStyleClass::batchAdd($addStyle);
-		}
-		if (!empty($delete)) {
-			GoodsStyleClass::deleteByIds($delete);
-		}
-		if (!empty($update)) {
-			foreach ($update as $up) {
-				$currentId = $up['id'];
-				unset($up['id']);
-				self::updateById($currentId, $up);
-			}
-		}
-	}
-
 }

+ 0 - 12
biz-hd/order/classes/OrderClass.php

@@ -545,18 +545,6 @@ class OrderClass extends BaseClass
         }
     }
 
-    // 更新商品销量
-    protected static function updateGoodsActualSold($orderGoods)
-    {
-        foreach ($orderGoods as $goods) {
-            GoodsClass::counters([
-                'actualSold' => $goods['num']
-            ], [
-                'id' => $goods['goodsId']
-            ]);
-        }
-    }
-
     //云打印 ssh 20210709
     public static function onlinePrint($order, $must = false, $port = 'front')
     {

+ 0 - 35
biz-mall/goods/classes/GoodsClass.php

@@ -135,41 +135,6 @@ class GoodsClass extends BaseClass
         return $goodsInfo;
     }
 
-    //更新商品 ssh 2019.12.7
-    public static function updateGoods($id, $data)
-    {
-        $categoryIdList = isset($data['categoryIdList']) && !empty($data['categoryIdList']) ? $data['categoryIdList'] : [];
-        unset($data['categoryIdList']);
-        if (empty($categoryIdList)) {
-            util::fail('没有选择分类');
-        }
-        $goodsStyleList = isset($data['goodsStyleList']) && !empty($data['goodsStyleList']) ? $data['goodsStyleList'] : [];
-        unset($data['goodsStyleList']);
-
-        //处理分类
-        $sjId = $data['sjId'];
-        $mainId = $data['mainId'] ?? 0;
-        $merchantHasCategoryIdList = CategoryClass::getCategoryIds($mainId);
-        $diff = array_diff($categoryIdList, $merchantHasCategoryIdList);
-        if (!empty($diff)) {
-            util::fail('您使用了别人的分类');
-        }
-        //先删除再添加分类
-        GoodsCategoryClass::delGoodsCategory($id);
-        $addCategory = [];
-        foreach ($categoryIdList as $categoryId) {
-            $addCategory[] = ['gId' => $id, 'name' => $data['name'], 'cId' => $categoryId, 'sjId' => $data['sjId']];
-        }
-        GoodsCategoryClass::batchAdd($addCategory);
-
-        //处理款式
-        if (!empty($goodsStyleList) && $data['goodsStyle'] == 1) {
-            GoodsStyleClass::updateGoodsStyle($goodsStyleList, $id);
-        }
-
-        $data['shopImg'] = json_encode($data['shopImg']);
-        self::updateById($id, $data);
-    }
 
     //产品上下架 ssh 2019.12.8
     public static function changeStatus($id, $status)

+ 0 - 50
biz-mall/goods/classes/GoodsStyleClass.php

@@ -37,55 +37,5 @@ class GoodsStyleClass extends BaseClass
 		$new = self::groupStyleInfo($list);
 		return $new;
 	}
-	
-	/*
-	更新商品的款式 ssh 2020.2.27
-	输入的数据格式 [
-	['styleName' => '红色1', 'price' => 0.1, 'picture' => '', 'action' => 'add', 'id' => 0],
-	['styleName' => '蓝色', 'price' => 0.1, 'picture' => '', 'action' => 'update', 'id' => 1],
-	['styleName' => '黑色2', 'price' => 0.1, 'picture' => '', 'action' => 'delete', 'id' => 2]
-	];
-	 */
-	public static function updateGoodsStyle($goodsStyleList, $goodsId)
-	{
-		$add = [];
-		$update = [];
-		$delete = [];
-		foreach ($goodsStyleList as $goodsStyle) {
-			$action = $goodsStyle['action'];
-			$id = $goodsStyle['id'];
-			switch ($action) {
-				case 'add':
-					unset($goodsStyle['id']);
-					$add[] = $goodsStyle;
-					break;
-				case 'update':
-					$update[] = $goodsStyle;
-					break;
-				case 'delete':
-					$delete[] = $id;
-					break;
-				default:
-					$add[] = $goodsStyle;
-			}
-		}
-		if (!empty($add)) {
-			$addStyle = [];
-			foreach ($add as $style) {
-				$addStyle[] = ['styleName' => $style['styleName'], 'goodsId' => $goodsId, 'picture' => $style['picture'], 'price' => $style['price']];
-			}
-			GoodsStyleClass::batchAdd($addStyle);
-		}
-		if (!empty($delete)) {
-			GoodsStyleClass::deleteByIds($delete);
-		}
-		if (!empty($update)) {
-			foreach ($update as $up) {
-				$currentId = $up['id'];
-				unset($up['id']);
-				self::updateById($currentId, $up);
-			}
-		}
-	}
 
 }