public ContentResult refundlist(RefundOrderListQueryRequest request) { var data = _orderService.RefundList(request); var res = new ResultDto <RefundOrderListResponse> { page = request.PageIndex, total = request.Total, records = request.Records, rows = data }; return(Content(res.Serialize())); }
//退单列表 public List <RefundOrderListResponse> RefundList(RefundOrderListQueryRequest request) { List <RefundOrderListResponse> list = new List <RefundOrderListResponse>(); try { StringBuilder join = new StringBuilder(); if (request.KeyValue.IsNotEmpty()) { request.KeyValue = $"%{request.KeyValue}%"; join.Append(" and (c.code like @KeyValue or c.account like @KeyValue) "); } if (request.OrderOperType.HasValue && request.OrderOperType > 0) { join.Append(" and a.orderType=@OrderType "); } if (request.StartDate.HasValue) { join.Append(" and a.createtime >= @StartDate"); } if (request.EndDate.HasValue) { request.EndDate = request.EndDate.Value.AddDays(1).AddSeconds(-1); join.Append(" and a.createtime<=@EndDate"); } var sql = $@"select a.id,a.orderId,a.title,a.content,a.orderOperType,a.createtime,a.operationStatus, b.money,b.remark,c.code MemberCode,c.account MemberAccount from t_order_operation a inner join t_order b on a.orderId=b.id inner join t_member c on b.memberId=c.id where a.isdelete=0 {join.ToString()} order by a.createtime desc"; int totalCount = 0; list = _dbContext.Page <RefundOrderListResponse>(sql, out totalCount, request.PageIndex, request.PageSize, request); request.Records = totalCount; } catch (Exception ex) { LogUtils.LogError("OrderService.RefundList", ex); } return(list); }