|
@@ -24,42 +24,45 @@ namespace MySystem
|
|
|
var query = MerchantDepositOrderService.Query(" and Status=1 and MerchantId=" + MerchantId + "");
|
|
|
var Status = 0;//活动交易状态
|
|
|
var IsJoin = 0;//是否参加活动(0 否 1 是)
|
|
|
- if (query.Id == 0) IsJoin = 1;
|
|
|
- var month = DateTime.Parse(query.CreateDate.ToString());
|
|
|
- var TradeMonth = "";
|
|
|
- decimal TradeAmount = 0.00M;
|
|
|
- Dictionary<string, string> dic = new Dictionary<string, string>();
|
|
|
- for (int i = 0; i < 10; i++)
|
|
|
+ if (query.Id > 0)
|
|
|
{
|
|
|
- month = month.AddMonths(i + 1);
|
|
|
- TradeMonth = month.ToString("yyyy-MM");
|
|
|
- var check = MerchantAmountSummayService.Query(" and IsAct=1 and TradeMonth='" + TradeMonth + "' and MerchantId=" + MerchantId + "");
|
|
|
- if (check.Id > 0)
|
|
|
+ IsJoin = 1;
|
|
|
+ var month = DateTime.Parse(query.CreateDate.ToString());
|
|
|
+ var TradeMonth = "";
|
|
|
+ decimal TradeAmount = 0.00M;
|
|
|
+ Dictionary<string, string> dic = new Dictionary<string, string>();
|
|
|
+ for (int i = 0; i < 10; i++)
|
|
|
{
|
|
|
- dic = MerchantAmountSummayService.Sum("TradeAmount", " and IsAct=1 and TradeMonth='" + TradeMonth + "'");
|
|
|
- TradeAmount = decimal.Parse(dic["TradeAmount"].ToString());
|
|
|
- }
|
|
|
- if (IsJoin == 0)
|
|
|
- {
|
|
|
- //未参与
|
|
|
- Status = 3;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //考核中
|
|
|
- if (DateTime.Now.ToString("yyyy-MM") == TradeMonth) Status = 1;
|
|
|
- //待考核
|
|
|
- if (int.Parse(DateTime.Now.ToString("yyyyMM")) < int.Parse(month.ToString("yyyyMM"))) Status = 0;
|
|
|
- //已通过
|
|
|
- if (TradeAmount >= 10000 && IsJoin != 3 && check.Id > 0) Status = 2;
|
|
|
- //未通过
|
|
|
- if (TradeAmount < 10000 && IsJoin != 3 && check.Id > 0) Status = -1;
|
|
|
+ month = month.AddMonths(i + 1);
|
|
|
+ TradeMonth = month.ToString("yyyy-MM");
|
|
|
+ var check = MerchantAmountSummayService.Query(" and IsAct=1 and TradeMonth='" + TradeMonth + "' and MerchantId=" + MerchantId + "");
|
|
|
+ if (check.Id > 0)
|
|
|
+ {
|
|
|
+ dic = MerchantAmountSummayService.Sum("TradeAmount", " and IsAct=1 and TradeMonth='" + TradeMonth + "'");
|
|
|
+ TradeAmount = decimal.Parse(dic["TradeAmount"].ToString());
|
|
|
+ }
|
|
|
+ if (IsJoin == 0)
|
|
|
+ {
|
|
|
+ //未参与
|
|
|
+ Status = 3;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //考核中
|
|
|
+ if (DateTime.Now.ToString("yyyy-MM") == TradeMonth) Status = 1;
|
|
|
+ //待考核
|
|
|
+ if (int.Parse(DateTime.Now.ToString("yyyyMM")) < int.Parse(month.ToString("yyyyMM"))) Status = 0;
|
|
|
+ //已通过
|
|
|
+ if (TradeAmount >= 10000 && IsJoin != 3 && check.Id > 0) Status = 2;
|
|
|
+ //未通过
|
|
|
+ if (TradeAmount < 10000 && IsJoin != 3 && check.Id > 0) Status = -1;
|
|
|
|
|
|
- Dictionary<string, object> curData = new Dictionary<string, object>();
|
|
|
- curData.Add("TradeMonth", TradeMonth); //月份
|
|
|
- curData.Add("TradeAmount", TradeAmount); //订单金额
|
|
|
- curData.Add("Status", Status); //状态(-1 未通过 0 待考核 1 考核中 2 已通过 3 未参与)
|
|
|
- dataList.Add(curData);
|
|
|
+ Dictionary<string, object> curData = new Dictionary<string, object>();
|
|
|
+ curData.Add("TradeMonth", TradeMonth); //月份
|
|
|
+ curData.Add("TradeAmount", TradeAmount); //订单金额
|
|
|
+ curData.Add("Status", Status); //状态(-1 未通过 0 待考核 1 考核中 2 已通过 3 未参与)
|
|
|
+ dataList.Add(curData);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return dataList;
|