upcrm

package
v0.0.0-...-83adff0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//ScoreTypeQuality 质量分
	ScoreTypeQuality = 1
	//ScoreTypePr 影响力
	ScoreTypePr = 2
	//ScoreTypeCredit 信用分
	ScoreTypeCredit = 3

	//ScoreSectionTableName table name
	ScoreSectionTableName = "score_section_history"
)
View Source
const (
	// PayStateUnpay not pay
	PayStateUnpay = 0
	// PayStatePayed payed
	PayStatePayed = 1
)
View Source
const (

	//ISO8601DATE only date format
	ISO8601DATE = "2006-01-02"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreditLogHTTPResult

type CreditLogHTTPResult struct {
	Code int     `json:"code"`
	Data LogList `json:"data"`
	Msg  string  `json:"message"`
}

CreditLogHTTPResult it's log result from http server

type Dao

type Dao struct {
	// contains filtered or unexported fields
}

Dao upcrm dao

func New

func New(c *conf.Config) *Dao

New new dao

func (*Dao) BeginTran

func (d *Dao) BeginTran(c context.Context) (tx *gorm.DB)

BeginTran begin transcation.

func (*Dao) CheckUpHasValidContract

func (d *Dao) CheckUpHasValidContract(mid int64, date time.Time) (exist bool, err error)

CheckUpHasValidContract check if has valid contract

func (*Dao) DelPayInfo

func (d *Dao) DelPayInfo(db *gorm.DB, ids []int64) (affectedRow int64, err error)

DelPayInfo update payinfo

func (*Dao) DelSignContract

func (d *Dao) DelSignContract(db *gorm.DB, ids []int64) (affectedRow int64, err error)

DelSignContract update signcontract

func (*Dao) DelTaskInfo

func (d *Dao) DelTaskInfo(db *gorm.DB, ids []int64) (affectedRow int64, err error)

DelTaskInfo update taskInfo

func (*Dao) FinishTask

func (d *Dao) FinishTask(taskType int, now time.Time, state int) (affectedRow int64, err error)

FinishTask finish task

func (*Dao) GetContract

func (d *Dao) GetContract(signID []uint32) (result []signmodel.SignContract, err error)

GetContract get get sign id

func (*Dao) GetCreditLog

func (d *Dao) GetCreditLog(mid int64, limit int) (result []upcrmmodel.SimpleCreditLogWithContent, err error)

GetCreditLog get credit log from upcredit server

func (*Dao) GetDb

func (d *Dao) GetDb() *gorm.DB

GetDb get current gorm db

func (*Dao) GetDuePay

func (d *Dao) GetDuePay(now time.Time, expireAfterDays int) (result []*PayWithAdmin, err error)

GetDuePay check due

func (*Dao) GetDueSignUp

func (d *Dao) GetDueSignUp(now time.Time, expireAfterDays int) (result []*SignWithName, err error)

GetDueSignUp check due expireAfterDays : how many days to expire

func (*Dao) GetLastHistory

func (d *Dao) GetLastHistory(scoreType int) (lastHistoryDate time.Time, err error)

GetLastHistory get last update date

func (*Dao) GetLatestUpScoreDate

func (d *Dao) GetLatestUpScoreDate(mid int64, scoreType int, todate time.Time) (date time.Time, err error)

GetLatestUpScoreDate 获取某个分数的最新记录日期,如果出错,就返回todate

func (*Dao) GetOrCreateTaskHistory

func (d *Dao) GetOrCreateTaskHistory(db *gorm.DB, st *signmodel.SignTask) (sth *signmodel.SignTaskHistory, init bool, err error)

GetOrCreateTaskHistory .

func (*Dao) GetPay

func (d *Dao) GetPay(signID []uint32) (result []signmodel.SignPay, err error)

GetPay get get sign id

func (*Dao) GetSignIDByCondition

func (d *Dao) GetSignIDByCondition(arg *signmodel.SignQueryArg) (signIDs []uint32, err error)

GetSignIDByCondition get sign id arg query args

func (*Dao) GetSignUpByID

func (d *Dao) GetSignUpByID(signID []uint32, order string, offset int, limit int, query interface{}, args ...interface{}) (result []signmodel.SignUp, err error)

GetSignUpByID signid 可以是nil,如果是nil,则会取所有的信息 query, args, 额外的查询条件

func (*Dao) GetSignUpCount

func (d *Dao) GetSignUpCount(query string, args ...interface{}) (count int)

GetSignUpCount get sign up's count

func (*Dao) GetTask

func (d *Dao) GetTask(signID []uint32, state ...int) (result []signmodel.SignTask, err error)

GetTask get task by sign id and state

func (*Dao) GetUpRankLatestDate

func (d *Dao) GetUpRankLatestDate() (date time.Time, err error)

GetUpRankLatestDate get last generate date

func (*Dao) GetUpStatLastDate

func (d *Dao) GetUpStatLastDate(date time.Time) (lastday time.Time, err error)

GetUpStatLastDate get last update date from db

func (*Dao) InsertContractInfo

func (d *Dao) InsertContractInfo(db *gorm.DB, info interface{}) (affectedRow int64, err error)

InsertContractInfo insert contract

func (*Dao) InsertPayInfo

func (d *Dao) InsertPayInfo(db *gorm.DB, info *signmodel.SignPay) (affectedRow int64, err error)

InsertPayInfo inert pay

func (*Dao) InsertSignUp

func (d *Dao) InsertSignUp(db *gorm.DB, up *signmodel.SignUp) (affectedRow int64, err error)

InsertSignUp insert sign up

func (*Dao) InsertTaskInfo

func (d *Dao) InsertTaskInfo(db *gorm.DB, info *signmodel.SignTask) (affectedRow int64, err error)

InsertTaskInfo insert task

func (*Dao) PayComplete

func (d *Dao) PayComplete(ids []int64) (affectedRow int64, err error)

PayComplete finish pay by pay id

func (*Dao) QueryDetail

func (d *Dao) QueryDetail(startDate time.Time, endDate time.Time) (res []*upcrmmodel.UpStatsHistory, err error)

QueryDetail query db

func (*Dao) QueryPlayInfo

func (d *Dao) QueryPlayInfo(mid int64, busiType []int) (result []upcrmmodel.UpPlayInfo, err error)

QueryPlayInfo query db

func (*Dao) QueryPlayInfoBatch

func (d *Dao) QueryPlayInfoBatch(mid []int64, busiType int) (result []*upcrmmodel.UpPlayInfo, err error)

QueryPlayInfoBatch query db

func (*Dao) QueryTrend

func (d *Dao) QueryTrend(statType int, currentDate time.Time, days int) (res []*upcrmmodel.UpStatsHistory, err error)

QueryTrend query db

func (*Dao) QueryUpBaseInfo

func (d *Dao) QueryUpBaseInfo(mid int64, fields string) (result upcrmmodel.UpBaseInfo, err error)

QueryUpBaseInfo query db

func (*Dao) QueryUpBaseInfoBatchByID

func (d *Dao) QueryUpBaseInfoBatchByID(fields string, id ...int64) (result []upcrmmodel.UpBaseInfo, err error)

QueryUpBaseInfoBatchByID query db

func (*Dao) QueryUpBaseInfoBatchByMid

func (d *Dao) QueryUpBaseInfoBatchByMid(fields string, mid ...int64) (result []upcrmmodel.UpBaseInfo, err error)

QueryUpBaseInfoBatchByMid query db

func (*Dao) QueryUpRank

func (d *Dao) QueryUpRank(rankType int, date time.Time) (result []upcrmmodel.UpRank, err error)

QueryUpRank query up rank

func (*Dao) QueryUpRankAll

func (d *Dao) QueryUpRankAll(date time.Time) (result []upcrmmodel.UpRank, err error)

QueryUpRankAll query up rank all

func (*Dao) QueryUpScoreHistory

func (d *Dao) QueryUpScoreHistory(mid int64, scoreType []int, fromdate time.Time, todate time.Time) (result []upcrmmodel.UpScoreHistory, err error)

QueryUpScoreHistory score type, 1质量分,2影响分,3信用分,

0表示所有

func (*Dao) QueryYesterday

func (d *Dao) QueryYesterday(date time.Time) (res []*upcrmmodel.UpStatsHistory, err error)

QueryYesterday query yesterday db

func (*Dao) ScoreQueryHistory

func (d *Dao) ScoreQueryHistory(scoreType int, date time.Time) (result upcrmmodel.ScoreSectionHistory, err error)

ScoreQueryHistory get history

func (*Dao) SetHTTPClient

func (d *Dao) SetHTTPClient(client *bm.Client)

SetHTTPClient set http client

func (*Dao) SignUpID

func (d *Dao) SignUpID(sigID int64) (su *signmodel.SignUp, msp map[int64]*signmodel.SignPay, mst map[int64]*signmodel.SignTask, msc map[int64]*signmodel.SignContract, err error)

SignUpID .

func (*Dao) StartTask

func (d *Dao) StartTask(taskType int, now time.Time) (affectedRow int64, err error)

StartTask start task

func (*Dao) UpSignTaskHistory

func (d *Dao) UpSignTaskHistory(db *gorm.DB, sth *signmodel.SignTaskHistory) (err error)

UpSignTaskHistory .

func (*Dao) UpdateEmailState

func (d *Dao) UpdateEmailState(table string, ids []int64, state int8) (affectedRow int64, err error)

UpdateEmailState update email send state state : @

type LogList

type LogList struct {
	LogList []upcrmmodel.SimpleCreditLogWithContent `json:"log_list"`
}

LogList it's log list

type PayWithAdmin

type PayWithAdmin struct {
	signmodel.SignPay
	Name      string
	AdminID   int
	AdminName string
}

PayWithAdmin pay with name, used to send mail

type SignWithName

type SignWithName struct {
	signmodel.SignUp
	Name string
}

SignWithName sign with name, used to send mail

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL