dengbiao 2 months ago
parent
commit
6540dda2ff
1 changed files with 16 additions and 4 deletions
  1. +16
    -4
      app/customer/svc/svc_central_kitchen_for_school_package.go

+ 16
- 4
app/customer/svc/svc_central_kitchen_for_school_package.go View File

@@ -36,7 +36,10 @@ func CalcBySchoolTerm(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq)
//}
mealLabelDb := db.MealLabelDb{}
mealLabelDb.Set(buyPackageReq.EnterpriseId)
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner = model.MealLabel{}, model.MealLabel{}, model.MealLabel{}
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner *model.MealLabel
if isTeacher {
mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner = &model.MealLabel{}, &model.MealLabel{}, &model.MealLabel{}
}
if !isTeacher && buyPackageReq.IsBuyBreakfast == 1{
mealLabelForBreakfast, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForBreakfast)
if err != nil {
@@ -197,7 +200,10 @@ func CalcByMonth(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (tota
//}
mealLabelDb := db.MealLabelDb{}
mealLabelDb.Set(buyPackageReq.EnterpriseId)
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner = model.MealLabel{}, model.MealLabel{}, model.MealLabel{}
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner *model.MealLabel
if isTeacher {
mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner = &model.MealLabel{}, &model.MealLabel{}, &model.MealLabel{}
}
if !isTeacher && buyPackageReq.IsBuyBreakfast == 1 {
mealLabelForBreakfast, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForBreakfast)
if err != nil {
@@ -357,7 +363,10 @@ func CalcByDay(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (totalP
//}
mealLabelDb := db.MealLabelDb{}
mealLabelDb.Set(buyPackageReq.EnterpriseId)
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner = model.MealLabel{}, model.MealLabel{}, model.MealLabel{}
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner *model.MealLabel
if isTeacher {
mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner = &model.MealLabel{}, &model.MealLabel{}, &model.MealLabel{}
}
if !isTeacher && buyPackageReq.IsBuyBreakfast == 1 {
mealLabelForBreakfast, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForBreakfast)
if err != nil {
@@ -497,7 +506,10 @@ func CalcSupplementaryByDay(uid int, isTeacher bool, buyPackageReq md2.BuyPackag
//}
mealLabelDb := db.MealLabelDb{}
mealLabelDb.Set(buyPackageReq.EnterpriseId)
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner = model.MealLabel{}, model.MealLabel{}, model.MealLabel{}
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner *model.MealLabel
if isTeacher {
mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner = &model.MealLabel{}, &model.MealLabel{}, &model.MealLabel{}
}
if !isTeacher && buyPackageReq.IsBuyBreakfast == 1 {
mealLabelForBreakfast, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForBreakfast)
if err != nil {


Loading…
Cancel
Save