|
|
@@ -58,7 +58,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 创客列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexData(Users data, string ParentMakerCode, string ParentRealName, string AuthFlagSelect, string CreateDateData, int TopUserId, string RiskFlagSelect, string MerchantTypeSelect, int? sSettleAmount, int? eSettleAmount, int? sCashFreezeAmt, int? eCashFreezeAmt, int UserId, int SelfId = 0, int ParentId = 0, int page = 1, int limit = 30)
|
|
|
+ public JsonResult IndexData(Users data, string ParentMakerCode, string ParentRealName, string AuthFlagSelect, string CreateDateData, int TopUserId, string RiskFlagSelect, string MerchantTypeSelect, int? sSettleAmount, int? eSettleAmount, int? sCashFreezeAmt, int? eCashFreezeAmt, int UserId, int SelfId = 0, int ParentId = 0, int ShowFlag = 0, int page = 1, int limit = 30)
|
|
|
{
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
Fields.Add("MakerCode", "1"); //创客编号
|
|
|
@@ -68,6 +68,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("SettleAmount", "3"); //结算金额
|
|
|
Fields.Add("CashFreezeAmt", "3"); //冻结金额
|
|
|
Fields.Add("UserLevel", "0"); //创客等级
|
|
|
+ if (ShowFlag == 0)
|
|
|
+ {
|
|
|
+ Dictionary<string, object> objs = new Dictionary<string, object>();
|
|
|
+ return Json(objs);
|
|
|
+ }
|
|
|
|
|
|
string condition = " and Status>-1";
|
|
|
string sort = "Id desc";
|
|
|
@@ -1489,6 +1494,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
public JsonResult ChildrenData(Users data, int BrandSelect, string MakerCode, string CreateDateData, int ParentId = 0, int page = 1, int limit = 30)
|
|
|
{
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
+ WebCMSEntities db = new WebCMSEntities();
|
|
|
Fields.Add("MakerCode", "1"); //创客编号
|
|
|
|
|
|
int BrandId = BrandSelect;
|
|
|
@@ -1508,6 +1514,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
condition += " and ParentUserId=" + ParentId + " or Id=" + ParentId;
|
|
|
}
|
|
|
+ //时间不为空
|
|
|
if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
{
|
|
|
string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
@@ -1515,6 +1522,15 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
end = datelist[1].Replace("-", "");
|
|
|
con += " and TradeDate>='" + start + "' and TradeDate<='" + end + "'";
|
|
|
cons += " and DATE_FORMAT(BindingTime,'%Y%m%d') >=" + start + " and DATE_FORMAT(BindingTime,'%Y%m%d') <=" + end;
|
|
|
+
|
|
|
+ }
|
|
|
+ //时间为空
|
|
|
+ else
|
|
|
+ {
|
|
|
+ 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)
|
|
|
{
|
|
|
@@ -1588,153 +1604,46 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int TBCount = 0;
|
|
|
int TACount = 0;
|
|
|
|
|
|
- WebCMSEntities db = new WebCMSEntities();
|
|
|
Dictionary<string, object> other = new Dictionary<string, object>();
|
|
|
- DataTable dt = OtherMySqlConn.dtable("select Sum(HelpDirectTradeAmt + HelpDirectDebitTradeAmt) from TradeDaySummary where SeoTitle='self' and UserId= '" + ParentId + "'" + con);
|
|
|
+ DataTable dt = OtherMySqlConn.dtable("SELECT Sum(HelpDirectTradeAmt + HelpDirectDebitTradeAmt),Sum(if (QueryCount = 0,HelpDirectTradeAmt,0)),Sum(if (QueryCount = 0,HelpDirectDebitTradeAmt - HelpDirectDebitCapTradeAmt,0)),Sum(if (QueryCount = 0,HelpDirectDebitCapTradeAmt,0)),Sum(if (QueryCount = 0,HelpDirectDebitCapNum,0)),Sum(if (QueryCount = 1,HelpDirectTradeAmt,0)),Sum(NotHelpDirectTradeAmt + NotHelpDirectDebitTradeAmt),Sum(if (QueryCount = 0,NotHelpDirectTradeAmt,0)),Sum(if (QueryCount = 0,NotHelpDirectDebitTradeAmt - NotHelpDirectDebitCapTradeAmt,0)),Sum(if (QueryCount = 0,NotHelpDirectDebitCapTradeAmt,0)),Sum(if (QueryCount = 0,NotHelpDirectDebitCapNum,0)),Sum(if (QueryCount = 1,NotHelpDirectTradeAmt,0))from TradeDaySummary where SeoTitle = 'self' and UserId =" + ParentId + "" + con);
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
TotalAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(HelpDirectTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='self' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- DAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(HelpDirectDebitTradeAmt),Sum(HelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='self' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- JAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString())) - Convert.ToDecimal(function.CheckNum(dt.Rows[0][1].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(HelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='self' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- JfAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(HelpDirectDebitCapNum) from TradeDaySummary where QueryCount=0 and SeoTitle='self' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- JCountfc = Convert.ToInt32(function.CheckInt(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(HelpDirectTradeAmt) from TradeDaySummary where QueryCount=1 and SeoTitle='self' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- YAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
-
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(NotHelpDirectTradeAmt + NotHelpDirectDebitTradeAmt) from TradeDaySummary where SeoTitle='self' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- TotalAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(NotHelpDirectTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='self' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- DAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(NotHelpDirectDebitTradeAmt),Sum(NotHelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='self' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- JAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString())) - Convert.ToDecimal(function.CheckNum(dt.Rows[0][1].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(NotHelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='self' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- JfAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(NotHelpDirectDebitCapNum) from TradeDaySummary where QueryCount=0 and SeoTitle='self' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- JCountwd = Convert.ToInt32(function.CheckInt(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(NotHelpDirectTradeAmt) from TradeDaySummary where QueryCount=1 and SeoTitle='self' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- YAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
-
|
|
|
- //TODO: 统计激活绑定数(个人)
|
|
|
- dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE BindingState=1 AND BuyUserId= '" + ParentId + "'" + cons);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- PBCount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("SELECT SUM(DirectDebitCapNum) sum FROM UserTradeDaySummary WHERE SeoTitle='self' AND UserId= '" + ParentId + "'" + con);
|
|
|
+ DAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][1].ToString()));
|
|
|
+ JAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][2].ToString()));
|
|
|
+ JfAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][3].ToString()));
|
|
|
+ JCountfc = Convert.ToInt32(function.CheckInt(dt.Rows[0][4].ToString()));
|
|
|
+ YAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][5].ToString()));
|
|
|
+ TotalAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][6].ToString()));
|
|
|
+ DAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][7].ToString()));
|
|
|
+ JAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][8].ToString()));
|
|
|
+ JfAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][9].ToString()));
|
|
|
+ JCountwd = Convert.ToInt32(function.CheckInt(dt.Rows[0][10].ToString()));
|
|
|
+ YAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][11].ToString()));
|
|
|
+ }
|
|
|
+ //统计激活绑定数(个人、团队)
|
|
|
+ dt = OtherMySqlConn.dtable("SELECT SUM(if(SeoTitle='self',ActiveBuddyMerStatus,0)),SUM(if(SeoTitle='team',ActiveBuddyMerStatus,0)) FROM UserTradeMonthSummary WHERE UserId= " + ParentId + "" + cons);
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
PACount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- //TODO: 统计激活绑定数(团队)
|
|
|
- dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE BindingState=1 AND BuyUserId IN (SELECT Id FROM Users WHERE ParentNav LIKE '%," + ParentId + ",%' OR Id=" + ParentId + ")" + cons);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- TBCount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("SELECT SUM(NonDirectDebitCapNum) sum FROM UserTradeDaySummary WHERE SeoTitle='team' AND UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- TACount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
+ TACount = Convert.ToInt32(function.CheckNum(dt.Rows[0][1].ToString()));
|
|
|
}
|
|
|
|
|
|
- DataTable dts = OtherMySqlConn.dtable("select Sum(HelpNonDirectTradeAmt + HelpNonDirectDebitTradeAmt) from TradeDaySummary where SeoTitle='team' and UserId= '" + ParentId + "'" + con);
|
|
|
+ DataTable dts = OtherMySqlConn.dtable("SELECT Sum(HelpNonDirectTradeAmt + HelpNonDirectDebitTradeAmt),Sum(if (QueryCount = 0,HelpNonDirectTradeAmt,0)),Sum(if (QueryCount = 0,HelpNonDirectDebitTradeAmt - HelpNonDirectDebitCapTradeAmt,0)),Sum(if (QueryCount = 0,HelpNonDirectDebitCapTradeAmt,0)),Sum(if (QueryCount = 0,HelpNonDirectDebitCapNum,0)),Sum(if (QueryCount = 1,HelpNonDirectTradeAmt,0)),Sum(NotHelpNonDirectTradeAmt + NotHelpNonDirectDebitTradeAmt),Sum(if (QueryCount = 0,NotHelpNonDirectTradeAmt,0)),Sum(if (QueryCount = 0,NotHelpNonDirectDebitTradeAmt - NotHelpNonDirectDebitCapTradeAmt,0)),Sum(if (QueryCount = 0,NotHelpNonDirectDebitCapTradeAmt,0)),Sum(if (QueryCount = 0,NotHelpNonDirectDebitCapNum,0)),Sum(if (QueryCount = 1,NotHelpNonDirectTradeAmt,0))from TradeDaySummary where SeoTitle = 'team' and UserId =" + ParentId + "" + con);
|
|
|
if (dts.Rows.Count > 0)
|
|
|
{
|
|
|
TotalAmtfc1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dts = OtherMySqlConn.dtable("select Sum(HelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- DAmtfc1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dts = OtherMySqlConn.dtable("select Sum(HelpNonDirectDebitTradeAmt),Sum(HelpNonDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- JAmtfc1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][0].ToString())) - Convert.ToDecimal(function.CheckNum(dts.Rows[0][1].ToString()));
|
|
|
- }
|
|
|
- dts = OtherMySqlConn.dtable("select Sum(HelpNonDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dts.Rows.Count > 0)
|
|
|
- {
|
|
|
- JfAmtfc1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dts = OtherMySqlConn.dtable("select Sum(HelpNoonDirectDebitCapNum) from TradeDaySummary where QueryCount=0 and SeoTitle='team' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dts.Rows.Count > 0)
|
|
|
- {
|
|
|
- JCountfc1 = Convert.ToInt32(function.CheckInt(dts.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dts = OtherMySqlConn.dtable("select Sum(HelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=1 and SeoTitle='team' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dts.Rows.Count > 0)
|
|
|
- {
|
|
|
- YAmtfc1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
-
|
|
|
- dts = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectTradeAmt + NotHelpNonDirectDebitTradeAmt) from TradeDaySummary where SeoTitle='team' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dts.Rows.Count > 0)
|
|
|
- {
|
|
|
- TotalAmtwd1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dts = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dts.Rows.Count > 0)
|
|
|
- {
|
|
|
- DAmtwd1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dts = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectDebitTradeAmt),Sum(NotHelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dts.Rows.Count > 0)
|
|
|
- {
|
|
|
- JAmtwd1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][0].ToString())) - Convert.ToDecimal(function.CheckNum(dts.Rows[0][1].ToString()));
|
|
|
- }
|
|
|
- dts = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dts.Rows.Count > 0)
|
|
|
- {
|
|
|
- JfAmtwd1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dts = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectDebitCapNum) from TradeDaySummary where QueryCount=0 and SeoTitle='team' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dts.Rows.Count > 0)
|
|
|
- {
|
|
|
- JCountwd1 = Convert.ToInt32(function.CheckInt(dts.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dts = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=1 and SeoTitle='team' and UserId= '" + ParentId + "'" + con);
|
|
|
- if (dts.Rows.Count > 0)
|
|
|
- {
|
|
|
- YAmtwd1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][0].ToString()));
|
|
|
+ DAmtfc1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][1].ToString()));
|
|
|
+ JAmtfc1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][2].ToString()));
|
|
|
+ JfAmtfc1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][3].ToString()));
|
|
|
+ JCountfc1 = Convert.ToInt32(function.CheckInt(dts.Rows[0][4].ToString()));
|
|
|
+ YAmtfc1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][5].ToString()));
|
|
|
+ TotalAmtwd1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][6].ToString()));
|
|
|
+ DAmtwd1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][7].ToString()));
|
|
|
+ JAmtwd1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][8].ToString()));
|
|
|
+ JfAmtwd1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][9].ToString()));
|
|
|
+ JCountwd1 = Convert.ToInt32(function.CheckInt(dts.Rows[0][10].ToString()));
|
|
|
+ YAmtwd1 = Convert.ToDecimal(function.CheckNum(dts.Rows[0][11].ToString()));
|
|
|
}
|
|
|
|
|
|
other.Add("TotalAmtfc", TotalAmtfc);
|
|
|
@@ -1777,6 +1686,8 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
public Dictionary<string, object> GetMonthTradeForBrand(int UserId, string sTradeDate, string eTradeDate, int BrandId)
|
|
|
{
|
|
|
+ WebCMSEntities db = new WebCMSEntities();
|
|
|
+
|
|
|
string condition = " and Status>-1";
|
|
|
string cons = " and Status>=-1";
|
|
|
string con = " and Status>=-1";
|
|
|
@@ -1794,14 +1705,14 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
condition += " and UserId =" + UserId;
|
|
|
}
|
|
|
//开始时间
|
|
|
- if (!string.IsNullOrEmpty(sTradeDate))
|
|
|
+ if (!string.IsNullOrEmpty(sTradeDate) && !string.IsNullOrEmpty(eTradeDate))
|
|
|
{
|
|
|
- condition += " and TradeDate >=" + Convert.ToInt32(sTradeDate);
|
|
|
- cons += " and DATE_FORMAT(BindingTime,'%Y%m%d') >=" + Convert.ToInt32(sTradeDate);
|
|
|
- con += " and TradeDate >=" + Convert.ToInt32(sTradeDate);
|
|
|
+ condition += " and TradeDate >=" + Convert.ToInt32(sTradeDate) + " and TradeDate <=" + Convert.ToInt32(eTradeDate);
|
|
|
+ cons += " and DATE_FORMAT(BindingTime,'%Y%m%d') >=" + Convert.ToInt32(sTradeDate) + " and DATE_FORMAT(BindingTime,'%Y%m%d') <=" + Convert.ToInt32(eTradeDate);
|
|
|
+ con += " and TradeDate >=" + Convert.ToInt32(sTradeDate) + " and TradeDate <=" + Convert.ToInt32(eTradeDate);
|
|
|
}
|
|
|
//结束时间
|
|
|
- if (!string.IsNullOrEmpty(eTradeDate))
|
|
|
+ else
|
|
|
{
|
|
|
condition += " and TradeDate <=" + Convert.ToInt32(eTradeDate);
|
|
|
cons += " and DATE_FORMAT(BindingTime,'%Y%m%d') <=" + Convert.ToInt32(eTradeDate);
|
|
|
@@ -1831,97 +1742,112 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int TBCount = 0;
|
|
|
int TACount = 0;
|
|
|
|
|
|
- WebCMSEntities db = new WebCMSEntities();
|
|
|
Dictionary<string, object> obj = new Dictionary<string, object>();
|
|
|
- DataTable dt = OtherMySqlConn.dtable("select Sum(HelpNonDirectTradeAmt + HelpNonDirectDebitTradeAmt) from TradeDaySummary where SeoTitle='team'" + condition);
|
|
|
+ DataTable dt = OtherMySqlConn.dtable("SELECT Sum(HelpDirectTradeAmt + HelpDirectDebitTradeAmt),Sum(if (QueryCount = 0,HelpDirectTradeAmt,0)),Sum(if (QueryCount = 0,HelpDirectDebitTradeAmt - HelpDirectDebitCapTradeAmt,0)),Sum(if (QueryCount = 0,HelpDirectDebitCapTradeAmt,0)),Sum(if (QueryCount = 0,HelpDirectDebitCapNum,0)),Sum(if (QueryCount = 1,HelpDirectTradeAmt,0)),Sum(NotHelpDirectTradeAmt + NotHelpDirectDebitTradeAmt),Sum(if (QueryCount = 0,NotHelpDirectTradeAmt,0)),Sum(if (QueryCount = 0,NotHelpDirectDebitTradeAmt - NotHelpDirectDebitCapTradeAmt,0)),Sum(if (QueryCount = 0,NotHelpDirectDebitCapTradeAmt,0)),Sum(if (QueryCount = 0,NotHelpDirectDebitCapNum,0)),Sum(if (QueryCount = 1,NotHelpDirectTradeAmt,0))from TradeDaySummary where SeoTitle = 'team'" + condition);
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
TotalAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(HelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- DAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(HelpNonDirectDebitTradeAmt),Sum(HelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- JAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString())) - Convert.ToDecimal(function.CheckNum(dt.Rows[0][1].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(HelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- JfAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(HelpDirectDebitCapNum) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- JCountfc = Convert.ToInt32(function.CheckInt(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(HelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=1 and SeoTitle='team'" + condition);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- YAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
-
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectTradeAmt + NotHelpNonDirectDebitTradeAmt) from TradeDaySummary where SeoTitle='team'" + condition);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- TotalAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- DAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectDebitTradeAmt),Sum(NotHelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- JAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString())) - Convert.ToDecimal(function.CheckNum(dt.Rows[0][1].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(NotHelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- JfAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(NotHelpDirectDebitCapNum) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- JCountwd = Convert.ToInt32(function.CheckInt(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=1 and SeoTitle='team'" + condition);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- YAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("SELECT SUM(NonDirectDebitCapNum) sum FROM UserTradeDaySummary WHERE SeoTitle='team' AND UserId= '" + UserId + "'" + cons);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- BCount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("SELECT SUM(NonDirectDebitCapNum) sum FROM UserTradeDaySummary WHERE SeoTitle='team' AND UserId= '" + UserId + "'" + cons);
|
|
|
+ DAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][1].ToString()));
|
|
|
+ JAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][2].ToString()));
|
|
|
+ JfAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][3].ToString()));
|
|
|
+ JCountfc = Convert.ToInt32(function.CheckInt(dt.Rows[0][4].ToString()));
|
|
|
+ YAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][5].ToString()));
|
|
|
+ TotalAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][6].ToString()));
|
|
|
+ DAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][7].ToString()));
|
|
|
+ JAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][8].ToString()));
|
|
|
+ JfAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][9].ToString()));
|
|
|
+ JCountwd = Convert.ToInt32(function.CheckInt(dt.Rows[0][10].ToString()));
|
|
|
+ YAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][11].ToString()));
|
|
|
+ }
|
|
|
+ // DataTable dt = OtherMySqlConn.dtable("select Sum(HelpNonDirectTradeAmt + HelpNonDirectDebitTradeAmt) from TradeDaySummary where SeoTitle='team'" + condition);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // TotalAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
+ // }
|
|
|
+ // dt = OtherMySqlConn.dtable("select Sum(HelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // DAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
+ // }
|
|
|
+ // dt = OtherMySqlConn.dtable("select Sum(HelpNonDirectDebitTradeAmt),Sum(HelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // JAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString())) - Convert.ToDecimal(function.CheckNum(dt.Rows[0][1].ToString()));
|
|
|
+ // }
|
|
|
+ // dt = OtherMySqlConn.dtable("select Sum(HelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // JfAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
+ // }
|
|
|
+ // dt = OtherMySqlConn.dtable("select Sum(HelpDirectDebitCapNum) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // JCountfc = Convert.ToInt32(function.CheckInt(dt.Rows[0][0].ToString()));
|
|
|
+ // }
|
|
|
+ // dt = OtherMySqlConn.dtable("select Sum(HelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=1 and SeoTitle='team'" + condition);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // YAmtfc = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
+ // }
|
|
|
+
|
|
|
+ // dt = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectTradeAmt + NotHelpNonDirectDebitTradeAmt) from TradeDaySummary where SeoTitle='team'" + condition);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // TotalAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
+ // }
|
|
|
+ // dt = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // DAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
+ // }
|
|
|
+ // dt = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectDebitTradeAmt),Sum(NotHelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // JAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString())) - Convert.ToDecimal(function.CheckNum(dt.Rows[0][1].ToString()));
|
|
|
+ // }
|
|
|
+ // dt = OtherMySqlConn.dtable("select Sum(NotHelpDirectDebitCapTradeAmt) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // JfAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
+ // }
|
|
|
+ // dt = OtherMySqlConn.dtable("select Sum(NotHelpDirectDebitCapNum) from TradeDaySummary where QueryCount=0 and SeoTitle='team'" + condition);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // JCountwd = Convert.ToInt32(function.CheckInt(dt.Rows[0][0].ToString()));
|
|
|
+ // }
|
|
|
+ // dt = OtherMySqlConn.dtable("select Sum(NotHelpNonDirectTradeAmt) from TradeDaySummary where QueryCount=1 and SeoTitle='team'" + condition);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // YAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
+ // }
|
|
|
+ // dt = OtherMySqlConn.dtable("SELECT SUM(ActiveBuddyMerStatus) sum FROM UserTradeMonthSummary WHERE SeoTitle='team' AND UserId= '" + UserId + "'" + cons);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // BCount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
+ // }
|
|
|
+ dt = OtherMySqlConn.dtable("SELECT SUM(ActiveBuddyMerStatus) sum FROM UserTradeMonthSummary WHERE SeoTitle='team' AND UserId= '" + UserId + "'" + con);
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
ACount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
}
|
|
|
//TODO: 统计激活绑定数(个人)
|
|
|
- dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE BindingState=1 AND BuyUserId= '" + UserId + "'" + cons);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- PBCount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("SELECT SUM(DirectDebitCapNum) sum FROM UserTradeDaySummary WHERE SeoTitle='self' AND UserId= '" + UserId + "'" + con);
|
|
|
+ // dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE BindingState=1 AND BuyUserId= '" + UserId + "'" + cons);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // PBCount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
+ // }
|
|
|
+ dt = OtherMySqlConn.dtable("SELECT SUM(ActiveBuddyMerStatus) sum FROM UserTradeMonthSummary WHERE SeoTitle='self' AND UserId= '" + UserId + "'" + con);
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
PACount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
}
|
|
|
//TODO: 统计激活绑定数(团队)
|
|
|
- dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE BindingState=1 AND BuyUserId IN (SELECT Id FROM Users WHERE ParentNav LIKE '%," + UserId + ",%' OR Id=" + UserId + ")" + cons);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- TBCount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
- }
|
|
|
- dt = OtherMySqlConn.dtable("SELECT SUM(NonDirectDebitCapNum) sum FROM UserTradeDaySummary WHERE SeoTitle='team' AND UserId= '" + UserId + "'" + con);
|
|
|
+ // dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE BindingState=1 AND BuyUserId IN (SELECT Id FROM Users WHERE ParentNav LIKE '%," + UserId + ",%' OR Id=" + UserId + ")" + cons);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // TBCount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
+ // }
|
|
|
+ dt = OtherMySqlConn.dtable("SELECT SUM(ActiveBuddyMerStatus) sum FROM UserTradeMonthSummary WHERE SeoTitle='team' AND UserId= '" + UserId + "'" + con);
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
TACount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
|