diff --git a/src/dao/happy_orchard_seed_record_dao.go b/src/dao/happy_orchard_seed_record_dao.go index feadcdd..8e7a7cb 100644 --- a/src/dao/happy_orchard_seed_record_dao.go +++ b/src/dao/happy_orchard_seed_record_dao.go @@ -1,12 +1,3 @@ -<<<<<<< HEAD -package dao - -import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" - -type HappyOrchardUserSeedRecordDao interface { - GetHappyOrchardUserSeedRecord(id int) (m *models.HappyOrchardUserSeedRecord, err error) - FindHappyOrchardUserSeedRecordsByUid(uid int) (mm *[]models.HappyOrchardUserSeedRecord, err error) -======= package dao import ( @@ -18,5 +9,4 @@ 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) ->>>>>>> f2a8ff9c85ab744b6d70d0d47df094f2a870d34a } diff --git a/src/implement/happy_orchard_seed_record_db.go b/src/implement/happy_orchard_seed_record_db.go deleted file mode 100644 index b50f450..0000000 --- a/src/implement/happy_orchard_seed_record_db.go +++ /dev/null @@ -1,36 +0,0 @@ -package implement - -import ( - "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" - "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" - zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" - "xorm.io/xorm" -) - -type HappyOrchardUserSeedRecordDb struct { - Db *xorm.Engine -} - -func (h HappyOrchardUserSeedRecordDb) GetHappyOrchardUserSeedRecord(id int) (m *models.HappyOrchardUserSeedRecord, err error) { - m = new(models.HappyOrchardUserSeedRecord) - has, err := h.Db.Where("id =?", id).Get(m) - if err != nil { - return nil, zhios_order_relate_logx.Error(err) - } - if has == false { - return nil, nil - } - return m, nil -} - -func (h HappyOrchardUserSeedRecordDb) FindHappyOrchardUserSeedRecordsByUid(uid int) (mm *[]models.HappyOrchardUserSeedRecord, err error) { - var m []models.HappyOrchardUserSeedRecord - if err := h.Db.Where("uid =?", uid).Desc("id").Find(&m); err != nil { - return nil, zhios_order_relate_logx.Error(err) - } - return &m, nil -} - -func NewHappyOrchardUserSeedRecordDb(engine *xorm.Engine) dao.HappyOrchardUserSeedRecordDao { - return &HappyOrchardUserSeedRecordDb{Db: engine} -} diff --git a/src/models/happy_orchard_seed_record.go b/src/models/happy_orchard_seed_record.go deleted file mode 100644 index b662393..0000000 --- a/src/models/happy_orchard_seed_record.go +++ /dev/null @@ -1,11 +0,0 @@ -package models - -type HappyOrchardUserSeedRecord struct { - Id int `json:"id" xorm:"not null pk autoincr INT(11)"` - Uid int `json:"uid" xorm:"INT(11)"` - SeedId int `json:"seed_id" xorm:"not null default 0 INT(11)"` - WaterNums int `json:"water_nums" xorm:"not null default 0 comment('当前获得水滴数') INT(11)"` - State int `json:"state" xorm:"not null default 1 comment('状态(1:种植中 2:待领取 3:已领取)') 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"` -} diff --git a/src/models/happy_orchard_user_seed_record.go b/src/models/happy_orchard_user_seed_record.go index b9916ac..efa60dc 100644 --- a/src/models/happy_orchard_user_seed_record.go +++ b/src/models/happy_orchard_user_seed_record.go @@ -1,15 +1,11 @@ package models -import ( - "time" -) - type HappyOrchardUserSeedRecord struct { - Id int `json:"id" xorm:"not null pk autoincr INT(11)"` - Uid int `json:"uid" xorm:"INT(11)"` - SeedId int `json:"seed_id" xorm:"not null default 0 INT(11)"` - WaterNums int `json:"water_nums" xorm:"not null default 0 comment('当前获得水滴数') INT(11)"` - State int `json:"state" xorm:"not null default 1 comment('状态(1:种植中 2:待领取 3:已领取)') INT(11)"` - CreateAt time.Time `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') DATETIME"` - UpdateAt time.Time `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP comment('更新时间') DATETIME"` + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + Uid int `json:"uid" xorm:"INT(11)"` + SeedId int `json:"seed_id" xorm:"not null default 0 INT(11)"` + WaterNums int `json:"water_nums" xorm:"not null default 0 comment('当前获得水滴数') INT(11)"` + State int `json:"state" xorm:"not null default 1 comment('状态(1:种植中 2:待领取 3:已领取)') 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"` }