@@ -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 | package dao | ||||
import ( | import ( | ||||
@@ -18,5 +9,4 @@ 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) | ||||
>>>>>>> f2a8ff9c85ab744b6d70d0d47df094f2a870d34a | |||||
} | } |
@@ -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} | |||||
} |
@@ -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"` | |||||
} |
@@ -1,15 +1,11 @@ | |||||
package models | package models | ||||
import ( | |||||
"time" | |||||
) | |||||
type HappyOrchardUserSeedRecord struct { | 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"` | |||||
} | } |