Sfoglia il codice sorgente

优化创客信息直属创客交易额
创客账户详细信息

DuGuYang 3 anni fa
parent
commit
75baedb15f

+ 24 - 14
Areas/Admin/Controllers/MainServer/UserAccountRecordController.cs

@@ -65,7 +65,11 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("ProductType", "1"); //产品类型
             Fields.Add("ProductType", "1"); //产品类型
             Fields.Add("TransRecordNo", "3"); //交易流水编号
             Fields.Add("TransRecordNo", "3"); //交易流水编号
 
 
-            string condition = " and Status>-1";
+            string condition = "";
+            if (!string.IsNullOrEmpty(MakerCode) || !string.IsNullOrEmpty(RealName) || !string.IsNullOrEmpty(CreateDateData))
+            {
+                condition = " and Status>-1";
+            }
             //创客编号
             //创客编号
             if (!string.IsNullOrEmpty(MakerCode))
             if (!string.IsNullOrEmpty(MakerCode))
             {
             {
@@ -77,31 +81,37 @@ namespace MySystem.Areas.Admin.Controllers
                 condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
                 condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
             }
             }
             //顶级创客
             //顶级创客
-            if(TopUserId > 0)
+            if (TopUserId > 0)
             {
             {
                 condition += " and UserId in (select Id from Users where ParentNav like '," + TopUserId + ",%')";
                 condition += " and UserId in (select Id from Users where ParentNav like '," + TopUserId + ",%')";
             }
             }
-            if(UserId > 0)
+            if (UserId > 0)
             {
             {
                 condition += " and UserId=" + UserId;
                 condition += " and UserId=" + UserId;
             }
             }
-            if(!string.IsNullOrEmpty(CreateDateData))
+            if (!string.IsNullOrEmpty(CreateDateData))
             {
             {
                 string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
                 string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
                 string start = datelist[0];
                 string start = datelist[0];
                 string end = datelist[1];
                 string end = datelist[1];
                 condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
                 condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
             }
             }
+            if (string.IsNullOrEmpty(CreateDateData))
+            {
+                var start = DateTime.Now.ToString("yyyy-MM") + "-01";
+                var end = Convert.ToDateTime(start).AddMonths(1);
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<'" + end + " 00:00:00'";
+            }
             if (data.ChangeType > 0)
             if (data.ChangeType > 0)
-            { 
+            {
                 condition += " and ChangeType=" + data.ChangeType;
                 condition += " and ChangeType=" + data.ChangeType;
             }
             }
             if (data.ProductType > 0)
             if (data.ProductType > 0)
-            { 
+            {
                 condition += " and ProductType=" + data.ProductType;
                 condition += " and ProductType=" + data.ProductType;
             }
             }
             if (!string.IsNullOrEmpty(data.TransRecordNo))
             if (!string.IsNullOrEmpty(data.TransRecordNo))
-            { 
+            {
                 condition += " and TransRecordNo='" + data.TransRecordNo + "'";
                 condition += " and TransRecordNo='" + data.TransRecordNo + "'";
             }
             }
 
 
@@ -114,7 +124,7 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["MakerCode"] = user.MakerCode;
                 dic["MakerCode"] = user.MakerCode;
                 dic["RealName"] = user.RealName;
                 dic["RealName"] = user.RealName;
                 if (!string.IsNullOrEmpty(user.ParentNav))
                 if (!string.IsNullOrEmpty(user.ParentNav))
-                { 
+                {
                     int TopId = int.Parse(user.ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
                     int TopId = int.Parse(user.ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
                     Users tuser = db.Users.FirstOrDefault(m => m.Id == TopId) ?? new Users();
                     Users tuser = db.Users.FirstOrDefault(m => m.Id == TopId) ?? new Users();
                     dic["TopMakerCode"] = tuser.MakerCode;
                     dic["TopMakerCode"] = tuser.MakerCode;
@@ -124,18 +134,18 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["ProductTypeName"] = RelationClass.GetKqProductBrandInfo(ProductType);
                 dic["ProductTypeName"] = RelationClass.GetKqProductBrandInfo(ProductType);
                 int ChangeType = int.Parse(dic["ChangeType"].ToString());
                 int ChangeType = int.Parse(dic["ChangeType"].ToString());
                 dic["ChangeTypeName"] = RelationClassForConst.GetChangeTypeInfo(ChangeType);
                 dic["ChangeTypeName"] = RelationClassForConst.GetChangeTypeInfo(ChangeType);
-                
+
                 //获得盟主5元奖励的机具Sn
                 //获得盟主5元奖励的机具Sn
                 int SnId = int.Parse(dic["QueryCount"].ToString());
                 int SnId = int.Parse(dic["QueryCount"].ToString());
                 PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == SnId) ?? new PosMachinesTwo();
                 PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == SnId) ?? new PosMachinesTwo();
                 dic["PosSn"] = pos.PosSn;
                 dic["PosSn"] = pos.PosSn;
             }
             }
             Dictionary<string, object> other = new Dictionary<string, object>();
             Dictionary<string, object> other = new Dictionary<string, object>();
