|
|
@@ -0,0 +1,33 @@ |
|
|
|
package implement |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" |
|
|
|
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
|
func NewEggEnergyRecruitNewUserRewardDb(engine *xorm.Engine) dao.EggEnergyRecruitNewUserRewardDao { |
|
|
|
return &EggEnergyRecruitNewUserRewardDb{Db: engine} |
|
|
|
} |
|
|
|
|
|
|
|
type EggEnergyRecruitNewUserRewardDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func (e EggEnergyRecruitNewUserRewardDb) EggEnergyRecruitNewUserRewardGet(uid int64) (*model.EggEnergyRecruitNewUserReward, bool, error) { |
|
|
|
var m model.EggEnergyRecruitNewUserReward |
|
|
|
exist, err := e.Db.Where("uid =?", uid).Get(&m) |
|
|
|
if err != nil { |
|
|
|
return nil, false, zhios_order_relate_logx.Error(err.Error()) |
|
|
|
} |
|
|
|
return &m, exist, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (e EggEnergyRecruitNewUserRewardDb) EggEnergyRecruitNewUserRewardInsert(eggEnergyRecruitNewUserReward *model.EggEnergyRecruitNewUserReward) (int64, error) { |
|
|
|
_, err := e.Db.InsertOne(eggEnergyRecruitNewUserReward) |
|
|
|
if err != nil { |
|
|
|
return 0, zhios_order_relate_logx.Error(err.Error()) |
|
|
|
} |
|
|
|
return eggEnergyRecruitNewUserReward.Id, nil |
|
|
|
} |