shenjiachi преди 2 седмици
родител
ревизия
7c08a68773
променени са 14 файла, в които са добавени 111 реда и са изтрити 0 реда
  1. +1
    -0
      src/dao/egg_energy_user_activity_dao.go
  2. +2
    -0
      src/dao/platform_active_data_dao.go
  3. +3
    -0
      src/dao/platform_grow_data_dao.go
  4. +2
    -0
      src/dao/platform_total_data_dao.go
  5. +1
    -0
      src/dao/user_certificate_dao.go
  6. +1
    -0
      src/dao/user_dao.go
  7. +2
    -0
      src/dao/user_wallet_flow_dao.go
  8. +9
    -0
      src/implement/egg_energy_user_activity_implement.go
  9. +16
    -0
      src/implement/platform_active_data_implement.go
  10. +26
    -0
      src/implement/platform_grow_data_implement.go
  11. +16
    -0
      src/implement/platform_total_data_implement.go
  12. +8
    -0
      src/implement/user_certificate_implement.go
  13. +8
    -0
      src/implement/user_implement.go
  14. +16
    -0
      src/implement/user_wallet_flow_implement.go

+ 1
- 0
src/dao/egg_energy_user_activity_dao.go Целия файл

@@ -6,4 +6,5 @@ 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)
EggEnergyUserActivityCountByDate(startAt, endAt string) (int64, error)
}

+ 2
- 0
src/dao/platform_active_data_dao.go Целия файл

@@ -5,4 +5,6 @@ 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)
PlatformActiveDataInsert(m *model.PlatformActiveData) (int64, error)
PlatformActiveDataUpdate(m *model.PlatformActiveData, columns ...string) (int64, error)
}

+ 3
- 0
src/dao/platform_grow_data_dao.go Целия файл

@@ -5,4 +5,7 @@ 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)
PlatformGrowDataInsert(m *model.PlatformGrowData) (int64, error)
PlatformGrowDataUpdate(m *model.PlatformGrowData, columns ...string) (int64, error)
PlatformGrowDataGetOneByParams(params map[string]interface{}) (*model.PlatformGrowData, error)
}

+ 2
- 0
src/dao/platform_total_data_dao.go Целия файл

@@ -5,4 +5,6 @@ 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)
PlatformTotalDataInsert(m *model.PlatformTotalData) (int64, error)
PlatformTotalDataUpdate(m *model.PlatformTotalData, columns ...string) (int64, error)
}

+ 1
- 0
src/dao/user_certificate_dao.go Целия файл

@@ -6,4 +6,5 @@ type UserCertificateDao interface {
FindUserCertificate(page, limit, uid string) (*[]model.UserCertificate, int64, error)
GetUserCertificateByNo(no string) (*model.UserCertificate, error)
GetUserCertificateById(id string) (*model.UserCertificate, error)
UserCertificateCountByDate(startAt, endAt string) (int64, error)
}

+ 1
- 0
src/dao/user_dao.go Целия файл

@@ -20,4 +20,5 @@ type UserDao interface {
UserCount() (int64, error)
UserFindNotInByParamsByPage(page int, limit int, params map[string]interface{}) ([]model.User, int64, error)
UserExistByParams(params map[string]interface{}) (bool, error)
UserCountByDate(startAt, endAt string) (int64, error)
}

+ 2
- 0
src/dao/user_wallet_flow_dao.go Целия файл

@@ -9,4 +9,6 @@ type UserWalletFlowDao interface {
UserWalletFlowInsertBySession(session *xorm.Session, userWalletFlow *model.UserWalletFlow) (int64, error)
UserWalletFlowFindByParams(params map[string]interface{}, page, limit int) (*[]model.UserWalletFlow, int64, error)
UserWalletFlowFindByCoinAndUser(page, pageSize int, uid int64, startAt string, endAt string, direction int, isAsc bool, kind int, state int) ([]model.UserWalletFlow, int64, error)
UserWalletFlowGetSum(startAt, endAt string, kind int) (float64, error)
UserWalletFlowUserCount(startAt, endAt string, kind int) (int64, error)
}

+ 9
- 0
src/implement/egg_energy_user_activity_implement.go Целия файл

@@ -3,6 +3,7 @@
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"
)

@@ -33,3 +34,11 @@ func (e EggEnergyUserActivityDb) EggEnergyUserActivityInsert(m *model.EggEnergyU
}
return m.Id, nil
}

func (e EggEnergyUserActivityDb) EggEnergyUserActivityCountByDate(startAt, endAt string) (int64, error) {
count, err := e.Db.Distinct("uid").Where("date >= ?", startAt).And("date =< ?", endAt).Count(&model.EggEnergyUserActivity{})
if err != nil {
return 0, zhios_order_relate_logx.Error(err)
}
return count, nil
}