-            
+
             string ChangeTypeAmount0 = "0.00", ChangeTypeAmount1 = "0.00", ChangeTypeAmount2 = "0.00", ChangeTypeAmount3 = "0.00", ChangeTypeAmount4 = "0.00", ChangeTypeAmount5 = "0.00", ChangeTypeAmount6 = "0.00", ChangeTypeAmount61 = "0.00", ChangeTypeAmount62 = "0.00", ChangeTypeAmount63 = "0.00", ChangeTypeAmount64 = "0.00", ChangeTypeAmount50 = "0.00", ChangeTypeAmount111 = "0.00", ChangeTypeAmount112 = "0.00", ChangeTypeAmount60 = "0.00", ChangeTypeAmount31 = "0.00";
             string ChangeTypeAmount0 = "0.00", ChangeTypeAmount1 = "0.00", ChangeTypeAmount2 = "0.00", ChangeTypeAmount3 = "0.00", ChangeTypeAmount4 = "0.00", ChangeTypeAmount5 = "0.00", ChangeTypeAmount6 = "0.00", ChangeTypeAmount61 = "0.00", ChangeTypeAmount62 = "0.00", ChangeTypeAmount63 = "0.00", ChangeTypeAmount64 = "0.00", ChangeTypeAmount50 = "0.00", ChangeTypeAmount111 = "0.00", ChangeTypeAmount112 = "0.00", ChangeTypeAmount60 = "0.00", ChangeTypeAmount31 = "0.00";
             DataTable dt = OtherMySqlConn.dtable("select sum(if(ChangeType=0, ChangeAmount, 0)),sum(if(ChangeType=1, ChangeAmount, 0)),sum(if(ChangeType=2, ChangeAmount, 0)),sum(if(ChangeType=6, ChangeAmount, 0)),sum(if(ChangeType=61, ChangeAmount, 0)),sum(if(ChangeType=62, ChangeAmount, 0)),sum(if(ChangeType=63, ChangeAmount, 0)),sum(if(ChangeType=64, ChangeAmount, 0)),sum(if(ChangeType=50, ChangeAmount, 0)),sum(if(ChangeType=111, ChangeAmount, 0)),sum(if(ChangeType=112, ChangeAmount, 0)),sum(if(ChangeType=60, ChangeAmount, 0)),sum(if(ChangeType=31, ChangeAmount, 0)),sum(if(ChangeType=3, ChangeAmount, 0)),sum(if(ChangeType=4, ChangeAmount, 0)),sum(if(ChangeType=5, ChangeAmount, 0)) from UserAccountRecord where 1=1" + condition);
             DataTable dt = OtherMySqlConn.dtable("select sum(if(ChangeType=0, ChangeAmount, 0)),sum(if(ChangeType=1, ChangeAmount, 0)),sum(if(ChangeType=2, ChangeAmount, 0)),sum(if(ChangeType=6, ChangeAmount, 0)),sum(if(ChangeType=61, ChangeAmount, 0)),sum(if(ChangeType=62, ChangeAmount, 0)),sum(if(ChangeType=63, ChangeAmount, 0)),sum(if(ChangeType=64, ChangeAmount, 0)),sum(if(ChangeType=50, ChangeAmount, 0)),sum(if(ChangeType=111, ChangeAmount, 0)),sum(if(ChangeType=112, ChangeAmount, 0)),sum(if(ChangeType=60, ChangeAmount, 0)),sum(if(ChangeType=31, ChangeAmount, 0)),sum(if(ChangeType=3, ChangeAmount, 0)),sum(if(ChangeType=4, ChangeAmount, 0)),sum(if(ChangeType=5, ChangeAmount, 0)) from UserAccountRecord where 1=1" + condition);
             DataTable dts = OtherMySqlConn.dtable("select SUM(FluxProfitAmt) from FluxProfitDetail where ");
             DataTable dts = OtherMySqlConn.dtable("select SUM(FluxProfitAmt) from FluxProfitDetail where ");
