Browse Source

更新

master
huangjiajun 7 months ago
parent
commit
7fe5f4073a
5 changed files with 23 additions and 7 deletions
  1. +1
    -0
      src/dao/happy_orchard_seed_dao.go
  2. +1
    -0
      src/dao/happy_orchard_user_seed_record_dao.go
  3. +8
    -1
      src/implement/happy_orchard_seed_db.go
  4. +7
    -0
      src/implement/happy_orchard_user_seed_record_db.go
  5. +6
    -6
      src/models/happy_orchard_seed.go

+ 1
- 0
src/dao/happy_orchard_seed_dao.go View File

@@ -5,4 +5,5 @@ import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"
type HappyOrchardSeedDao interface {
GetHappyOrchardSeed(id int) (m *models.HappyOrchardSeed, err error)
FindHappyOrchardSeedAll(start, limit int) (mm *[]models.HappyOrchardSeed, err error)
FindHappyOrchardSeedWithIds(ids []int) (mm *[]models.HappyOrchardSeed, err error)
}

src/dao/happy_orchard_seed_record_dao.go → src/dao/happy_orchard_user_seed_record_dao.go View File

@@ -9,4 +9,5 @@ type HappyOrchardUserSeedRecordDao interface {
FindHappyOrchardUserSeedRecordByUid(uid int) (mm *[]models.HappyOrchardUserSeedRecord, err error)
GetHappyOrchardUserSeedRecordByUidWithState(uid, state int) (m *models.HappyOrchardUserSeedRecord, err error)
GetHappyOrchardUserSeedRecordByUidWithStateAndId(uid, id, state int) (m *models.HappyOrchardUserSeedRecord, err error)
FindHappyOrchardUserSeedRecordAll(uid, start, limit int) (mm *[]models.HappyOrchardUserSeedRecord, err error)
}

+ 8
- 1
src/implement/happy_orchard_seed_db.go View File

@@ -28,7 +28,14 @@ func (h HappyOrchardSeedDb) GetHappyOrchardSeed(id int) (m *models.HappyOrchardS
}
func (h HappyOrchardSeedDb) FindHappyOrchardSeedAll(start, limit int) (mm *[]models.HappyOrchardSeed, err error) {
var m []models.HappyOrchardSeed
if err := h.Db.OrderBy("sort desc,id desc").Limit(limit, start).Find(&m); err != nil {
if err := h.Db.Where("is_use=?", 1).OrderBy("sort desc,id desc").Limit(limit, start).Find(&m); err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
return &m, nil
}
func (h HappyOrchardSeedDb) FindHappyOrchardSeedWithIds(ids []int) (mm *[]models.HappyOrchardSeed, err error) {
var m []models.HappyOrchardSeed
if err := h.Db.In("id", ids).Find(&m); err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
return &m, nil


+ 7
- 0
src/implement/happy_orchard_user_seed_record_db.go View File

@@ -58,3 +58,10 @@ func (h happyOrchardUserSeedRecordDb) GetHappyOrchardUserSeedRecordByUidWithStat
}
return m, nil
}
func (h happyOrchardUserSeedRecordDb) FindHappyOrchardUserSeedRecordAll(uid, start, limit int) (mm *[]models.HappyOrchardUserSeedRecord, err error) {
var m []models.HappyOrchardUserSeedRecord
if err := h.Db.Where("uid=?", uid).OrderBy("id desc").Limit(limit, start).Find(&m); err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
return &m, nil
}

+ 6
- 6
src/models/happy_orchard_seed.go View File

@@ -7,12 +7,12 @@ type HappyOrchardSeed struct {
SeedImgUrl string `json:"seed_img_url" xorm:"not null default '' comment('种子图片地址') VARCHAR(255)"`
SeedMatureImgUrl string `json:"seed_mature_img_url" xorm:"not null default '' comment('种子成熟后图片地址') VARCHAR(255)"`
Sort int `json:"sort" xorm:"not null default 0 comment('排序') INT(11)"`
NeedWatersNumForStage0 int `json:"need_waters_num_for_stage_0" xorm:"not null default 0 comment('阶段1所需水滴数') INT(11)"`
NeedWatersNumForStage1 int `json:"need_waters_num_for_stage_1" xorm:"not null default 0 comment('阶段2所需水滴数') INT(11)"`
NeedWatersNumForStage2 int `json:"need_waters_num_for_stage_2" xorm:"not null default 0 comment('阶段3所需水滴数') INT(11)"`
NeedWatersNumForStage3 int `json:"need_waters_num_for_stage_3" xorm:"not null default 0 comment('阶段4所需水滴数') INT(11)"`
NeedWatersNumForStage4 int `json:"need_waters_num_for_stage_4" xorm:"not null default 0 comment('阶段5所需水滴数') INT(11)"`
NeedWatersNumForStage5 int `json:"need_waters_num_for_stage_5" xorm:"not null default 0 comment('阶段6所需水滴数') INT(11)"`
NeedWatersNumForStage0 int `json:"need_waters_num_for_stage_0" xorm:"need_waters_num_for_stage_0 not null default 0 comment('阶段1所需水滴数') INT(11)"`
NeedWatersNumForStage1 int `json:"need_waters_num_for_stage_1" xorm:"need_waters_num_for_stage_1 not null default 0 comment('阶段2所需水滴数') INT(11)"`
NeedWatersNumForStage2 int `json:"need_waters_num_for_stage_2" xorm:"need_waters_num_for_stage_2 not null default 0 comment('阶段3所需水滴数') INT(11)"`
NeedWatersNumForStage3 int `json:"need_waters_num_for_stage_3" xorm:"need_waters_num_for_stage_3 not null default 0 comment('阶段4所需水滴数') INT(11)"`
NeedWatersNumForStage4 int `json:"need_waters_num_for_stage_4" xorm:"need_waters_num_for_stage_4 not null default 0 comment('阶段5所需水滴数') INT(11)"`
NeedWatersNumForStage5 int `json:"need_waters_num_for_stage_5" xorm:"need_waters_num_for_stage_5 not null default 0 comment('阶段6所需水滴数') INT(11)"`
IsUse int32 `json:"is_use" xorm:"not null default 1 comment('是否可用(1:可用 2:不可用)') INT(11)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"`


Loading…
Cancel
Save