|
@@ -114,24 +114,34 @@ func CentralKitchenForSchoolOrderRefund(req md.CentralKitchenForSchoolOrderRefun |
|
|
func CentralKitchenForSchoolOrderRefundList(req md.CentralKitchenForSchoolOrderRefundListReq) (resp []md.CentralKitchenForSchoolOrderRefundListResp, total int64, err error) { |
|
|
func CentralKitchenForSchoolOrderRefundList(req md.CentralKitchenForSchoolOrderRefundListReq) (resp []md.CentralKitchenForSchoolOrderRefundListResp, total int64, err error) { |
|
|
var m []*db.CentralKitchenForSchoolUserRefundDayWithCentralKitchenForSchoolUserWithDay |
|
|
var m []*db.CentralKitchenForSchoolUserRefundDayWithCentralKitchenForSchoolUserWithDay |
|
|
sess := db.Db.Where("central_kitchen_for_school_user_refund_day.identity_id =?", req.UserIdentityId) |
|
|
sess := db.Db.Where("central_kitchen_for_school_user_refund_day.identity_id =?", req.UserIdentityId) |
|
|
|
|
|
if req.State != 0 { |
|
|
|
|
|
sess = sess.And("central_kitchen_for_school_user_refund_day.state = ?", req.State) |
|
|
|
|
|
} |
|
|
total, err = sess.Desc("central_kitchen_for_school_user_refund_day.id"). |
|
|
total, err = sess.Desc("central_kitchen_for_school_user_refund_day.id"). |
|
|
Join("LEFT", "central_kitchen_for_school_user_with_day", "central_kitchen_for_school_user_refund_day.records_id = central_kitchen_for_school_user_with_day.id"). |
|
|
Join("LEFT", "central_kitchen_for_school_user_with_day", "central_kitchen_for_school_user_refund_day.records_id = central_kitchen_for_school_user_with_day.id"). |
|
|
Limit(req.Limit, (req.Page-1)*req.Limit).FindAndCount(&m) |
|
|
Limit(req.Limit, (req.Page-1)*req.Limit).FindAndCount(&m) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return nil, 0, err |
|
|
return nil, 0, err |
|
|
} |
|
|
} |
|
|
|
|
|
userIdentityDb := db.UserIdentityDb{} |
|
|
|
|
|
userIdentityDb.Set(req.UserIdentityId) |
|
|
|
|
|
identity, err := userIdentityDb.UserIdentity(req.UserIdentityId) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, 0, err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
for _, v := range m { |
|
|
for _, v := range m { |
|
|
resp = append(resp, md.CentralKitchenForSchoolOrderRefundListResp{ |
|
|
resp = append(resp, md.CentralKitchenForSchoolOrderRefundListResp{ |
|
|
OutTradeNo: v.CentralKitchenForSchoolUserRefundDay.OutTradeNo, |
|
|
|
|
|
OutRequestNo: v.CentralKitchenForSchoolUserRefundDay.OutRequestNo, |
|
|
|
|
|
Kind: v.CentralKitchenForSchoolUserWithDay.Kind, |
|
|
|
|
|
CreateAt: v.CentralKitchenForSchoolUserRefundDay.CreateAt, |
|
|
|
|
|
RefundDate: v.CentralKitchenForSchoolUserRefundDay.RefundDate, |
|
|
|
|
|
Date: v.CentralKitchenForSchoolUserWithDay.Date, |
|
|
|
|
|
State: v.CentralKitchenForSchoolUserRefundDay.State, |
|
|
|
|
|
Memo: v.CentralKitchenForSchoolUserRefundDay.Memo, |
|
|
|
|
|
Amount: v.CentralKitchenForSchoolUserRefundDay.Amount, |
|
|
|
|
|
|
|
|
OutTradeNo: v.CentralKitchenForSchoolUserRefundDay.OutTradeNo, |
|
|
|
|
|
OutRequestNo: v.CentralKitchenForSchoolUserRefundDay.OutRequestNo, |
|
|
|
|
|
Kind: v.CentralKitchenForSchoolUserWithDay.Kind, |
|
|
|
|
|
CreateAt: v.CentralKitchenForSchoolUserRefundDay.CreateAt, |
|
|
|
|
|
RefundDate: v.CentralKitchenForSchoolUserRefundDay.RefundDate, |
|
|
|
|
|
Date: v.CentralKitchenForSchoolUserWithDay.Date, |
|
|
|
|
|
State: v.CentralKitchenForSchoolUserRefundDay.State, |
|
|
|
|
|
Memo: v.CentralKitchenForSchoolUserRefundDay.Memo, |
|
|
|
|
|
Amount: v.CentralKitchenForSchoolUserRefundDay.Amount, |
|
|
|
|
|
EnterpriseName: identity.Enterprise.Name, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
return |
|
|
return |
|
|