|
|
@@ -65,7 +65,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("ProductType", "1"); //产品类型
|
|
|
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))
|
|
|
{
|
|
|
@@ -77,31 +81,37 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
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 + ",%')";
|
|
|
}
|
|
|
- if(UserId > 0)
|
|
|
+ if (UserId > 0)
|
|
|
{
|
|
|
condition += " and UserId=" + UserId;
|
|
|
}
|
|
|
- if(!string.IsNullOrEmpty(CreateDateData))
|
|
|
+ if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
{
|
|
|
string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
string start = datelist[0];
|
|
|
string end = datelist[1];
|
|
|
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)
|
|
|
- {
|
|
|
+ {
|
|
|
condition += " and ChangeType=" + data.ChangeType;
|
|
|
}
|
|
|
if (data.ProductType > 0)
|
|
|
- {
|
|
|
+ {
|
|
|
condition += " and ProductType=" + data.ProductType;
|
|
|
}
|
|
|
if (!string.IsNullOrEmpty(data.TransRecordNo))
|
|
|
- {
|
|
|
+ {
|
|
|
condition += " and TransRecordNo='" + data.TransRecordNo + "'";
|
|
|
}
|
|
|
|
|
|
@@ -114,7 +124,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["MakerCode"] = user.MakerCode;
|
|
|
dic["RealName"] = user.RealName;
|
|
|
if (!string.IsNullOrEmpty(user.ParentNav))
|
|
|
- {
|
|
|
+ {
|
|
|
int TopId = int.Parse(user.ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
|
|
|
Users tuser = db.Users.FirstOrDefault(m => m.Id == TopId) ?? new Users();
|
|
|
dic["TopMakerCode"] = tuser.MakerCode;
|
|
|
@@ -124,18 +134,18 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["ProductTypeName"] = RelationClass.GetKqProductBrandInfo(ProductType);
|
|
|
int ChangeType = int.Parse(dic["ChangeType"].ToString());
|
|
|
dic["ChangeTypeName"] = RelationClassForConst.GetChangeTypeInfo(ChangeType);
|
|
|
-
|
|
|
+
|
|
|
//获得盟主5元奖励的机具Sn
|
|
|
int SnId = int.Parse(dic["QueryCount"].ToString());
|
|
|
PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == SnId) ?? new PosMachinesTwo();
|
|
|
dic["PosSn"] = pos.PosSn;
|
|
|
}
|
|
|
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";
|
|
|
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 ");
|
|
|
- if(dt.Rows.Count > 0)
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
ChangeTypeAmount0 = dt.Rows[0][0].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 + "')";
|
|
|
}
|
|
|
//顶级创客
|
|
|
- if(TopUserId > 0)
|
|
|
+ if (TopUserId > 0)
|
|
|
{
|
|
|
condition += " and UserId in (select Id from Users where ParentNav like '," + TopUserId + ",%')";
|
|
|
}
|
|
|
- if(UserId > 0)
|
|
|
+ if (UserId > 0)
|
|
|
{
|
|
|
condition += " and UserId=" + UserId;
|
|
|
}
|
|
|
@@ -412,7 +422,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["MakerCode"] = user.MakerCode;
|
|
|
dic["RealName"] = user.RealName;
|
|
|
if (!string.IsNullOrEmpty(user.ParentNav))
|
|
|
- {
|
|
|
+ {
|
|
|
int TopId = int.Parse(user.ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
|
|
|
Users tuser = db.Users.FirstOrDefault(m => m.Id == TopId) ?? new Users();
|
|
|
dic["TopMakerCode"] = tuser.MakerCode;
|