+ 16
- 0
src/implement/platform_active_data_implement.go Целия файл

@@ -24,3 +24,19 @@ func (p PlatformActiveDataDb) PlatformActiveDataGetOneByParams(params map[string
}
return &m, nil
}

func (p PlatformActiveDataDb) PlatformActiveDataInsert(m *model.PlatformActiveData) (int64, error) {
_, err := p.Db.InsertOne(m)
if err != nil {
return 0, err
}
return m.Id, nil
}

func (p PlatformActiveDataDb) PlatformActiveDataUpdate(m *model.PlatformActiveData, columns ...string) (int64, error) {
affected, err := p.Db.Where("id =?", m.Id).Cols(columns...).Update(m)
if err != nil {
return 0, err
}
return affected, nil
}

+ 26
- 0
src/implement/platform_grow_data_implement.go Целия файл

@@ -4,6 +4,7 @@ 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"
)

@@ -23,3 +24,28 @@ func (p PlatformGrowDataDb) PlatformGrowDataGetLastOne() (*model.PlatformGrowDat
}
return &m, exist, nil
}

func (p PlatformGrowDataDb) PlatformGrowDataInsert(m *model.PlatformGrowData) (int64, error) {
_, err := p.Db.InsertOne(m)
if err != nil {
return 0, err
}
return m.Id, nil
}

func (p PlatformGrowDataDb) PlatformGrowDataUpdate(m *model.PlatformGrowData, columns ...string) (int64, error) {
affected, err := p.Db.Where("id =?", m.Id).Cols(columns...).Update(m)
if err != nil {
return 0, err
}
return affected, nil
}

func (p PlatformGrowDataDb) PlatformGrowDataGetOneByParams(params map[string]interface{}) (*model.PlatformGrowData, error) {
var m model.PlatformGrowData
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
}

+ 16
- 0
src/implement/platform_total_data_implement.go Целия файл

@@ -25,3 +25,19 @@ func (p PlatformTotalDataDb) PlatformTotalDataGetOneByTime(year string, month st
}
return &m, nil
}

func (p PlatformTotalDataDb) PlatformTotalDataInsert(m *model.PlatformTotalData) (int64, error) {
_, err := p.Db.InsertOne(m)
if err != nil {
return 0, err
}
return m.Id, nil
}

func (p PlatformTotalDataDb) PlatformTotalDataUpdate(m *model.PlatformTotalData, columns ...string) (int64, error) {
affected, err := p.Db.Where("id =?", m.Id).Cols(columns...).Update(m)
if err != nil {
return 0, err
}
return affected, nil
}

+ 8
- 0
src/implement/user_certificate_implement.go Целия файл

@@ -53,3 +53,11 @@ func (u UserCertificateDb) GetUserCertificateById(id string) (m *model.UserCerti
}
return m, nil
}

func (u UserCertificateDb) UserCertificateCountByDate(startAt, endAt string) (int64, error) {
count, err := u.Db.Where("start_time >= ?", startAt).And("start_time =< ?", endAt).Count(&model.UserCertificate{})
if err != nil {
return 0, zhios_order_relate_logx.Error(err)
}
return count, nil
}

+ 8
- 0
src/implement/user_implement.go Целия файл

@@ -186,3 +186,11 @@ func (u UserDb) UserExistByParams(params map[string]interface{}) (bool, error) {
}
return has, nil
}

func (u UserDb) UserCountByDate(startAt, endAt string) (int64, error) {
count, err := u.Db.Where("create_at >= ?", startAt).And("create_at =< ?", endAt).Count(&model.User{})
if err != nil {
return 0, zhios_order_relate_logx.Error(err)
}
return count, nil
}

+ 16
- 0
src/implement/user_wallet_flow_implement.go Целия файл

@@ -77,3 +77,19 @@ func (u UserWalletFlowDb) UserWalletFlowFindByCoinAndUser(page, pageSize int, ui

return m, total, nil
}

func (u UserWalletFlowDb) UserWalletFlowGetSum(startAt, endAt string, kind int) (float64, error) {
sum, err := u.Db.Where("create_at >= ?", startAt).And("create_at <= ?", endAt).And("kind = ?", kind).Sum(&model.UserWalletFlow{}, "amount")
if err != nil {
return 0, zhios_order_relate_logx.Error(err)
}
return sum, nil
}

func (u UserWalletFlowDb) UserWalletFlowUserCount(startAt, endAt string, kind int) (int64, error) {
count, err := u.Db.Where("create_at >= ?", startAt).And("create_at <= ?", endAt).And("kind = ?", kind).Count(&model.UserWalletFlow{})
if err != nil {
return 0, zhios_order_relate_logx.Error(err)
}
return count, nil
}

Зареждане…
Отказ
Запис