-            if(dt.Rows.Count > 0)
+            if (dt.Rows.Count > 0)
             {
             {
                 ChangeTypeAmount0 = dt.Rows[0][0].ToString();
                 ChangeTypeAmount0 = dt.Rows[0][0].ToString();
                 ChangeTypeAmount1 = dt.Rows[0][1].ToString();
                 ChangeTypeAmount1 = dt.Rows[0][1].ToString();
@@ -394,11 +404,11 @@ namespace MySystem.Areas.Admin.Controllers
                 condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
                 condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
             }
             }
             //顶级创客
             //顶级创客
-            if(TopUserId > 0)
+            if (TopUserId > 0)
             {
             {
                 condition += " and UserId in (select Id from Users where ParentNav like '," + TopUserId + ",%')";
                 condition += " and UserId in (select Id from Users where ParentNav like '," + TopUserId + ",%')";
             }
             }
-            if(UserId > 0)
+            if (UserId > 0)
             {
             {
                 condition += " and UserId=" + UserId;
                 condition += " and UserId=" + UserId;
             }
             }
@@ -412,7 +422,7 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["MakerCode"] = user.MakerCode;
                 dic["MakerCode"] = user.MakerCode;
                 dic["RealName"] = user.RealName;
                 dic["RealName"] = user.RealName;
                 if (!string.IsNullOrEmpty(user.ParentNav))
                 if (!string.IsNullOrEmpty(user.ParentNav))
