瀏覽代碼

Merge branch 'feature-dgy-第一批新式导出功能' into feature-dgy-后台测试

DuGuYang 3 年之前
父節點
當前提交
ba2df94bb7

+ 3 - 2
Areas/Admin/Controllers/MainServer/OrdersController.cs

@@ -1289,7 +1289,7 @@ namespace MySystem.Areas.Admin.Controllers
         public string QuickExportExcelDo(string UserIdMakerCode, string UserIdRealName, string PayModeSelect, string StoreIdStoreNo, string StoreIdStoreName, string RefundStatusSelect, string DeliveryTypeSelect, string SendStatusSelect, string ProductIdSelect, string StoreTypeSelect, string StoreUserIdMakerCode, string StoreUserIdRealName, string PayStatusSelect, string CreateDateData, string SendDateData, string PayDateData)
         {
 
-            string SqlString = " where 1=1 and a.Status>=-1";
+            string SqlString = " where 1=1 and a.Status>=-1 and a.Sort=0";
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
@@ -1333,7 +1333,8 @@ namespace MySystem.Areas.Admin.Controllers
             //商品名称
             if (!string.IsNullOrEmpty(ProductIdSelect))
             {
-                SqlString += " and a.ProductId=" + ProductIdSelect;
+                // SqlString += " and a.ProductId=" + ProductIdSelect;
+                SqlString += " and a.Id in (select OrderId from OrderProduct where ProductId=" + ProductIdSelect + ")";
             }
             //仓库类型
             if (!string.IsNullOrEmpty(StoreTypeSelect))

+ 49 - 43
Areas/Admin/Controllers/MainServer/UserCashRecordController.cs

@@ -1067,53 +1067,59 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and a.CashOrderNo='" + CashOrderNo + "'";
             }
-
             if (!string.IsNullOrEmpty(CreateDateData))
             {
                 string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                var start = Convert.ToDateTime(Convert.ToDateTime(datelist[0]).ToString("yyyy-MM-dd"));
-                var end = Convert.ToDateTime(Convert.ToDateTime(datelist[1]).ToString("yyyy-MM-dd") + " 23:59:59");
-                var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
-                var checks = db.UserCashRecord.Any(m => m.CreateDate <= end && m.TradeType < 3);
-                if (check)
-                {
-                    var sId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
-                    condition += "  and a.Id >=" + sId;
-                }
-                if (checks)
-                {
-                    var eId = db.UserCashRecord.Where(m => m.CreateDate <= end && m.TradeType < 3).Max(m => m.Id);
-                    condition += " and a.Id <=" + eId;
-                }
-            }
-            else
-            {
-                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
-                var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
-                if (check)
-                {
-                    var minId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
-                    var Info = function.ReadInstance("/WritePage/UserCashRecord/LeaderUserCashRecord.txt");
-                    if (string.IsNullOrEmpty(Info.ToString()))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
-                        condition += " and Id >=" + minId;
-                    }
-                    else if (minId != int.Parse(Info))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
-                        condition += " and Id >=" + minId;
-                    }
-                    else
-                    {
-                        condition += " and Id >=" + Convert.ToInt32(Info);
-                    }
-                }
-                else
-                {
-                    condition += " and a.Id =0";
-                }
+                var start = datelist[0];
+                var end = datelist[1];
+                condition += " and a.CreateDate>='" + start + " 00:00:00' and a.CreateDate<='" + end + " 23:59:59'";
             }
+            // if (!string.IsNullOrEmpty(CreateDateData))
+            // {
+            //     string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+            //     var start = Convert.ToDateTime(Convert.ToDateTime(datelist[0]).ToString("yyyy-MM-dd"));
+            //     var end = Convert.ToDateTime(Convert.ToDateTime(datelist[1]).ToString("yyyy-MM-dd") + " 23:59:59");
+            //     var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
+            //     var checks = db.UserCashRecord.Any(m => m.CreateDate <= end && m.TradeType < 3);
+            //     if (check)
+            //     {
+            //         var sId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
+            //         condition += "  and a.Id >=" + sId;
+            //     }
+            //     if (checks)
+            //     {
+            //         var eId = db.UserCashRecord.Where(m => m.CreateDate <= end && m.TradeType < 3).Max(m => m.Id);
+            //         condition += " and a.Id <=" + eId;
+            //     }
+            // }
+            // else
+            // {
+            //     var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
+            //     var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
+            //     if (check)
+            //     {
+            //         var minId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
+            //         var Info = function.ReadInstance("/WritePage/UserCashRecord/LeaderUserCashRecord.txt");
+            //         if (string.IsNullOrEmpty(Info.ToString()))
+            //         {
+            //             function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
+            //             condition += " and Id >=" + minId;
+            //         }
+            //         else if (minId != int.Parse(Info))
+            //         {
+            //             function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
+            //             condition += " and Id >=" + minId;
+            //         }
+            //         else
+            //         {
+            //             condition += " and Id >=" + Convert.ToInt32(Info);
+            //         }
+            //     }
+            //     else
+            //     {
+            //         condition += " and a.Id =0";
+            //     }
+            // }
             var Sql = "SELECT a.CashOrderNo '提现单号',b.MakerCode '创客编号',b.RealName '创客姓名',b.Mobile '手机号',a.IdCardNo '身份证号',a.SettleBankName '开户行名称',a.SettleBankCardNo '开户行卡号',a.ActualTradeAmount '发佣金额(单位:元)',(CASE WHEN a.QueryCount=0 THEN '待提交' WHEN a.QueryCount>0 THEN '已提交' ELSE '' end) '代付标记',(CASE WHEN a.Status=0 THEN '处理中' WHEN a.Status=1 THEN '成功' WHEN a.Status=2 THEN '失败' ELSE '' end) '状态',a.Remark '备注',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '创建时间' FROM UserCashRecord a LEFT JOIN Users b ON a.UserId=b.Id" + condition + "";
             var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
             var FileName = "盟主提现记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");