|
|
@@ -0,0 +1,60 @@ |
|
|
|
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" |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
|
type happyOrchardUserSeedRecordDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func NewHappyOrchardUserSeedRecordDb(engine *xorm.Engine) dao.HappyOrchardUserSeedRecordDao { |
|
|
|
return &happyOrchardUserSeedRecordDb{Db: engine} |
|
|
|
} |
|
|
|
|
|
|
|
func (h happyOrchardUserSeedRecordDb) GetHappyOrchardUserSeedRecord(id int) (m *models.HappyOrchardUserSeedRecord, err error) { |
|
|
|
//TODO implement me |
|
|
|
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) FindHappyOrchardUserSeedRecordByUid(uid int) (mm *[]models.HappyOrchardUserSeedRecord, err error) { |
|
|
|
//TODO implement me |
|
|
|
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 (h happyOrchardUserSeedRecordDb) GetHappyOrchardUserSeedRecordByUidWithState(uid, state int) (m *models.HappyOrchardUserSeedRecord, err error) { |
|
|
|
m = new(models.HappyOrchardUserSeedRecord) |
|
|
|
has, err := h.Db.Where("uid =? and state=?", uid, state).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) GetHappyOrchardUserSeedRecordByUidWithStateAndId(uid, id, state int) (m *models.HappyOrchardUserSeedRecord, err error) { |
|
|
|
m = new(models.HappyOrchardUserSeedRecord) |
|
|
|
has, err := h.Db.Where("uid =? and state=? and id=?", uid, state, id).Get(m) |
|
|
|
if err != nil { |
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
if has == false { |
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
return m, nil |
|
|
|
} |