diff --git a/src/dao/platform_active_data_dao.go b/src/dao/platform_active_data_dao.go new file mode 100644 index 0000000..72301de --- /dev/null +++ b/src/dao/platform_active_data_dao.go @@ -0,0 +1,8 @@ +package dao + +import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + +type PlatformActiveDataDao interface { + //TODO:: You can add specific method definitions here + PlatformActiveDataGetOneByParams(params map[string]interface{}) (*model.PlatformActiveData, error) +} diff --git a/src/dao/platform_grow_data_dao.go b/src/dao/platform_grow_data_dao.go new file mode 100644 index 0000000..b8fd015 --- /dev/null +++ b/src/dao/platform_grow_data_dao.go @@ -0,0 +1,8 @@ +package dao + +import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + +type PlatformGrowDataDao interface { + //TODO:: You can add specific method definitions here + PlatformGrowDataGetLastOne() (*model.PlatformGrowData, bool, error) +} diff --git a/src/dao/platform_total_data_dao.go b/src/dao/platform_total_data_dao.go new file mode 100644 index 0000000..a71ff89 --- /dev/null +++ b/src/dao/platform_total_data_dao.go @@ -0,0 +1,8 @@ +package dao + +import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + +type PlatformTotalDataDao interface { + //TODO:: You can add specific method definitions here + PlatformTotalDataGetOneByTime(year string, month string) (*model.PlatformTotalData, error) +} diff --git a/src/implement/platform_active_data_implement.go b/src/implement/platform_active_data_implement.go new file mode 100644 index 0000000..1679592 --- /dev/null +++ b/src/implement/platform_active_data_implement.go @@ -0,0 +1,26 @@ +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" + "fmt" + "xorm.io/xorm" +) + +func NewPlatformActiveDataDb(engine *xorm.Engine) dao.PlatformActiveDataDao { + return &PlatformActiveDataDb{Db: engine} +} + +type PlatformActiveDataDb struct { + Db *xorm.Engine +} + +func (p PlatformActiveDataDb) PlatformActiveDataGetOneByParams(params map[string]interface{}) (*model.PlatformActiveData, error) { + var m model.PlatformActiveData + var query = fmt.Sprintf("%s = ?", params["key"]) + if has, err := p.Db.Where(query, params["value"]).Get(&m); err != nil || has == false { + return nil, zhios_order_relate_logx.Error(err) + } + return &m, nil +} diff --git a/src/implement/platform_grow_data_implement.go b/src/implement/platform_grow_data_implement.go new file mode 100644 index 0000000..e3634a8 --- /dev/null +++ b/src/implement/platform_grow_data_implement.go @@ -0,0 +1,25 @@ +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 NewPlatformGrowDataDb(engine *xorm.Engine) dao.PlatformGrowDataDao { + return &PlatformGrowDataDb{Db: engine} +} + +type PlatformGrowDataDb struct { + Db *xorm.Engine +} + +func (p PlatformGrowDataDb) PlatformGrowDataGetLastOne() (*model.PlatformGrowData, bool, error) { + var m model.PlatformGrowData + exist, err := p.Db.Desc("id").Get(&m) + if err != nil { + return nil, false, zhios_order_relate_logx.Error(err.Error()) + } + return &m, exist, nil +} diff --git a/src/implement/platform_total_data_implement.go b/src/implement/platform_total_data_implement.go new file mode 100644 index 0000000..3db6e13 --- /dev/null +++ b/src/implement/platform_total_data_implement.go @@ -0,0 +1,27 @@ +package implement + +import ( + "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" + "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + "xorm.io/xorm" +) + +func NewPlatformTotalDataDb(engine *xorm.Engine) dao.PlatformTotalDataDao { + return &PlatformTotalDataDb{Db: engine} +} + +type PlatformTotalDataDb struct { + Db *xorm.Engine +} + +func (p PlatformTotalDataDb) PlatformTotalDataGetOneByTime(year string, month string) (*model.PlatformTotalData, error) { + var m model.PlatformTotalData + get, err := p.Db.Where("year = ?", year).And("month = ?", month).Get(&m) + if err != nil { + return nil, err + } + if !get { + return nil, nil + } + return &m, nil +} diff --git a/src/model/platform_active_data.go b/src/model/platform_active_data.go new file mode 100644 index 0000000..ea2f250 --- /dev/null +++ b/src/model/platform_active_data.go @@ -0,0 +1,10 @@ +package model + +type PlatformActiveData struct { + Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` + NewUserCount int `json:"new_user_count" xorm:"not null comment('今日新增用户数') INT(11)"` + UserSignInCount int `json:"user_sign_in_count" xorm:"not null comment('今日签到用户数') INT(11)"` + WithdrawAmountCount string `json:"withdraw_amount_count" xorm:"not null comment('今日提现金额') DECIMAL(10,2)"` + WithdrawUserCount int `json:"withdraw_user_count" xorm:"not null comment('今日提现用户数') INT(11)"` + Date string `json:"date" xorm:"not null default '0000-00-00' comment('日期') CHAR(50)"` +} diff --git a/src/model/platform_grow_data.go b/src/model/platform_grow_data.go new file mode 100644 index 0000000..5ddefc2 --- /dev/null +++ b/src/model/platform_grow_data.go @@ -0,0 +1,7 @@ +package model + +type PlatformGrowData struct { + Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` + UserGrowCount int `json:"user_grow_count" xorm:"not null comment('用户增长数量') INT(11)"` + Date string `json:"date" xorm:"not null default '0000-00-00' comment('日期') CHAR(50)"` +} diff --git a/src/model/platform_total_data.go b/src/model/platform_total_data.go new file mode 100644 index 0000000..757ffd2 --- /dev/null +++ b/src/model/platform_total_data.go @@ -0,0 +1,11 @@ +package model + +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)"` + 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)"` +}