Browse Source

Merge remote-tracking branch 'origin/master'

master
huangjiajun 1 month ago
parent
commit
a3b242230b
9 changed files with 130 additions and 0 deletions
  1. +8
    -0
      src/dao/platform_active_data_dao.go
  2. +8
    -0
      src/dao/platform_grow_data_dao.go
  3. +8
    -0
      src/dao/platform_total_data_dao.go
  4. +26
    -0
      src/implement/platform_active_data_implement.go
  5. +25
    -0
      src/implement/platform_grow_data_implement.go
  6. +27
    -0
      src/implement/platform_total_data_implement.go
  7. +10
    -0
      src/model/platform_active_data.go
  8. +7
    -0
      src/model/platform_grow_data.go
  9. +11
    -0
      src/model/platform_total_data.go

+ 8
- 0
src/dao/platform_active_data_dao.go View File

@@ -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)
}

+ 8
- 0
src/dao/platform_grow_data_dao.go View File

@@ -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)
}

+ 8
- 0
src/dao/platform_total_data_dao.go View File

@@ -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)
}

+ 26
- 0
src/implement/platform_active_data_implement.go View File

@@ -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
}

+ 25
- 0
src/implement/platform_grow_data_implement.go View File

@@ -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
}

+ 27
- 0
src/implement/platform_total_data_implement.go View File

@@ -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
}

+ 10
- 0
src/model/platform_active_data.go View File

@@ -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)"`
}

+ 7
- 0
src/model/platform_grow_data.go View File

@@ -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)"`
}

+ 11
- 0
src/model/platform_total_data.go View File

@@ -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)"`
}

Loading…
Cancel
Save