@@ -1,5 +1,9 @@ | |||||
package dao | package dao | ||||
import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | |||||
type EggEnergyUserActivityDao interface { | type EggEnergyUserActivityDao interface { | ||||
//TODO:: You can add specific method definitions here | //TODO:: You can add specific method definitions here | ||||
EggEnergyUserActivityGetOneByTimeAndUserID(userID int64, date string) (*model.EggEnergyUserActivity, error) | |||||
EggEnergyUserActivityInsert(m *model.EggEnergyUserActivity) (int64, error) | |||||
} | } |
@@ -8,4 +8,5 @@ type EggSignInDao interface { | |||||
EggSignInFindByParams(params map[string]interface{}) ([]*model.EggSignIn, error) | EggSignInFindByParams(params map[string]interface{}) ([]*model.EggSignIn, error) | ||||
EggSignINGetOneByTimeAndUid(startAt, endAt string, uid int64, isCompleted int) (bool, *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) | EggSignInFindByTimeAndParams(startAt, endAt string, isCompleted int, params map[string]interface{}) ([]*model.EggSignIn, error) | ||||
EggSignInInsert(m *model.EggSignIn) (int64, error) | |||||
} | } |
@@ -2,6 +2,7 @@ | |||||
import ( | import ( | ||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao" | "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" | ||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -12,3 +13,23 @@ func NewEggEnergyUserActivityDb(engine *xorm.Engine) dao.EggEnergyUserActivityDa | |||||
type EggEnergyUserActivityDb struct { | type EggEnergyUserActivityDb struct { | ||||
Db *xorm.Engine | 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 | |||||
} |
@@ -87,3 +87,11 @@ func (e EggSignInDb) EggSignInFindByTimeAndParams(startAt, endAt string, isCompl | |||||
} | } | ||||
return m, nil | 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 | |||||
} |
@@ -4,7 +4,7 @@ type PlatformTotalData struct { | |||||
Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` | Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` | ||||
TotalUserCount int `json:"total_user_count" xorm:"not null comment('平台总用户数') INT(11)"` | TotalUserCount int `json:"total_user_count" xorm:"not null comment('平台总用户数') INT(11)"` | ||||
VerifiedUserCount int `json:"verified_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)"` | TotalWithdrawAmount string `json:"total_withdraw_amount" xorm:"not null comment('已提现累计金额') DECIMAL(10,2)"` | ||||
Year string `json:"year" xorm:"not null comment('年份') CHAR(50)"` | Year string `json:"year" xorm:"not null comment('年份') CHAR(50)"` | ||||
Month string `json:"month" xorm:"not null comment('月份') CHAR(50)"` | Month string `json:"month" xorm:"not null comment('月份') CHAR(50)"` | ||||