public ActionResult AccountLine(string userName, string userPhone, int?accType, int page = 1, int rows = 10) { if (Request.IsAjaxRequest()) { if (!accType.HasValue) { return(null); } var lines = this._userManager.AccountLines(userName, userPhone, accType.Value, page, rows); var total = this._userManager.AccountLinesTotal(userName, userPhone, accType.Value); var result = new { total = total, rows = lines.Select(a => new { user_name = a.user.user_name, user_phone = a.user.user_phone, acc_type = AccountConstants.ToString(a.acc_type), acc_record_type = AccRecordType.ToString(a.acc_record_type), cons_value = a.cons_type == ConType.EXPEND ? "-" + a.cons_value : "+" + a.cons_value, acc_record_time = a.acc_record_time.ToString("yyyy-MM-dd HH:mm"), acc_remark = a.acc_remark }) }; return(Json(result)); } return(View()); }
private object ToBonusRecordViewModel(account_record b) { return(new { user_name = b.user.user_name, user_phone = b.user.user_phone, acc_type = AccountConstants.ToString(b.acc_type), bonus_money = b.cons_value, bonus_time = b.acc_record_time.ToString("yyyy-MM-dd HH:mm:ss"), bonus_remark = b.acc_remark, acc_balance = b.acc_balance }); }