|
|
@@ -4816,12 +4816,40 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
#region 直营团队数据导出
|
|
|
public JsonResult Team1InfoDo(string MakerCode, string BindingTime, string ActivationTime, string PosFee, string BrandId, int page = 1, int limit = 30)
|
|
|
{
|
|
|
+ string conn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
|
|
|
List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
|
|
|
+ string condition = "";
|
|
|
+ var UserId = 0;
|
|
|
+ var bstart = "";
|
|
|
+ var bend = "";
|
|
|
+ var astart = "";
|
|
|
+ var aend = "";
|
|
|
if (!string.IsNullOrEmpty(MakerCode))
|
|
|
{
|
|
|
-
|
|
|
+ var user = db.Users.FirstOrDefault(m => m.MakerCode == MakerCode) ?? new Users();
|
|
|
+ UserId = user.Id;
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(BindingTime))
|
|
|
+ {
|
|
|
+ string[] datelist = BindingTime.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ bstart = datelist[0] + " 00:00:00";
|
|
|
+ bend = datelist[1] + " 23:59:59";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(ActivationTime))
|
|
|
+ {
|
|
|
+ string[] datelist = ActivationTime.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ astart = datelist[0] + " 00:00:00";
|
|
|
+ aend = datelist[1] + " 23:59:59";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(PosFee))
|
|
|
+ {
|
|
|
+ condition += " and SeoKeyword=" + PosFee;
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(BrandId))
|
|
|
+ {
|
|
|
+ condition += " and BrandId=" + BrandId;
|
|
|
}
|
|
|
- DataTable dt = OtherMySqlConn.dtable("select wname,k.`Name`,PosSnType,PosSn,tb.SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from (select (select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN BrandId not in(2,7,10,11) THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BindingTime<'2023-06-12 00:00:00' and BuyUserId=135158 and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id");
|
|
|
+ DataTable dt = CustomerSqlConn.dtable("select wname,k.`Name`,PosSnType,PosSn,tb.SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from (select (select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN BrandId not in(2,7,10,11) THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BindingTime>='" + bstart + "' and BindingTime<'" + bend + "' and ActivationTime>='" + astart + "' and ActivationTime<'" + aend + "' and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id", conn);
|
|
|
foreach (DataRow item in dt.Rows)
|
|
|
{
|
|
|
Dictionary<string, object> curData = new Dictionary<string, object>();
|