Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
c76eee59fa
2 changed files with 13 additions and 8 deletions
  1. +8
    -7
      app/customer/md/md_pay.go
  2. +5
    -1
      app/customer/svc/svc_central_kitchen_for_school_package.go

+ 8
- 7
app/customer/md/md_pay.go View File

@@ -1,13 +1,14 @@
package md package md


type BuyPackageReq struct { type BuyPackageReq struct {
EnterpriseId int `json:"enterprise_id" binding:"required" label:"企业id"`
UserIdentityId int `json:"user_identity_id" binding:"required" label:"用户身份id"`
PackageId int `json:"package_id" label:"套餐ID"`
Kind int `json:"kind" binding:"required" label:"购买类型(1:按学期购买 2:按月购买 3:按天购买 4:补餐)"`
IsBuyBreakfast int `json:"is_buy_breakfast" label:"是否购买早餐(1:是 2:否)"`
IsBuyLunch int `json:"is_buy_lunch" label:"是否购买午餐(1:是 2:否)"`
IsBuyDinner int `json:"is_buy_dinner" label:"是否购买晚餐(1:是 2:否)"`
EnterpriseId int `json:"enterprise_id" binding:"required" label:"企业id"`
UserIdentityId int `json:"user_identity_id" binding:"required" label:"用户身份id"`
PackageId int `json:"package_id" label:"套餐ID"`
PackageIds []int `json:"package_ids" label:"套餐ID"`
Kind int `json:"kind" binding:"required" label:"购买类型(1:按学期购买 2:按月购买 3:按天购买 4:补餐)"`
IsBuyBreakfast int `json:"is_buy_breakfast" label:"是否购买早餐(1:是 2:否)"`
IsBuyLunch int `json:"is_buy_lunch" label:"是否购买午餐(1:是 2:否)"`
IsBuyDinner int `json:"is_buy_dinner" label:"是否购买晚餐(1:是 2:否)"`
WithDays []struct { WithDays []struct {
Date string `json:"date" label:"日期"` Date string `json:"date" label:"日期"`
IsBuyBreakfast int `json:"is_buy_breakfast" label:"是否购买早餐(1:是 2:否)"` IsBuyBreakfast int `json:"is_buy_breakfast" label:"是否购买早餐(1:是 2:否)"`


+ 5
- 1
app/customer/svc/svc_central_kitchen_for_school_package.go View File

@@ -30,7 +30,11 @@ func CalcBySchoolTerm(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq)
var m []model.CentralKitchenForSchoolPackage var m []model.CentralKitchenForSchoolPackage
now := time.Now() now := time.Now()
today, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02")) today, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02"))
err = db.Db.Where("enterprise_id =?", buyPackageReq.EnterpriseId).And("end_date > ?", now.Format("2006-01-02 15:04:05")).And("is_delete = 0").And("state = 1").Desc("end_date").Find(&m)
//err = db.Db.Where("enterprise_id =?", buyPackageReq.EnterpriseId).And("end_date > ?", now.Format("2006-01-02 15:04:05")).And("is_delete = 0").And("state = 1").Desc("end_date").Find(&m)
//if err != nil {
// return
//}
err = db.Db.Where("enterprise_id =?", buyPackageReq.EnterpriseId).In("id", buyPackageReq.PackageIds).And("is_delete = 0").And("state = 1").Desc("end_date").Find(&m)
if err != nil { if err != nil {
return return
} }


Loading…
Cancel
Save