瀏覽代碼

调整支付规则

lcl 1 年之前
父節點
當前提交
aaa731b4ca
共有 1 個文件被更改,包括 11 次插入7 次删除
  1. 11 7
      Areas/Api/Controllers/v1/MainServer/ConsumerOrdersController.cs

+ 11 - 7
Areas/Api/Controllers/v1/MainServer/ConsumerOrdersController.cs

@@ -273,13 +273,17 @@ namespace MySystem.Areas.Api.Controllers.v1
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             MerchantQrCode qrcode = MerchantQrCodeDbconn.Instance.Get(SnNo) ?? new MerchantQrCode();
             PosMachinesTwo pos = PosMachinesTwoDbconn.Instance.Get(SnNo) ?? new PosMachinesTwo();
-            // PosMachines machine = PosMachinesDbconn.Instance.Get(qrcode.SnId) ?? new PosMachines();
-            // if (machine.BindMerchantId == 0) machine.BindMerchantId = 1; // TODO: 需要绑定二维码
-            if(pos.OpId == 1)
+            PosMachines machine = PosMachinesDbconn.Instance.Get(SnNo) ?? new PosMachines();
+            int MerchantId = qrcode.MerchantId;
+            if(machine.DeviceKind == "1")
             {
-                MerchantInfo merchant = MerchantInfoDbconn.Instance.Get(qrcode.MerchantId) ?? new MerchantInfo();
-                MerchantAddInfo merchantAdd = MerchantAddInfoDbconn.Instance.Get(qrcode.MerchantId) ?? new MerchantAddInfo();
-                MerchantParamSet merchantset = MerchantParamSetDbconn.Instance.Get(qrcode.MerchantId) ?? new MerchantParamSet();
+                MerchantId = machine.BindMerchantId;
+            }
+            if(pos.OpId == 1 || machine.DeviceKind == "1")
+            {
+                MerchantInfo merchant = MerchantInfoDbconn.Instance.Get(MerchantId) ?? new MerchantInfo();
+                MerchantAddInfo merchantAdd = MerchantAddInfoDbconn.Instance.Get(MerchantId) ?? new MerchantAddInfo();
+                MerchantParamSet merchantset = MerchantParamSetDbconn.Instance.Get(MerchantId) ?? new MerchantParamSet();
                 string openid = "";
                 if (PayMode == 1)
                 { 
@@ -330,7 +334,7 @@ namespace MySystem.Areas.Api.Controllers.v1
                 {
                     // Id = PublicFunction.MakeConsumerOrderId(),
                     CreateDate = DateTime.Now, //创建时间
-                    MerchantId = qrcode.MerchantId, //商户
+                    MerchantId = MerchantId, //商户
                     ConsumerId = ConsumerId, //消费者
                     UserId = merchant.UserId, //创客
                     PayMode = PayMode, //支付方式