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 70a626b..928a365 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 @@ -315,6 +315,12 @@ func SetCentralKitchenForSchoolWithSpec(c *gin.Context) { return } + _, err = centralKitchenForSchoolWithSpec.CentralKitchenForSchoolWithSpecDelete() + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + now := time.Now() if spec != nil { insertConfirm, err1 := centralKitchenForSchoolWithSpec.CentralKitchenForSchoolWithSpecInsert(&model.CentralKitchenForSchoolWithSpec{ diff --git a/app/admin/hdl/enterprise_manage/hdl_nursing_home.go b/app/admin/hdl/enterprise_manage/hdl_nursing_home.go index c0299c3..9a2fd53 100644 --- a/app/admin/hdl/enterprise_manage/hdl_nursing_home.go +++ b/app/admin/hdl/enterprise_manage/hdl_nursing_home.go @@ -108,6 +108,12 @@ func SetNursingHomeWithSpec(c *gin.Context) { return } + _, err = nursingHomeWithSpec.NursingHomeWithSpecDelete() + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + now := time.Now() if spec != nil { insertConfirm, err1 := nursingHomeWithSpec.NursingHomeWithSpecInsert(&model.NursingHomeWithSpec{ diff --git a/app/admin/svc/enterprise_manage/svc_nursing_home.go b/app/admin/svc/enterprise_manage/svc_nursing_home.go index fea0251..6ece9be 100644 --- a/app/admin/svc/enterprise_manage/svc_nursing_home.go +++ b/app/admin/svc/enterprise_manage/svc_nursing_home.go @@ -109,27 +109,27 @@ func NursingHomeOrdList(req md.NursingHomeOrdListReq) (resp []md.NursingHomeOrdL classWithUserDb := db.ClassWithUserDb{} classWithUserDb.Set() - sess := db.Db.Desc("central_kitchen_for_school_package_ord.id") + sess := db.Db.Desc("nursing_home_package_ord.id") if req.EnterpriseId != 0 { - sess.And("central_kitchen_for_school_package_ord.enterprise_id =?", req.EnterpriseId) + sess.And("nursing_home_package_ord.enterprise_id =?", req.EnterpriseId) } if req.StartDate != "" { - sess.And("central_kitchen_for_school_package_ord.create_at >= ?", req.StartDate) + sess.And("nursing_home_package_ord.create_at >= ?", req.StartDate) } if req.EndDate != "" { - sess.And("central_kitchen_for_school_package_ord.create_at <= ?", req.EndDate) + sess.And("nursing_home_package_ord.create_at <= ?", req.EndDate) } if req.Kind != 0 { - sess.And("central_kitchen_for_school_package_ord.kind = ", req.Kind) + sess.And("nursing_home_package_ord.kind = ", req.Kind) } if req.Sate != 0 { - sess.And("central_kitchen_for_school_package_ord.state = ", req.Sate) + sess.And("nursing_home_package_ord.state = ", req.Sate) } if req.OrdSate != 0 { - sess.And("central_kitchen_for_school_package_ord.ord_state = ", req.OrdSate) + sess.And("nursing_home_package_ord.ord_state = ", req.OrdSate) } if req.OutTradeNo != "" { - sess.And("central_kitchen_for_school_package_ord.out_trade_no like ?", "%"+req.OutTradeNo+"%") + sess.And("nursing_home_package_ord.out_trade_no like ?", "%"+req.OutTradeNo+"%") } if req.Name != "" { @@ -148,7 +148,7 @@ func NursingHomeOrdList(req md.NursingHomeOrdListReq) (resp []md.NursingHomeOrdL var m []*db.NursingHomePackageOrdWithUserIdentity count, err = sess. - Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord.user_identity_id = user_identity.id"). + Join("LEFT", "user_identity", "nursing_home_package_ord.user_identity_id = user_identity.id"). Join("LEFT", "enterprise", "enterprise.id = user_identity.enterprise_id"). Join("LEFT", "user", "user.id = user_identity.uid"). Limit(req.Limit, (req.Page-1)*req.Limit).FindAndCount(&m) @@ -216,8 +216,8 @@ func NursingHomeReserveList(req md.NursingHomeReserveListReq) (resp []md.Nursing var m []*db.NursingHomePackageOrdForReserveWithUserIdentity count, 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", "nursing_home_package_ord", "nursing_home_package_ord_for_reserve.out_trade_no = nursing_home_package_ord.out_trade_no"). + Join("LEFT", "user_identity", "nursing_home_package_ord.user_identity_id = user_identity.id"). Join("LEFT", "enterprise", "enterprise.id = user_identity.enterprise_id"). Join("LEFT", "user", "user.id = user_identity.uid"). Limit(req.Limit, (req.Page-1)*req.Limit).FindAndCount(&m) diff --git a/app/db/db_nursing_home_package_ord_for_reserve.go b/app/db/db_nursing_home_package_ord_for_reserve.go index 499a29c..1d0e971 100644 --- a/app/db/db_nursing_home_package_ord_for_reserve.go +++ b/app/db/db_nursing_home_package_ord_for_reserve.go @@ -102,5 +102,5 @@ type NursingHomePackageOrdForReserveWithUserIdentity struct { } func (NursingHomePackageOrdForReserveWithUserIdentity) TableName() string { - return "central_kitchen_for_school_package_ord_for_reserve" + return "nursing_home_package_ord_for_reserve" } diff --git a/app/db/model/nursing_home_package_ord.go b/app/db/model/nursing_home_package_ord.go index 4499260..1f9bacb 100644 --- a/app/db/model/nursing_home_package_ord.go +++ b/app/db/model/nursing_home_package_ord.go @@ -13,7 +13,7 @@ type NursingHomePackageOrd struct { State int `json:"state" xorm:"not null default 0 comment('支付状态(0:待支付 1:支付成功 2:支付失败)') TINYINT(1)"` OrdState int `json:"ord_state" xorm:"not null default 0 comment('订单状态(0:待预约 1:预约成功 2:退款中 3:部分退款 4:已退款 5:已完成)') TINYINT(1)"` ReqContent string `json:"req_content" xorm:"comment('请求内容') TEXT"` - WithDayData string `json:"with_day_data" xorm:"comment('待支付成功插入 nursing_home_for_school_user_with_day') TEXT"` + WithDayData string `json:"with_day_data" xorm:"comment('待支付成功插入 nursing_home_user_with_day') TEXT"` CreateAt string `json:"create_at" xorm:"not null pk default 'CURRENT_TIMESTAMP' DATETIME"` UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` } diff --git a/app/enum/enum_sys_cfg.go b/app/enum/enum_sys_cfg.go index aea0b4a..961bc43 100644 --- a/app/enum/enum_sys_cfg.go +++ b/app/enum/enum_sys_cfg.go @@ -27,8 +27,8 @@ const ( AdministratorContactInfo = "administrator_contact_info" CentralKitchenForSchoolReserveMealTime = "central_kitchen_for_school_reserve_meal_time" CentralKitchenForSchoolCancelMealTime = "central_kitchen_for_school_cancel_meal_time" - NursingHomeReserveMealTime = "nursing_home_for_school_reserve_meal_time" - NursingHomeCancelMealTime = "nursing_home_for_school_cancel_meal_time" + NursingHomeReserveMealTime = "nursing_home_reserve_meal_time" + NursingHomeCancelMealTime = "nursing_home_cancel_meal_time" JsapiPayAppAutToken = "jsapi_pay_app_auth_token" )