diff --git a/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go b/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go index 60e4dcb..2a15352 100644 --- a/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go +++ b/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go @@ -1012,8 +1012,9 @@ func CentralKitchenForSchoolReserveUpdateStudent(c *gin.Context) { } //2、修改 central_kitchen_for_school_user_with_day - sql := "update central_kitchen_for_school_user_with_day set identity_id = %d where identity_id = %d and kind = %d and date >= '%s' and date <= '%s'" - sql = fmt.Sprintf(sql, req.UserIdentityId, req.OriginalUserIdentityId, centralKitchenForSchoolPackageOrdForReserve.Kind, centralKitchenForSchoolPackageOrdForReserve.MealTimeStart, centralKitchenForSchoolPackageOrdForReserve.MealTimeEnd) + sql := "update central_kitchen_for_school_user_with_day set identity_id = %d where identity_id = %d and kind = %d and date >= '%s' and date <= '%s' and ord_no = '%s'" + sql = fmt.Sprintf(sql, req.UserIdentityId, req.OriginalUserIdentityId, centralKitchenForSchoolPackageOrdForReserve.Kind, centralKitchenForSchoolPackageOrdForReserve.MealTimeStart, + centralKitchenForSchoolPackageOrdForReserve.MealTimeEnd, centralKitchenForSchoolPackageOrdForReserve.OutTradeNo) fmt.Println("sql >>>>>", sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { diff --git a/app/admin/svc/svc_data_statisstics.go b/app/admin/svc/svc_data_statisstics.go index a04ee08..ae5c5ba 100644 --- a/app/admin/svc/svc_data_statisstics.go +++ b/app/admin/svc/svc_data_statisstics.go @@ -787,7 +787,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD } var m []*db.CentralKitchenForSchoolPackageOrdWithUserIdentity _, err := sess. - Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord.user_identity_id = user_identity.id"). + Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord_for_reserve.user_identity_id = user_identity.id"). Join("LEFT", "enterprise", "enterprise.id = user_identity.enterprise_id"). Join("LEFT", "user", "user.id = user_identity.uid"). Join("LEFT", "class_with_user", "class_with_user.user_identity_id = user_identity.id"). @@ -1026,7 +1026,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD } _, err := sess. Join("LEFT", "central_kitchen_for_school_package_ord", "central_kitchen_for_school_package_ord_for_reserve.out_trade_no = central_kitchen_for_school_package_ord.out_trade_no"). - Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord.user_identity_id = user_identity.id"). + Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord_for_reserve.user_identity_id = user_identity.id"). Join("LEFT", "enterprise", "enterprise.id = user_identity.enterprise_id"). Join("LEFT", "user", "user.id = user_identity.uid"). Join("LEFT", "class_with_user", "class_with_user.user_identity_id = user_identity.id"). @@ -1237,7 +1237,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD } _, err := sess. Join("LEFT", "central_kitchen_for_school_package_ord", "central_kitchen_for_school_package_ord_for_reserve.out_trade_no = central_kitchen_for_school_package_ord.out_trade_no"). - Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord.user_identity_id = user_identity.id"). + Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord_for_reserve.user_identity_id = user_identity.id"). Join("LEFT", "enterprise", "enterprise.id = user_identity.enterprise_id"). Join("LEFT", "user", "user.id = user_identity.uid"). Join("LEFT", "class_with_user", "class_with_user.user_identity_id = user_identity.id"). @@ -1274,8 +1274,8 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD enum.CentralKitchenForSchoolUserWithDayStateForCancel, enum.CentralKitchenForSchoolUserWithDayStateForCanceling, req.StartDate, req.EndDate, []int{v.CentralKitchenForSchoolPackageOrdForReserve.Kind}) if err2 != nil { - logx.Error(err) - println("<<<>>>>Error:::", err.Error()) + logx.Error(err2) + println("<<<>>>>Error:::", err2.Error()) return } if count == 0 { @@ -1689,7 +1689,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD } var m []*db.CentralKitchenForSchoolPackageOrdWithUserIdentity _, err := sess. - Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord.user_identity_id = user_identity.id"). + Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord_for_reserve.user_identity_id = user_identity.id"). Join("LEFT", "enterprise", "enterprise.id = user_identity.enterprise_id"). Join("LEFT", "user", "user.id = user_identity.uid"). Join("LEFT", "class_with_user", "class_with_user.user_identity_id = user_identity.id"). @@ -1896,7 +1896,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD } _, err := sess. Join("LEFT", "central_kitchen_for_school_package_ord", "central_kitchen_for_school_package_ord_for_reserve.out_trade_no = central_kitchen_for_school_package_ord.out_trade_no"). - Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord.user_identity_id = user_identity.id"). + Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord_for_reserve.user_identity_id = user_identity.id"). Join("LEFT", "enterprise", "enterprise.id = user_identity.enterprise_id"). FindAndCount(&m) if err != nil { @@ -2145,7 +2145,7 @@ func CentralKitchenForSchoolDataStatisticsContrast(req md.CentralKitchenForSchoo _, err := sess. Join("LEFT", "central_kitchen_for_school_package_ord", "central_kitchen_for_school_package_ord_for_reserve.out_trade_no = central_kitchen_for_school_package_ord.out_trade_no"). - Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord.user_identity_id = user_identity.id"). + Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord_for_reserve.user_identity_id = user_identity.id"). Join("LEFT", "enterprise", "enterprise.id = user_identity.enterprise_id"). Join("LEFT", "user", "user.id = user_identity.uid"). Join("LEFT", "class_with_user", "class_with_user.user_identity_id = user_identity.id"). @@ -2176,7 +2176,7 @@ func CentralKitchenForSchoolDataStatisticsContrast(req md.CentralKitchenForSchoo } _, err1 := sess1. Join("LEFT", "central_kitchen_for_school_package_ord", "central_kitchen_for_school_package_ord_for_reserve.out_trade_no = central_kitchen_for_school_package_ord.out_trade_no"). - Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord.user_identity_id = user_identity.id"). + Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord_for_reserve.user_identity_id = user_identity.id"). Join("LEFT", "enterprise", "enterprise.id = user_identity.enterprise_id"). Join("LEFT", "user", "user.id = user_identity.uid"). Join("LEFT", "class_with_user", "class_with_user.user_identity_id = user_identity.id").