|
@@ -54,7 +54,7 @@ namespace MySystem
|
|
|
{
|
|
|
ids += idsDr["Id"].ToString() + ",";
|
|
|
}
|
|
|
- DataTable selfDt = OtherMySqlConn.dtable("select UserId,MerchantId,SnNo,PayMode,IsAct,DATE_FORMAT(CreateDate,'%Y%m%d'),sum(PayMoney),count(Id) from ConsumerOrders where Id in (" + ids.TrimEnd(',') + ") group by UserId,MerchantId,SnNo,PayMode,IsAct,DATE_FORMAT(CreateDate,'%Y%m%d')");
|
|
|
+ DataTable selfDt = OtherMySqlConn.dtable("select UserId,MerchantId,SnNo,PayMode,IsAct,DATE_FORMAT(CreateDate,'%Y%m%d'),sum(PayMoney),count(Id),sum(MaxDivi) from ConsumerOrders where Id in (" + ids.TrimEnd(',') + ") group by UserId,MerchantId,SnNo,PayMode,IsAct,DATE_FORMAT(CreateDate,'%Y%m%d')");
|
|
|
if (selfDt.Rows.Count > 0)
|
|
|
{
|
|
|
function.WriteLog("统计人数:" + selfDt.Rows.Count + "\n\n", "统计商户和创客交易额日志");
|
|
@@ -70,6 +70,8 @@ namespace MySystem
|
|
|
string TradeDate = selfDr[5].ToString();
|
|
|
decimal TradeAmount = decimal.Parse(selfDr[6].ToString());
|
|
|
int TradeCount = int.Parse(selfDr[7].ToString());
|
|
|
+ decimal MaxDivi = decimal.Parse(selfDr[8].ToString());
|
|
|
+ decimal ActualAmount = TradeAmount - MaxDivi;
|
|
|
string TradeMonth = TradeDate.Substring(0, 6);
|
|
|
|
|
|
//创客交易额
|
|
@@ -132,12 +134,19 @@ namespace MySystem
|
|
|
}
|
|
|
merchantStat.TradeAmount += TradeAmount;
|
|
|
merchantStat.TradeCount += TradeCount;
|
|
|
+ merchantStat.TotalActual += ActualAmount;
|
|
|
|
|
|
MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == MerchantId);
|
|
|
if(merchant != null)
|
|
|
{
|
|
|
merchant.TotalAmount += TradeAmount;
|
|
|
merchant.TotalConsumeCount += TradeCount;
|
|
|
+ merchant.TotalActual += ActualAmount;
|
|
|
+ if(IsAct == 1)
|
|
|
+ {
|
|
|
+ merchant.TotalActAmount += TradeAmount;
|
|
|
+ merchant.TotalActActual += ActualAmount;
|
|
|
+ }
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
|
|
@@ -157,6 +166,7 @@ namespace MySystem
|
|
|
}
|
|
|
qrcode.TradeAmount += TradeAmount;
|
|
|
qrcode.TradeCount += TradeCount;
|
|
|
+ qrcode.TotalActual += ActualAmount;
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
OtherMySqlConn.op("update ConsumerOrders set Version=1 where Id in (" + ids.TrimEnd(',') + ")");
|