shish 5 سال پیش
والد
کامیت
20276950ed
2فایلهای تغییر یافته به همراه25 افزوده شده و 2 حذف شده
  1. 23 2
      app-ghs/controllers/OrderController.php
  2. 2 0
      biz-ghs/order/classes/OrderClass.php

+ 23 - 2
app-ghs/controllers/OrderController.php

@@ -92,11 +92,32 @@ class OrderController extends BaseController
         $post['shopAdminName'] = $shopAdmin['name'] ?? '';
         $post['merchantId'] = $this->sjId;
         $post['shopId'] = $shopId;
-        $post['payWay'] = $this->isWx == true ? 0 : 1;
         $post['fromType'] = 1;
         $post['expressId'] = $post['expressId'] ?? 0;
-        $post['clearType'] = $post['clearType'] ?? OrderClass::CLEAR_DEBT;
         $post['sendCost'] = $post['sendCost'] ?? '0.00';
+        $post['payWay'] = dict::getDict('payWay', 'wxPay');
+
+        //PC端开单
+        if (isset($post['clearType'])) {
+            $clearType = $post['clearType'];
+            if ($clearType == OrderClass::CLEAR_DEBT) {
+                $post['debt'] = OrderClass::DEBT_YES;
+                $post['payWay'] = dict::getDict('payWay', 'debtPay');
+            } else {
+                $post['debt'] = OrderClass::DEBT_NO;
+            }
+        }
+        //PC端开单
+        if (isset($post['getType'])) {
+            $getType = $post['getType'];
+            //自取
+            if ($getType == 1) {
+                $post['sendType'] = OrderClass::SEND_TYPE_NO;
+            } else {
+                //选择配送时,在发货时让商家自己再确认一下用什么方式
+                $post['sendType'] = OrderClass::SEND_TYPE_UNKNOWN;
+            }
+        }
 
         $productJson = $post['product'] ?? '';
         if (empty($productJson)) {

+ 2 - 0
biz-ghs/order/classes/OrderClass.php

@@ -72,7 +72,9 @@ class OrderClass extends BaseClass
     const TOTAL_FLOW = 3;
 
     //清算方式
+    //欠款
     const CLEAR_DEBT = 1;
+    //已付款
     const CLEAR_HAS_GATHERING = 2;
 
     //没有欠款