|
@@ -45,15 +45,18 @@ namespace MySystem
|
|
|
DateTime start = DateTime.Parse(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01 00:00:00");
|
|
|
DateTime end = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00");
|
|
|
string month = DateTime.Now.ToString("yyyyMM");
|
|
|
+ function.WriteLog(DateTime.Now.ToString() + "-start", "达标奖励日志");
|
|
|
var orders = db.MerchantDepositOrder.Where(m => m.Status > 0 && m.Version == 0 && m.UpdateDate >= start && m.UpdateDate < end);
|
|
|
foreach(var order in orders)
|
|
|
{
|
|
|
+ function.WriteLog("MerchantId:" + order.MerchantId, "达标奖励日志");
|
|
|
decimal TradeMoney = 0;
|
|
|
bool has = db.MerchantAmountSummay.Any(m => m.MerchantId == order.MerchantId && m.TradeMonth == month);
|
|
|
if(has)
|
|
|
{
|
|
|
TradeMoney = db.MerchantAmountSummay.Where(m => m.MerchantId == order.MerchantId && m.TradeMonth == month).Sum(m => m.TradeAmount);
|
|
|
}
|
|
|
+ function.WriteLog("TradeMoney:" + TradeMoney, "达标奖励日志");
|
|
|
if(TradeMoney >= 10000)
|
|
|
{
|
|
|
RedisDbconn.Instance.AddList("StandardProfitQueue2", "{\"MerchantId\":\"" + order.MerchantId + "\",\"Prize\":\"50\"}");
|
|
@@ -65,6 +68,7 @@ namespace MySystem
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
+ function.WriteLog(DateTime.Now.ToString() + "-end", "达标奖励日志");
|
|
|
db.Dispose();
|
|
|
}
|
|
|
|