瀏覽代碼

更新订单bug

zhangkun 5 年之前
父節點
當前提交
ea2934ac7e

+ 12 - 9
代码/System.Common/Filter/ActionFilter.cs

@@ -33,7 +33,7 @@ namespace System.Common
33 33
             }
34 34
             catch
35 35
             {
36
-                log.Error("ContentType:" + request.ContentType);
36
+                //log.Error("ContentType:" + request.ContentType);
37 37
             }
38 38
             if (islog)
39 39
             {
@@ -73,14 +73,17 @@ namespace System.Common
73 73
             bool islog = false;
74 74
             try
75 75
             {
76
-                if (request.Method == "GET")
77
-                {
78
-                    islog = request.Query.ContainsKey("log");
79
-                }
80
-                else
81
-                {
82
-                    islog = request.Form.ContainsKey("log");
83
-                }
76
+                if (!context.Result.ToJson().Contains("{\"state\":\"success\""))
77
+                    if (request.Method == "GET")
78
+                    {
79
+                        islog = request.Query.ContainsKey("log");
80
+                    }
81
+                    else
82
+                    {
83
+                        islog = request.Form.ContainsKey("log");
84
+                    }
85
+
86
+
84 87
             }
85 88
             catch
86 89
             {

+ 4 - 4
代码/TVShoppingCallCenter_ZLJ/Controllers/Order/OrderController.cs

@@ -473,8 +473,8 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Order
473 473
 
474 474
             //必须属性 系统生成
475 475
             modelOrder.F_AddTime = DateTime.Now;
476
-            modelOrder.F_AddUser = int.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.PrimarySid).Value, 0);
477
-            modelOrder.F_AddUserName = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Name).Value;
476
+            modelOrder.F_AddUser =UserLogin.UserId.ObjToInt();
477
+            modelOrder.F_AddUserName = UserLogin.UserName;
478 478
 
479 479
             #endregion
480 480
 
@@ -554,8 +554,8 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Order
554 554
                 int n = 1;
555 555
                 foreach (OrderDetailInput m in input.OrderDetailList)
556 556
                 {
557
-                    T_Bus_Product modelProduct = await bus_productRepository.GetSingle(b => b.F_ProductId == m.F_ProductId && b.F_IsSale == 1);
558
-
557
+                    T_Bus_Product modelProduct = await bus_productRepository.GetSingle(b => b.F_ProductId == m.F_ProductId);
558
+                    if (modelProduct == null) return Error("在售商品不存在");
559 559
                     T_Bus_OrderDetail modelDetail = new T_Bus_OrderDetail();
560 560
                     modelDetail.F_ProductName = modelProduct.F_ProductName;
561 561
                     modelDetail.F_ProductId = modelProduct.F_ProductId;