|
|
@@ -52,23 +52,64 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 待扣款明细列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexData(ToChargeBackRecordSub data, int page = 1, int limit = 30)
|
|
|
+ public JsonResult IndexData(ToChargeBackRecordSub data, string OrderNo, string StatusSelect, string CreateDateData, int page = 1, int limit = 30)
|
|
|
{
|
|
|
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
- Fields.Add("ParentId", "1");
|
|
|
-
|
|
|
- Fields.Add("CreateDate", "3"); //时间
|
|
|
|
|
|
|
|
|
string condition = " and Status>-1";
|
|
|
|
|
|
+ //分期单号
|
|
|
+ if (!string.IsNullOrEmpty(OrderNo))
|
|
|
+ {
|
|
|
+ var toChargeByStage = db.ToChargeByStage.FirstOrDefault(m => m.SeoKeyword == OrderNo) ?? new ToChargeByStage();
|
|
|
+ var toChargeBackRecordSub = db.ToChargeBackRecordSub.FirstOrDefault(m => m.ParentId == toChargeByStage.Id) ?? new ToChargeBackRecordSub();
|
|
|
+ condition += " and ParentId=" + toChargeByStage.Id;
|
|
|
+ }
|
|
|
+
|
|
|
+ //状态
|
|
|
+ if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
+ {
|
|
|
+ if (StatusSelect == "0")//待扣款
|
|
|
+ {
|
|
|
+ condition += " and Status=0";
|
|
|
+ }
|
|
|
+ if (StatusSelect == "1")//已扣款
|
|
|
+ {
|
|
|
+ condition += " and Status=1";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //创建时间
|
|
|
+ if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
+ {
|
|
|
+ string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ string start = datelist[0];
|
|
|
+ string end = datelist[1];
|
|
|
+ condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
|
|
|
+ }
|
|
|
|
|
|
Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("ToChargeBackRecordSub", Fields, "Id desc", "0", page, limit, condition);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
|
+ //状态
|
|
|
+ int Status = int.Parse(function.CheckInt(dic["Status"].ToString()));
|
|
|
+ dic["StatusName"] = "";
|
|
|
+ if (Status == 0)
|
|
|
+ {
|
|
|
+ dic["StatusName"] = "待扣款";
|
|
|
+ }
|
|
|
+ if (Status == 1)
|
|
|
+ {
|
|
|
+ dic["StatusName"] = "已扣款";
|
|
|
+ }
|
|
|
|
|
|
+ //分期单号
|
|
|
+ int ParentId = int.Parse(function.CheckInt(dic["ParentId"].ToString()));
|
|
|
+ var toChargeByStage = db.ToChargeByStage.FirstOrDefault(m => m.Id == ParentId) ?? new ToChargeByStage();
|
|
|
+ dic["OrderNo"] = toChargeByStage.SeoKeyword;
|
|
|
}
|
|
|
return Json(obj);
|
|
|
}
|