Ver código fonte

更新

master
huangjiajun 3 meses atrás
pai
commit
d672920743
6 arquivos alterados com 124 adições e 0 exclusões
  1. +7
    -0
      src/super/dao/agent_financial_dynamics_dao.go
  2. +7
    -0
      src/super/dao/medium_financial_dynamics_dao.go
  3. +36
    -0
      src/super/implement/agent_financial_dynamics_implement.go
  4. +36
    -0
      src/super/implement/medium_financial_dynamics_implement.go
  5. +19
    -0
      src/super/model/agent_financial_dynamics.go
  6. +19
    -0
      src/super/model/medium_financial_dynamics.go

+ 7
- 0
src/super/dao/agent_financial_dynamics_dao.go Ver arquivo

@@ -0,0 +1,7 @@
package dao

import "code.fnuoos.com/zhimeng/model.git/src/super/model"

type AgentFinancialDynamicsDao interface {
FindAgentFinancialDynamics(uuid, agentId, startTime, endTime string, page, limit int) (list []model.AgentFinancialDynamics, total int64, err error)
}

+ 7
- 0
src/super/dao/medium_financial_dynamics_dao.go Ver arquivo

@@ -0,0 +1,7 @@
package dao

import "code.fnuoos.com/zhimeng/model.git/src/super/model"

type MediumFinancialDynamicsDao interface {
FindMediumFinancialDynamics(uuid, mediumId, startTime, endTime string, page, limit int) (list []model.MediumFinancialDynamics, total int64, err error)
}

+ 36
- 0
src/super/implement/agent_financial_dynamics_implement.go Ver arquivo

@@ -0,0 +1,36 @@
package implement

import (
"code.fnuoos.com/zhimeng/model.git/src/super/dao"
"code.fnuoos.com/zhimeng/model.git/src/super/model"
"xorm.io/xorm"
)

func NewAgentFinancialDynamicsDb(engine *xorm.Engine) dao.AgentFinancialDynamicsDao {
return &AgentFinancialDynamicsDb{Db: engine}
}

type AgentFinancialDynamicsDb struct {
Db *xorm.Engine
}

func (m AgentFinancialDynamicsDb) FindAgentFinancialDynamics(uuid, agentId, startTime, endTime string, page, limit int) (list []model.AgentFinancialDynamics, total int64, err error) {
sess := m.Db.Desc("id").Limit(limit, (page-1)*limit)
if uuid != "" {
sess.And("uuid = ?", uuid)
}
if agentId != "" {
sess.And("agent_id = ?", agentId)
}
if startTime != "" {
sess.And("pay_time >= ?", startTime)
}
if endTime != "" {
sess.And("pay_time <= ?", endTime)
}
total, err = sess.FindAndCount(&list)
if err != nil {
return nil, 0, err
}
return
}

+ 36
- 0
src/super/implement/medium_financial_dynamics_implement.go Ver arquivo

@@ -0,0 +1,36 @@
package implement

import (
"code.fnuoos.com/zhimeng/model.git/src/super/dao"
"code.fnuoos.com/zhimeng/model.git/src/super/model"
"xorm.io/xorm"
)

func NewMediumFinancialDynamicsDb(engine *xorm.Engine) dao.MediumFinancialDynamicsDao {
return &MediumFinancialDynamicsDb{Db: engine}
}

type MediumFinancialDynamicsDb struct {
Db *xorm.Engine
}

func (m MediumFinancialDynamicsDb) FindMediumFinancialDynamics(uuid, mediumId, startTime, endTime string, page, limit int) (list []model.MediumFinancialDynamics, total int64, err error) {
sess := m.Db.Desc("id").Limit(limit, (page-1)*limit)
if uuid != "" {
sess.And("uuid = ?", uuid)
}
if mediumId != "" {
sess.And("medium_id = ?", mediumId)
}
if startTime != "" {
sess.And("pay_time >= ?", startTime)
}
if endTime != "" {
sess.And("pay_time <= ?", endTime)
}
total, err = sess.FindAndCount(&list)
if err != nil {
return nil, 0, err
}
return
}

+ 19
- 0
src/super/model/agent_financial_dynamics.go Ver arquivo

@@ -0,0 +1,19 @@
package model

import (
"time"
)

type AgentFinancialDynamics struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Uuid int `json:"uuid" xorm:"default 0 INT(11)"`
AgentId int `json:"agent_id" xorm:"default 0 comment('代理id') INT(11)"`
PayTime time.Time `json:"pay_time" xorm:"comment('支付时间') DATETIME"`
CreateAt time.Time `json:"create_at" xorm:"DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"DATETIME"`
Amount string `json:"amount" xorm:"default 0.00 comment('支付金额') DECIMAL(20,2)"`
PayMethod int `json:"pay_method" xorm:"default 0 comment('支付方式 0对私 1对公') TINYINT(1)"`
Certificate string `json:"certificate" xorm:"comment('支付凭证') VARCHAR(255)"`
Memo string `json:"memo" xorm:"comment('备注') VARCHAR(255)"`
BusinessKind int `json:"business_kind" xorm:"not null default 1 comment('业务类型(1:广告合作)') TINYINT(1)"`
}

+ 19
- 0
src/super/model/medium_financial_dynamics.go Ver arquivo

@@ -0,0 +1,19 @@
package model

import (
"time"
)

type MediumFinancialDynamics struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Uuid int `json:"uuid" xorm:"default 0 INT(11)"`
MediumId int `json:"medium_id" xorm:"not null default 0 comment('媒体id') INT(11)"`
PayTime time.Time `json:"pay_time" xorm:"comment('支付时间') DATETIME"`
CreateAt time.Time `json:"create_at" xorm:"DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"DATETIME"`
Amount string `json:"amount" xorm:"default 0.00 comment('支付金额') DECIMAL(20,2)"`
PayMethod int `json:"pay_method" xorm:"default 0 comment('支付方式 0对私 1对公') TINYINT(1)"`
Certificate string `json:"certificate" xorm:"comment('支付凭证') VARCHAR(255)"`
Memo string `json:"memo" xorm:"comment('备注') VARCHAR(255)"`
BusinessKind int `json:"business_kind" xorm:"not null default 1 comment('业务类型(1:广告合作)') TINYINT(1)"`
}

Carregando…
Cancelar
Salvar