shish před 5 roky
rodič
revize
cf862661dd

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

@@ -4,6 +4,7 @@ namespace ghs\controllers;
 
 use bizGhs\clear\classes\ClearClass;
 use bizHd\purchase\classes\PurchaseClearClass;
+use common\components\dict;
 use common\components\util;
 use Yii;
 
@@ -30,8 +31,7 @@ class PurchaseClearController extends BaseController
         }
         $post['sjId'] = $this->sjId;
         $post['shopId'] = $this->shopId;
-        //1客户清算 2供货商清算
-        $post['type'] = 1;
+        $post['clearStyle'] = dict::getDict('clearStyle', 'ghs');
         $post['customShopAdminId'] = $this->shopAdminId;
         $shopAdmin = $this->shopAdmin;
         $shopAdminName = $shopAdmin['name'] ?? '';

+ 22 - 0
biz-ghs/clear/classes/ClearClass.php

@@ -48,6 +48,28 @@ class ClearClass extends BaseClass
             }
             $totalPrice = bcadd($totalPrice, $purchase->realPrice, 2);
         }
+        $ghs = GhsClass::getById($currentGhsId, true);
+        if (empty($ghs)) {
+            util::fail('没有找到供应商');
+        }
+        GhsClass::valid($ghs, $data['shopId']);
+        $ghsName = $ghs->name ?? '';
+        $ghsAvatar = $ghs->avatar ?? '';
+        $ghsMobile = $ghs->mobile ?? '';
+
+        $customId = $ghs->customId ?? 0;
+        $custom = CustomClass::getById($customId, true);
+        $customName = $custom->name ?? '';
+        $customAvatar = $custom->avatar ?? '';
+        $customMobile = $custom->mobile ?? '';
+
+        $data['ghsName'] = $ghsName;
+        $data['ghsAvatar'] = $ghsAvatar;
+        $data['ghsMobile'] = $ghsMobile;
+        $data['customName'] = $customName;
+        $data['customAvatar'] = $customAvatar;
+        $data['customMobile'] = $customMobile;
+
         $data['actPrice'] = $totalPrice;
         $data['prePrice'] = $totalPrice;
         $data['orderSn'] = $orderSn;

+ 7 - 0
common/components/dict.php

@@ -65,6 +65,13 @@ class dict
             'mall' => 3,//商城
             'kmGhs' => 4,//昆明供应商
         ],
+        //结帐方,与ptStyle一致
+        'clearStyle' => [
+            'hd' => 1,//零售花店
+            'ghs' => 2,//供应商
+            'mall' => 3,//商城
+            'kmGhs' => 4,//昆明供应商
+        ],
 
         'merchantStatus' => ['checking' => 0, 'pass' => 1, 'noPass' => 2, 'freeze' => 3, 'unfreeze' => 4, 'shut' => 5],