|
|
@@ -1015,17 +1015,33 @@ func CentralKitchenForSchoolReserveDetail(c *gin.Context) { |
|
|
|
e.OutErr(c, e.ERR_NO_DATA, "未查询到相应记录") |
|
|
|
return |
|
|
|
} |
|
|
|
var m []model.CentralKitchenForSchoolUserWithDay |
|
|
|
err = db.Db.Where("ord_no =?", centralKitchenForSchoolPackageOrdForReserve.OutTradeNo). |
|
|
|
And("date >=? and date <=?", centralKitchenForSchoolPackageOrdForReserve.MealTimeStart, centralKitchenForSchoolPackageOrdForReserve.MealTimeEnd). |
|
|
|
|
|
|
|
var m []*db.CentralKitchenForSchoolUserRefundDayWithCentralKitchenForSchoolUserWithDay |
|
|
|
err = db.Db.Where("central_kitchen_for_school_user_with_day.ord_no =?", centralKitchenForSchoolPackageOrdForReserve.OutTradeNo). |
|
|
|
Where("central_kitchen_for_school_user_with_day.date >=? and central_kitchen_for_school_user_with_day.date <=?", centralKitchenForSchoolPackageOrdForReserve.MealTimeStart, centralKitchenForSchoolPackageOrdForReserve.MealTimeEnd). |
|
|
|
Join("LEFT", "central_kitchen_for_school_user_refund_day", "central_kitchen_for_school_user_refund_day.records_id = central_kitchen_for_school_user_with_day.id"). |
|
|
|
Find(&m) |
|
|
|
if err != nil { |
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
var resp []map[string]interface{} |
|
|
|
for _, v := range m { |
|
|
|
resp = append(resp, map[string]interface{}{ |
|
|
|
"id": v.CentralKitchenForSchoolUserWithDay.Id, |
|
|
|
"ord_no": v.CentralKitchenForSchoolUserWithDay.OrdNo, |
|
|
|
"uid": v.CentralKitchenForSchoolUserWithDay.Uid, |
|
|
|
"enterprise_id": v.CentralKitchenForSchoolUserWithDay.EnterpriseId, |
|
|
|
"identity_id": v.CentralKitchenForSchoolUserWithDay.IdentityId, |
|
|
|
"kind": v.CentralKitchenForSchoolUserWithDay.Kind, |
|
|
|
"amount": v.CentralKitchenForSchoolUserWithDay.Amount, |
|
|
|
"date": v.CentralKitchenForSchoolUserWithDay.Date, |
|
|
|
"state": v.CentralKitchenForSchoolUserWithDay.State, |
|
|
|
"refund_date": v.CentralKitchenForSchoolUserRefundDay.RefundDate, |
|
|
|
}) |
|
|
|
} |
|
|
|
e.OutSuc(c, map[string]interface{}{ |
|
|
|
"list": m, |
|
|
|
"list": resp, |
|
|
|
"kind_list": []map[string]interface{}{ |
|
|
|
{ |
|
|
|
"name": enum.CentralKitchenForSchoolUserWithDayKind.String(enum.CentralKitchenForSchoolUserWithDayKindForBreakfast), |
|
|
|