ソースを参照

update

add_mode
DengBiao 1年前
コミット
c76eee59fa
2個のファイルの変更13行の追加8行の削除
  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 ファイルの表示

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

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 {
Date string `json:"date" label:"日期"`
IsBuyBreakfast int `json:"is_buy_breakfast" label:"是否购买早餐(1:是 2:否)"`


+ 5
- 1
app/customer/svc/svc_central_kitchen_for_school_package.go ファイルの表示

@@ -30,7 +30,11 @@ func CalcBySchoolTerm(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq)
var m []model.CentralKitchenForSchoolPackage
now := time.Now()
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 {
return
}


読み込み中…
キャンセル
保存