示例#1
1
func (m *Members) Load(tx *dbr.Tx, position string) error {

	var condition dbr.Condition
	if position != "" {
		condition = dbr.Eq("position", position)
	}

	return tx.Select("*").
		From("member").
		Where(condition).
		LoadStruct(m)
}
示例#2
0
func (p *UPoints) LoadTargetAccountPoints(tx *dbr.Tx, account_id int64) error {
	logrus.Debug(account_id)
	return tx.Select("*").
		From("u_point").
		Where("account_id = ?", account_id).
		LoadStruct(p)
}
示例#3
0
func (m *Member) Load(tx *dbr.Tx, number int64) error {

	return tx.Select("*").
		From("member").
		Where("number = ?", number).
		LoadStruct(m)
}
示例#4
0
func (p *UPoints) Load(tx *dbr.Tx) error {
	return tx.Select("*").
		From("u_point").
		LoadStruct(p)
}