Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
9311d1df32
6 changed files with 27 additions and 15 deletions
  1. +6
    -0
      app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go
  2. +6
    -0
      app/admin/hdl/enterprise_manage/hdl_nursing_home.go
  3. +11
    -11
      app/admin/svc/enterprise_manage/svc_nursing_home.go
  4. +1
    -1
      app/db/db_nursing_home_package_ord_for_reserve.go
  5. +1
    -1
      app/db/model/nursing_home_package_ord.go
  6. +2
    -2
      app/enum/enum_sys_cfg.go

+ 6
- 0
app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go View File

@@ -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{


+ 6
- 0
app/admin/hdl/enterprise_manage/hdl_nursing_home.go View File

@@ -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{


+ 11
- 11
app/admin/svc/enterprise_manage/svc_nursing_home.go View File

@@ -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)


+ 1
- 1
app/db/db_nursing_home_package_ord_for_reserve.go View File

@@ -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"
}

+ 1
- 1
app/db/model/nursing_home_package_ord.go View File

@@ -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"`
}

+ 2
- 2
app/enum/enum_sys_cfg.go View File

@@ -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"
)



Loading…
Cancel
Save