|
@@ -32,14 +32,15 @@ public class ResetSmallStoreHelper
|
|
OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
|
|
OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- if(DateTime.Now.Day == 1 && DateTime.Now.Hour > 0 && DateTime.Now.Hour < 3)
|
|
|
|
- {
|
|
|
|
- string check = function.ReadInstance("/ResetSmallStore/" + DateTime.Now.ToString("yyyyMM") + ".txt");
|
|
|
|
|
|
+ // if(DateTime.Now.Day == 1 && DateTime.Now.Hour > 0 && DateTime.Now.Hour < 3)
|
|
|
|
+ // {
|
|
|
|
+ string Month = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
|
|
|
|
+ string check = function.ReadInstance("/ResetSmallStore/" + Month + ".txt");
|
|
if(string.IsNullOrEmpty(check))
|
|
if(string.IsNullOrEmpty(check))
|
|
{
|
|
{
|
|
- function.WritePage("/ResetSmallStore/", DateTime.Now.ToString("yyyyMM") + ".txt", DateTime.Now.ToString());
|
|
|
|
- string Month = DateTime.Now.ToString("yyyyMM");
|
|
|
|
|
|
+ function.WritePage("/ResetSmallStore/", Month + ".txt", DateTime.Now.ToString());
|
|
DataTable dt = OtherMySqlConn.dtable("select UserId,sum(ProfitAmount) from ProfitRecord where SeoTitle='" + Month + "' group by UserId");
|
|
DataTable dt = OtherMySqlConn.dtable("select UserId,sum(ProfitAmount) from ProfitRecord where SeoTitle='" + Month + "' group by UserId");
|
|
|
|
+ function.WriteLog("总数" + dt.Rows.Count, "计算小分仓额度日志");
|
|
int index = 0;
|
|
int index = 0;
|
|
foreach(DataRow dr in dt.Rows)
|
|
foreach(DataRow dr in dt.Rows)
|
|
{
|
|
{
|
|
@@ -62,10 +63,11 @@ public class ResetSmallStoreHelper
|
|
{
|
|
{
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
}
|
|
}
|
|
|
|
+ function.WriteLog(index.ToString(), "计算小分仓额度日志");
|
|
}
|
|
}
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|