shish 5 years ago
parent
commit
1a90b1056c
2 changed files with 0 additions and 42 deletions
  1. 0 40
      app-ghs/controllers/OrderController.php
  2. 0 2
      biz-ghs/order/services/OrderService.php

+ 0 - 40
app-ghs/controllers/OrderController.php

@@ -465,44 +465,4 @@ class OrderController extends BaseController
         util::success($respond);
     }
 
-    //损耗  linqh 2021.6.11
-    public function actionWastage()
-    {
-
-        $post = Yii::$app->request->post();
-        $post['shopId'] = $this->shopId;
-        $post['sjId'] = $this->sjId;
-        $post['adminId'] = $this->adminId;
-        $productJson = $post['product'] ?? '';
-        if (empty($productJson)) {
-            util::fail('请选择花材');
-        }
-        $productList = json_decode($productJson, true);
-        if (empty($productList)) {
-            util::fail('请选择花材');
-        }
-        //判断花材里的信息
-        foreach ($productList as $v) {
-            $bigNum = $v['bigNum'] ?? 0;
-            $smallNum = $v['smallNum'] ?? 0;
-            if ($bigNum <= 0 && $smallNum <= 0) {
-                util::fail('花材数量不能为0');
-            }
-        }
-        $connection = Yii::$app->db;//事务处理
-        $transaction = $connection->beginTransaction();
-        try {
-            //判断花材有效性
-            ProductClass::valid($productList, $this->shopId);
-            $post['product'] = $productList;
-            $return = StockWastageOrderClass::addOrder($post);
-            $transaction->commit();
-            util::success($return);
-        } catch (\Exception $e) {
-            $transaction->rollBack();
-            Yii::info("报损失败原因:" . $e->getMessage());
-            util::fail('报损保存失败');
-        }
-    }
-
 }

+ 0 - 2
biz-ghs/order/services/OrderService.php

@@ -6,11 +6,9 @@ use biz\ghs\classes\GhsClass;
 use biz\shop\classes\ShopAdminClass;
 use biz\shop\classes\ShopCapitalClass;
 use biz\shop\classes\ShopClass;
-use biz\shop\models\Shop;
 use biz\wx\classes\WxMessageClass;
 use bizGhs\base\services\BaseService;
 use bizGhs\custom\classes\CustomClass;
-use bizGhs\custom\models\Custom;
 use bizGhs\order\classes\OrderClass;
 use bizGhs\order\classes\OrderExpressClass;
 use bizGhs\order\classes\OrderSendClass;