瀏覽代碼

提成添加总金额

yuanrf 9 月之前
父節點
當前提交
8a64ac5dfe
共有 1 個文件被更改,包括 12 次插入1 次删除
  1. 12 1
      OASystem/OASystem.Api/Controllers/FinancialController.cs

+ 12 - 1
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -4994,11 +4994,22 @@ Group by PriceType ", dto.diId);
 
             }
 
-            jw.Data = resultArr;
             if (resultArr.Count > 0)
             {
                 jw.Code = 200;
                 jw.Msg = "success!";
+                decimal total = 0;
+                foreach (var item in resultArr)
+                {
+                    var number = item.GetType().GetProperty("price")?.GetValue(item)?.ToString();
+                    total += decimal.TryParse(number,out decimal numberInt) ? numberInt : 0.00M;
+                }
+
+                jw.Data = new
+                {
+                    resultArr,
+                    totalPrice = total,
+                };
             }
             else
             {