shish 5 лет назад
Родитель
Сommit
e2ad4a4a65

+ 26 - 0
app-ghs/controllers/ClearController.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace ghs\controllers;
+
+use bizGhs\clear\services\ClearService;
+use common\components\stringUtil;
+use common\components\util;
+use Yii;
+
+class ClearController extends BaseController
+{
+
+    //结款单 shish 20210625
+    public function actionList()
+    {
+        $get = Yii::$app->request->get();
+        $where = ['sjId' => $this->sjId, 'shopId' => $this->shopId];
+        if (isset($get['customId'])) {
+            $where['customId'] = $get['customId'];
+        }
+        $where['status'] = 2;
+        $list = ClearService::getCustomList($where);
+        util::success($list);
+    }
+
+}

+ 1 - 1
app-ghs/controllers/OrderClearController.php

@@ -25,7 +25,7 @@ class OrderClearController extends BaseController
 			'ghsShopAdminName' => $this->shopAdmin['name'],
 		];
 		try {
-			OrderClearClass::clear($data, $id, $this->sjId);
+			OrderClearClass::clear($data, $id, $this->sjId,$this->shopId);
 			$transaction->commit();
 		} catch (\Exception $exception) {
 			$transaction->rollBack();

+ 25 - 0
biz-ghs/clear/services/ClearService.php

@@ -0,0 +1,25 @@
+<?php
+
+namespace bizGhs\clear\services;
+
+use bizGhs\base\services\BaseService;
+use bizGhs\clear\classes\ClearClass;
+
+class ClearService extends BaseService
+{
+
+    public static $baseFile = '\bizGhs\clear\classes\ClearClass';
+
+    //清单列表 shish 20210625
+    public static function getCustomList($where)
+    {
+        $data = ClearClass::getList('*', $where, 'addTime DESC');
+        $list = isset($data['list']) && !empty($data['list']) ? $data['list'] : [];
+        if (empty($list)) {
+            return $data;
+        }
+        return $data;
+    }
+
+
+}

+ 2 - 1
biz-ghs/order/classes/OrderClearClass.php

@@ -17,7 +17,7 @@ class OrderClearClass extends BaseClass
     public static $baseFile = '\bizGhs\order\models\OrderClear';
 
     //订单结算 ssh 2021.3.14
-    public static function clear($post, $idText, $sjId)
+    public static function clear($post, $idText, $sjId, $shopId)
     {
         $customId = $post['customId'];
         $data = json_decode($idText, true);
@@ -90,6 +90,7 @@ class OrderClearClass extends BaseClass
             'ghsShopAdminId' => $post['ghsShopAdminId'],
             'ghsShopAdminName' => $post['ghsShopAdminName'],
             'sjId' => $sjId,
+            'shopId' => $shopId,
             'orderSn' => $orderSn,
             'saleIds' => implode(',', $ids),
             'status' => 2,

+ 1 - 0
biz-ghs/order/services/OrderClearService.php

@@ -3,6 +3,7 @@
 namespace bizGhs\order\services;
 
 use bizGhs\base\services\BaseService;
+use bizGhs\order\classes\OrderClearClass;
 
 class OrderClearService extends BaseService
 {