@@ -5,4 +5,5 @@ import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | |||||
type HappyOrchardSeedDao interface { | type HappyOrchardSeedDao interface { | ||||
GetHappyOrchardSeed(id int) (m *models.HappyOrchardSeed, err error) | GetHappyOrchardSeed(id int) (m *models.HappyOrchardSeed, err error) | ||||
FindHappyOrchardSeedAll(start, limit int) (mm *[]models.HappyOrchardSeed, err error) | FindHappyOrchardSeedAll(start, limit int) (mm *[]models.HappyOrchardSeed, err error) | ||||
FindHappyOrchardSeedWithIds(ids []int) (mm *[]models.HappyOrchardSeed, err error) | |||||
} | } |
@@ -9,4 +9,5 @@ type HappyOrchardUserSeedRecordDao interface { | |||||
FindHappyOrchardUserSeedRecordByUid(uid int) (mm *[]models.HappyOrchardUserSeedRecord, err error) | FindHappyOrchardUserSeedRecordByUid(uid int) (mm *[]models.HappyOrchardUserSeedRecord, err error) | ||||
GetHappyOrchardUserSeedRecordByUidWithState(uid, state int) (m *models.HappyOrchardUserSeedRecord, err error) | GetHappyOrchardUserSeedRecordByUidWithState(uid, state int) (m *models.HappyOrchardUserSeedRecord, err error) | ||||
GetHappyOrchardUserSeedRecordByUidWithStateAndId(uid, id, 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) | |||||
} | } |
@@ -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) { | func (h HappyOrchardSeedDb) FindHappyOrchardSeedAll(start, limit int) (mm *[]models.HappyOrchardSeed, err error) { | ||||
var m []models.HappyOrchardSeed | 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 nil, zhios_order_relate_logx.Error(err) | ||||
} | } | ||||
return &m, nil | return &m, nil | ||||
@@ -58,3 +58,10 @@ func (h happyOrchardUserSeedRecordDb) GetHappyOrchardUserSeedRecordByUidWithStat | |||||
} | } | ||||
return m, nil | 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 | |||||
} |
@@ -7,12 +7,12 @@ type HappyOrchardSeed struct { | |||||
SeedImgUrl string `json:"seed_img_url" xorm:"not null default '' comment('种子图片地址') VARCHAR(255)"` | 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)"` | 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)"` | 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)"` | 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"` | 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"` | UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"` | ||||