|
@@ -70,6 +70,26 @@ namespace MySystem
|
|
|
|
|
|
CustomerSqlConn.op("update ProfitRewardRecord set CheckStatus=1 where Id>=" + StartId + " and CheckStatus=0 and BrandId=" + BrandId + " and UserId>0 and TradeMonth='" + date + "'", MysqlConn.connstr);
|
|
|
|
|
|
+ DataTable dt = OtherMySqlConn.dtable("select UserId,sum(ProfitAmount) from ProfitRecord where BrandId=" + BrandId + " and UserId>0 and SeoTitle='" + date + "' group by UserId");
|
|
|
+ function.WriteLog("分润:" + BrandId + ":" + dt.Rows.Count, "同步分润数据");
|
|
|
+ int index = 0;
|
|
|
+ foreach (DataRow dr in dt.Rows)
|
|
|
+ {
|
|
|
+ index += 1;
|
|
|
+ int UserId = int.Parse(dr["UserId"].ToString());
|
|
|
+ decimal ProfitMoney = decimal.Parse(dr[1].ToString());
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string content = UserId + "|0|" + ProfitMoney + "|" + index;
|
|
|
+ RedisDbconn.Instance.AddList("DoTradeProfitQueue", content);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ function.WriteLog(DateTime.Now.ToString() + "\n" + UserId + "," + ProfitMoney + "\n" + ex.ToString(), "同步到余额异常");
|
|
|
+ }
|
|
|
+ function.WriteLog(index.ToString(), "同步分润数据");
|
|
|
+ }
|
|
|
+
|
|
|
db.Dispose();
|
|
|
}
|
|
|
private void DoTradeProfit2(int BrandId, string date, string SysUserName)
|