-                { 
+                {
                     int TopId = int.Parse(user.ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
                     int TopId = int.Parse(user.ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
                     Users tuser = db.Users.FirstOrDefault(m => m.Id == TopId) ?? new Users();
                     Users tuser = db.Users.FirstOrDefault(m => m.Id == TopId) ?? new Users();
                     dic["TopMakerCode"] = tuser.MakerCode;
                     dic["TopMakerCode"] = tuser.MakerCode;

+ 18 - 3
Areas/Admin/Controllers/MainServer/UsersController.cs

@@ -1504,10 +1504,16 @@ namespace MySystem.Areas.Admin.Controllers
             string start = "";
             string start = "";
             string end = "";
             string end = "";
 
 
-            string condition = " and Status>-1 and AuthFlag >0";
-            string con = " and Status>-1";
-            string cons = " and Status>=-1";
+            string condition = "";
+            string con = "";
+            string cons = "";
             string sort = "Id desc";
             string sort = "Id desc";
+            if (!string.IsNullOrEmpty(BrandSelect.ToString()) || !string.IsNullOrEmpty(MakerCode) || !string.IsNullOrEmpty(CreateDateData))
+            {
+                condition = " and Status>-1 and AuthFlag >0";
+                con = " and Status>-1";
+                cons = " and Status>=-1";
+            }
             //创客编号
             //创客编号
             if (!string.IsNullOrEmpty(MakerCode))
             if (!string.IsNullOrEmpty(MakerCode))
             {
             {
@@ -1517,6 +1523,7 @@ namespace MySystem.Areas.Admin.Controllers
             {
             {
                 condition += " and ParentUserId=" + ParentId + " or Id=" + ParentId;
                 condition += " and ParentUserId=" + ParentId + " or Id=" + ParentId;
             }
             }
+            //时间不为空
             if (!string.IsNullOrEmpty(CreateDateData))
             if (!string.IsNullOrEmpty(CreateDateData))
             {
             {
                 string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
                 string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
@@ -1525,6 +1532,14 @@ namespace MySystem.Areas.Admin.Controllers
                 con += " and TradeDate>='" + start + "' and TradeDate<='" + end + "'";
                 con += " and TradeDate>='" + start + "' and TradeDate<='" + end + "'";
                 cons += " and DATE_FORMAT(BindingTime,'%Y%m%d') >=" + start + " and DATE_FORMAT(BindingTime,'%Y%m%d') <=" + end;
                 cons += " and DATE_FORMAT(BindingTime,'%Y%m%d') >=" + start + " and DATE_FORMAT(BindingTime,'%Y%m%d') <=" + end;
             }
             }
+            //时间为空
+            if (string.IsNullOrEmpty(CreateDateData))
+            {
+                start = DateTime.Now.ToString("yyyyMM") + "01";
+                end = DateTime.Now.AddMonths(1).ToString("yyyyMM") + "01";
+                con += " and TradeDate>='" + start + "' and TradeDate<'" + end + "'";
+                cons += " and DATE_FORMAT(BindingTime,'%Y%m%d') >=" + start + " and DATE_FORMAT(BindingTime,'%Y%m%d') <" + end;
+            }
             if (!string.IsNullOrEmpty(BrandSelect.ToString()) && BrandId > 0)
             if (!string.IsNullOrEmpty(BrandSelect.ToString()) && BrandId > 0)
             {
             {
                 con += " and BrandId='" + BrandId + "'";
                 con += " and BrandId='" + BrandId + "'";

+ 2 - 2
Areas/Admin/Views/MainServer/UserAccountRecord/Index.cshtml

@@ -68,7 +68,7 @@
                         </div>
                         </div>
                     </div>
                     </div>
                 
                 
-                    <div class="layui-inline">
+                    @* <div class="layui-inline">
                         <label class="layui-form-label">顶级创客</label>
                         <label class="layui-form-label">顶级创客</label>
                         <div class="layui-input-inline">
                         <div class="layui-input-inline">
                             <select id="TopUserId" name="TopUserId" lay-search="">
                             <select id="TopUserId" name="TopUserId" lay-search="">
@@ -79,7 +79,7 @@
                                 }
                                 }
                             </select>
                             </select>
                         </div>
                         </div>
-                    </div>
+                    </div> *@
                     <div class="layui-inline">
                     <div class="layui-inline">
                         <label class="layui-form-label">交易类型</label>
                         <label class="layui-form-label">交易类型</label>
                         <div class="layui-input-inline">
                         <div class="layui-input-inline">

+ 4 - 4
wwwroot/layuiadmin/modules_main/UserAccountRecord_Admin.js

@@ -37,17 +37,17 @@ layui.config({
         trigger: 'click',
         trigger: 'click',
         change: function (value, date, endDate) {
         change: function (value, date, endDate) {
             var op = true;
             var op = true;
-            if (date.year == endDate.year && endDate.month - date.month <= 1) {
-                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+            if (date.year == endDate.year && endDate.month - date.month <= 2) {
+                if (endDate.month - date.month == 2 && endDate.date > date.date) {
                     op = false;
                     op = false;
-                    layCreateDate.hint('日期范围请不要超过1个月');
+                    layCreateDate.hint('日期范围请不要超过2个月');
                     setTimeout(function () {
                     setTimeout(function () {
                         $(".laydate-btns-confirm").addClass("laydate-disabled");
                         $(".laydate-btns-confirm").addClass("laydate-disabled");
                     }, 1);
                     }, 1);
                 }
                 }
             } else {
             } else {
                 op = false;
                 op = false;
-                layCreateDate.hint('日期范围请不要超过1个月');
+                layCreateDate.hint('日期范围请不要超过2个月');
                 setTimeout(function () {
                 setTimeout(function () {
                     $(".laydate-btns-confirm").addClass("laydate-disabled");
                     $(".laydate-btns-confirm").addClass("laydate-disabled");
                 }, 1);
                 }, 1);

+ 4 - 4
wwwroot/layuiadmin/modules_main/UsersChildren_Admin.js

@@ -42,17 +42,17 @@ layui.config({
         trigger: 'click',
         trigger: 'click',
         change: function (value, date, endDate) {
         change: function (value, date, endDate) {
             var op = true;
             var op = true;
-            if (date.year == endDate.year && endDate.month - date.month <= 1) {
-                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+            if (date.year == endDate.year && endDate.month - date.month <= 2) {
+                if (endDate.month - date.month == 2 && endDate.date > date.date) {
                     op = false;
                     op = false;
-                    layCreateDate.hint('日期范围请不要超过1个月');
+                    layCreateDate.hint('日期范围请不要超过2个月');
                     setTimeout(function () {
                     setTimeout(function () {
                         $(".laydate-btns-confirm").addClass("laydate-disabled");
                         $(".laydate-btns-confirm").addClass("laydate-disabled");
                     }, 1);
                     }, 1);
                 }
                 }
             } else {
             } else {
                 op = false;
                 op = false;
-                layCreateDate.hint('日期范围请不要超过1个月');
+                layCreateDate.hint('日期范围请不要超过2个月');
                 setTimeout(function () {
                 setTimeout(function () {
                     $(".laydate-btns-confirm").addClass("laydate-disabled");
                     $(".laydate-btns-confirm").addClass("laydate-disabled");
                 }, 1);
                 }, 1);