Просмотр исходного кода

Merge branch 'master' into dev

shish 8 месяцев назад
Родитель
Сommit
e5bed1ccb5
2 измененных файлов с 14 добавлено и 9 удалено
  1. 7 7
      app-ghs/controllers/TestController.php
  2. 7 2
      biz-ghs/product/classes/ProductClass.php

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

@@ -807,7 +807,7 @@ class TestController extends BaseController
             }
             $attach = 'merchant_no=' . $merchant_no;
             $capitalType = dict::getDict('capitalType', 'hdPurchaseClear', 'id');
-            echo $currentPayWay.'|'.$capitalType.'|'.$orderSn.'|'.$totalFee.'|'. $attach.'|'.$transactionId;
+            echo $currentPayWay . '|' . $capitalType . '|' . $orderSn . '|' . $totalFee . '|' . $attach . '|' . $transactionId;
             payUtil::thirdPay($currentPayWay, $capitalType, $orderSn, $totalFee, $attach, $transactionId);
         }
     }
@@ -944,7 +944,7 @@ class TestController extends BaseController
     //交易查询 ssh 20231021
     public function actionTradeQuery()
     {
-        $shopId = 7855;
+        $shopId = 66030;
         $shop = ShopClass::getById($shopId, true);
         if (empty($shop)) {
             util::stop('没有找到门店,编号677230');
@@ -960,11 +960,13 @@ class TestController extends BaseController
             'lklCertificatePath' => $lklCertificatePath,
         ];
         $laResource = new Lakala($params);
+        $orderSn = 'CG29795164';
+        $tradeNo = '66223122980070';
         $queryParams = [
-            'orderSn' => 'CG29746628',
-            //'tradeNo' => '66221061685504',
+            'orderSn' => $orderSn,
+            'tradeNo' => $tradeNo,
         ];
-        $response = $laResource->query($queryParams, 0);
+        $response = $laResource->query($queryParams, 1);
         echo "<pre>";
         print_r($response);
         util::stop();
@@ -973,7 +975,6 @@ class TestController extends BaseController
             $connection = Yii::$app->db;
             $transaction = $connection->beginTransaction();
             try {
-
                 $account_type = $response['resp_data']['account_type'] ?? 0;
                 if (empty($account_type)) {
                     noticeUtil::push('支付回调失败了,没有找到钱包类型,请注意', '15280215347');
@@ -988,7 +989,6 @@ class TestController extends BaseController
                     noticeUtil::push('支付回调失败了,没有找到支付类型', '15280215347');
                     util::end();
                 }
-
                 $attach = '';
                 $total_amount = $response['resp_data']['total_amount'] ?? 0;
                 $orderSn = $response['resp_data']['out_trade_no'] ?? 0;

+ 7 - 2
biz-ghs/product/classes/ProductClass.php

@@ -1028,6 +1028,11 @@ class ProductClass extends BaseClass
             self::updateActualSoldById($productId, $newActualSold);
         }
 
+        //如果花材是自动补充库存类型的花材,则库存低于1000时,自动补充到5999
+        if ($productData->virtualStock == 1 && $newStock < 1000) {
+            self::updateStockById($productId, 5999);
+        }
+
         //库存=0 下架商品,特价去掉,限购去掉 lqh 2021.7.9 ssh 20251106
         if ($newStock <= 0) {
             self::changeStatus($productId, 2);
@@ -1555,8 +1560,8 @@ class ProductClass extends BaseClass
                 if ($data['stock'] < 0) {
                     util::fail("库存不能小于0");
                 }
-                if ($data['stock'] > 99999) {
-                    util::fail('库存数不能超过5个9');
+                if ($data['stock'] > 9999) {
+                    util::fail('库存数不能超过4个9');
                 }
                 //增加盘点记录 2021.7.27
                 $ratio = $product->ratio ?? 0;