|
@@ -37,7 +37,7 @@ func CalcBySchoolTerm(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) |
|
|
mealLabelDb := db.MealLabelDb{} |
|
|
mealLabelDb := db.MealLabelDb{} |
|
|
mealLabelDb.Set(buyPackageReq.EnterpriseId) |
|
|
mealLabelDb.Set(buyPackageReq.EnterpriseId) |
|
|
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner *model.MealLabel |
|
|
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner *model.MealLabel |
|
|
if buyPackageReq.IsBuyBreakfast == 1 { |
|
|
|
|
|
|
|
|
if !isTeacher && buyPackageReq.IsBuyBreakfast == 1{ |
|
|
mealLabelForBreakfast, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForBreakfast) |
|
|
mealLabelForBreakfast, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForBreakfast) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return |
|
|
return |
|
@@ -47,7 +47,7 @@ func CalcBySchoolTerm(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if buyPackageReq.IsBuyLunch == 1 { |
|
|
|
|
|
|
|
|
if !isTeacher && buyPackageReq.IsBuyLunch == 1 { |
|
|
mealLabelForLunch, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForLunch) |
|
|
mealLabelForLunch, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForLunch) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return |
|
|
return |
|
@@ -57,7 +57,7 @@ func CalcBySchoolTerm(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if buyPackageReq.IsBuyDinner == 1 { |
|
|
|
|
|
|
|
|
if !isTeacher && buyPackageReq.IsBuyDinner == 1 { |
|
|
mealLabelForDinner, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForDinner) |
|
|
mealLabelForDinner, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForDinner) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return |
|
|
return |
|
@@ -198,7 +198,7 @@ func CalcByMonth(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (tota |
|
|
mealLabelDb := db.MealLabelDb{} |
|
|
mealLabelDb := db.MealLabelDb{} |
|
|
mealLabelDb.Set(buyPackageReq.EnterpriseId) |
|
|
mealLabelDb.Set(buyPackageReq.EnterpriseId) |
|
|
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner *model.MealLabel |
|
|
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner *model.MealLabel |
|
|
if buyPackageReq.IsBuyBreakfast == 1 { |
|
|
|
|
|
|
|
|
if !isTeacher && buyPackageReq.IsBuyBreakfast == 1 { |
|
|
mealLabelForBreakfast, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForBreakfast) |
|
|
mealLabelForBreakfast, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForBreakfast) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return |
|
|
return |
|
@@ -208,7 +208,7 @@ func CalcByMonth(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (tota |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if buyPackageReq.IsBuyLunch == 1 { |
|
|
|
|
|
|
|
|
if !isTeacher && buyPackageReq.IsBuyLunch == 1 { |
|
|
mealLabelForLunch, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForLunch) |
|
|
mealLabelForLunch, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForLunch) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return |
|
|
return |
|
@@ -218,7 +218,7 @@ func CalcByMonth(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (tota |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if buyPackageReq.IsBuyDinner == 1 { |
|
|
|
|
|
|
|
|
if !isTeacher && buyPackageReq.IsBuyDinner == 1 { |
|
|
mealLabelForDinner, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForDinner) |
|
|
mealLabelForDinner, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForDinner) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return |
|
|
return |
|
@@ -358,7 +358,7 @@ func CalcByDay(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (totalP |
|
|
mealLabelDb := db.MealLabelDb{} |
|
|
mealLabelDb := db.MealLabelDb{} |
|
|
mealLabelDb.Set(buyPackageReq.EnterpriseId) |
|
|
mealLabelDb.Set(buyPackageReq.EnterpriseId) |
|
|
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner *model.MealLabel |
|
|
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner *model.MealLabel |
|
|
if buyPackageReq.IsBuyBreakfast == 1 { |
|
|
|
|
|
|
|
|
if !isTeacher && buyPackageReq.IsBuyBreakfast == 1 { |
|
|
mealLabelForBreakfast, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForBreakfast) |
|
|
mealLabelForBreakfast, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForBreakfast) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return |
|
|
return |
|
@@ -368,7 +368,7 @@ func CalcByDay(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (totalP |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if buyPackageReq.IsBuyLunch == 1 { |
|
|
|
|
|
|
|
|
if !isTeacher && buyPackageReq.IsBuyLunch == 1 { |
|
|
mealLabelForLunch, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForLunch) |
|
|
mealLabelForLunch, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForLunch) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return |
|
|
return |
|
@@ -378,7 +378,7 @@ func CalcByDay(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (totalP |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if buyPackageReq.IsBuyDinner == 1 { |
|
|
|
|
|
|
|
|
if !isTeacher && buyPackageReq.IsBuyDinner == 1 { |
|
|
mealLabelForDinner, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForDinner) |
|
|
mealLabelForDinner, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForDinner) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return |
|
|
return |
|
@@ -498,7 +498,7 @@ func CalcSupplementaryByDay(uid int, isTeacher bool, buyPackageReq md2.BuyPackag |
|
|
mealLabelDb := db.MealLabelDb{} |
|
|
mealLabelDb := db.MealLabelDb{} |
|
|
mealLabelDb.Set(buyPackageReq.EnterpriseId) |
|
|
mealLabelDb.Set(buyPackageReq.EnterpriseId) |
|
|
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner *model.MealLabel |
|
|
var mealLabelForBreakfast, mealLabelForLunch, mealLabelForDinner *model.MealLabel |
|
|
if buyPackageReq.IsBuyBreakfast == 1 { |
|
|
|
|
|
|
|
|
if !isTeacher && buyPackageReq.IsBuyBreakfast == 1 { |
|
|
mealLabelForBreakfast, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForBreakfast) |
|
|
mealLabelForBreakfast, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForBreakfast) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return |
|
|
return |
|
@@ -508,7 +508,7 @@ func CalcSupplementaryByDay(uid int, isTeacher bool, buyPackageReq md2.BuyPackag |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if buyPackageReq.IsBuyLunch == 1 { |
|
|
|
|
|
|
|
|
if !isTeacher && buyPackageReq.IsBuyLunch == 1 { |
|
|
mealLabelForLunch, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForLunch) |
|
|
mealLabelForLunch, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForLunch) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return |
|
|
return |
|
@@ -518,7 +518,7 @@ func CalcSupplementaryByDay(uid int, isTeacher bool, buyPackageReq md2.BuyPackag |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if buyPackageReq.IsBuyDinner == 1 { |
|
|
|
|
|
|
|
|
if !isTeacher && buyPackageReq.IsBuyDinner == 1 { |
|
|
mealLabelForDinner, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForDinner) |
|
|
mealLabelForDinner, err = mealLabelDb.GetMealLabel(buyPackageReq.MealLabelIdForDinner) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return |
|
|
return |
|
|