diff --git a/src/dao/egg_energy_user_activity_dao.go b/src/dao/egg_energy_user_activity_dao.go index fb91141..9794f42 100644 --- a/src/dao/egg_energy_user_activity_dao.go +++ b/src/dao/egg_energy_user_activity_dao.go @@ -1,5 +1,9 @@ package dao +import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + type EggEnergyUserActivityDao interface { //TODO:: You can add specific method definitions here + EggEnergyUserActivityGetOneByTimeAndUserID(userID int64, date string) (*model.EggEnergyUserActivity, error) + EggEnergyUserActivityInsert(m *model.EggEnergyUserActivity) (int64, error) } diff --git a/src/dao/egg_sign_in_dao.go b/src/dao/egg_sign_in_dao.go index 41c6619..8057842 100644 --- a/src/dao/egg_sign_in_dao.go +++ b/src/dao/egg_sign_in_dao.go @@ -8,4 +8,5 @@ type EggSignInDao interface { EggSignInFindByParams(params map[string]interface{}) ([]*model.EggSignIn, error) EggSignINGetOneByTimeAndUid(startAt, endAt string, uid int64, isCompleted int) (bool, *model.EggSignIn, error) EggSignInFindByTimeAndParams(startAt, endAt string, isCompleted int, params map[string]interface{}) ([]*model.EggSignIn, error) + EggSignInInsert(m *model.EggSignIn) (int64, error) } diff --git a/src/implement/egg_energy_user_activity_implement.go b/src/implement/egg_energy_user_activity_implement.go index 92dbee8..b4f34e6 100644 --- a/src/implement/egg_energy_user_activity_implement.go +++ b/src/implement/egg_energy_user_activity_implement.go @@ -2,6 +2,7 @@ import ( "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" + "code.fnuoos.com/EggPlanet/egg_models.git/src/model" "xorm.io/xorm" ) @@ -12,3 +13,23 @@ func NewEggEnergyUserActivityDb(engine *xorm.Engine) dao.EggEnergyUserActivityDa type EggEnergyUserActivityDb struct { Db *xorm.Engine } + +func (e EggEnergyUserActivityDb) EggEnergyUserActivityGetOneByTimeAndUserID(userID int64, date string) (*model.EggEnergyUserActivity, error) { + var m model.EggEnergyUserActivity + has, err := e.Db.Where("uid = ?", userID).And("date = ?", date).Get(&m) + if err != nil { + return nil, err + } + if !has { + return nil, nil + } + return &m, nil +} + +func (e EggEnergyUserActivityDb) EggEnergyUserActivityInsert(m *model.EggEnergyUserActivity) (int64, error) { + _, err := e.Db.InsertOne(m) + if err != nil { + return 0, err + } + return m.Id, nil +} diff --git a/src/implement/egg_sign_in_implement.go b/src/implement/egg_sign_in_implement.go index 47600db..04a334d 100644 --- a/src/implement/egg_sign_in_implement.go +++ b/src/implement/egg_sign_in_implement.go @@ -87,3 +87,11 @@ func (e EggSignInDb) EggSignInFindByTimeAndParams(startAt, endAt string, isCompl } return m, nil } + +func (e EggSignInDb) EggSignInInsert(m *model.EggSignIn) (int64, error) { + _, err := e.Db.InsertOne(m) + if err != nil { + return 0, err + } + return m.Id, nil +} diff --git a/src/model/platform_total_data.go b/src/model/platform_total_data.go index 757ffd2..e732ef6 100644 --- a/src/model/platform_total_data.go +++ b/src/model/platform_total_data.go @@ -4,7 +4,7 @@ type PlatformTotalData struct { Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` TotalUserCount int `json:"total_user_count" xorm:"not null comment('平台总用户数') INT(11)"` VerifiedUserCount int `json:"verified_user_count" xorm:"not null comment('已认证用户数') INT(11)"` - NoSiginInUserCount int `json:"no_sigin_in_user_count" xorm:"not null comment('未签到用户数') INT(11)"` + NoSignInUserCount int `json:"no_sign_in_user_count" xorm:"not null comment('未签到用户数') INT(11)"` TotalWithdrawAmount string `json:"total_withdraw_amount" xorm:"not null comment('已提现累计金额') DECIMAL(10,2)"` Year string `json:"year" xorm:"not null comment('年份') CHAR(50)"` Month string `json:"month" xorm:"not null comment('月份') CHAR(50)"`