Documentation ¶
Index ¶
- Constants
- type CreditLogHTTPResult
- type Dao
- func (d *Dao) BeginTran(c context.Context) (tx *gorm.DB)
- func (d *Dao) CheckUpHasValidContract(mid int64, date time.Time) (exist bool, err error)
- func (d *Dao) DelPayInfo(db *gorm.DB, ids []int64) (affectedRow int64, err error)
- func (d *Dao) DelSignContract(db *gorm.DB, ids []int64) (affectedRow int64, err error)
- func (d *Dao) DelTaskInfo(db *gorm.DB, ids []int64) (affectedRow int64, err error)
- func (d *Dao) FinishTask(taskType int, now time.Time, state int) (affectedRow int64, err error)
- func (d *Dao) GetContract(signID []uint32) (result []signmodel.SignContract, err error)
- func (d *Dao) GetCreditLog(mid int64, limit int) (result []upcrmmodel.SimpleCreditLogWithContent, err error)
- func (d *Dao) GetDb() *gorm.DB
- func (d *Dao) GetDuePay(now time.Time, expireAfterDays int) (result []*PayWithAdmin, err error)
- func (d *Dao) GetDueSignUp(now time.Time, expireAfterDays int) (result []*SignWithName, err error)
- func (d *Dao) GetLastHistory(scoreType int) (lastHistoryDate time.Time, err error)
- func (d *Dao) GetLatestUpScoreDate(mid int64, scoreType int, todate time.Time) (date time.Time, err error)
- func (d *Dao) GetOrCreateTaskHistory(db *gorm.DB, st *signmodel.SignTask) (sth *signmodel.SignTaskHistory, init bool, err error)
- func (d *Dao) GetPay(signID []uint32) (result []signmodel.SignPay, err error)
- func (d *Dao) GetSignIDByCondition(arg *signmodel.SignQueryArg) (signIDs []uint32, err error)
- func (d *Dao) GetSignUpByID(signID []uint32, order string, offset int, limit int, query interface{}, ...) (result []signmodel.SignUp, err error)
- func (d *Dao) GetSignUpCount(query string, args ...interface{}) (count int)
- func (d *Dao) GetTask(signID []uint32, state ...int) (result []signmodel.SignTask, err error)
- func (d *Dao) GetUpRankLatestDate() (date time.Time, err error)
- func (d *Dao) GetUpStatLastDate(date time.Time) (lastday time.Time, err error)
- func (d *Dao) InsertContractInfo(db *gorm.DB, info interface{}) (affectedRow int64, err error)
- func (d *Dao) InsertPayInfo(db *gorm.DB, info *signmodel.SignPay) (affectedRow int64, err error)
- func (d *Dao) InsertSignUp(db *gorm.DB, up *signmodel.SignUp) (affectedRow int64, err error)
- func (d *Dao) InsertTaskInfo(db *gorm.DB, info *signmodel.SignTask) (affectedRow int64, err error)
- func (d *Dao) PayComplete(ids []int64) (affectedRow int64, err error)
- func (d *Dao) QueryDetail(startDate time.Time, endDate time.Time) (res []*upcrmmodel.UpStatsHistory, err error)
- func (d *Dao) QueryPlayInfo(mid int64, busiType []int) (result []upcrmmodel.UpPlayInfo, err error)
- func (d *Dao) QueryPlayInfoBatch(mid []int64, busiType int) (result []*upcrmmodel.UpPlayInfo, err error)
- func (d *Dao) QueryTrend(statType int, currentDate time.Time, days int) (res []*upcrmmodel.UpStatsHistory, err error)
- func (d *Dao) QueryUpBaseInfo(mid int64, fields string) (result upcrmmodel.UpBaseInfo, err error)
- func (d *Dao) QueryUpBaseInfoBatchByID(fields string, id ...int64) (result []upcrmmodel.UpBaseInfo, err error)
- func (d *Dao) QueryUpBaseInfoBatchByMid(fields string, mid ...int64) (result []upcrmmodel.UpBaseInfo, err error)
- func (d *Dao) QueryUpRank(rankType int, date time.Time) (result []upcrmmodel.UpRank, err error)
- func (d *Dao) QueryUpRankAll(date time.Time) (result []upcrmmodel.UpRank, err error)
- func (d *Dao) QueryUpScoreHistory(mid int64, scoreType []int, fromdate time.Time, todate time.Time) (result []upcrmmodel.UpScoreHistory, err error)
- func (d *Dao) QueryYesterday(date time.Time) (res []*upcrmmodel.UpStatsHistory, err error)
- func (d *Dao) ScoreQueryHistory(scoreType int, date time.Time) (result upcrmmodel.ScoreSectionHistory, err error)
- func (d *Dao) SetHTTPClient(client *bm.Client)
- func (d *Dao) SignUpID(sigID int64) (su *signmodel.SignUp, msp map[int64]*signmodel.SignPay, ...)
- func (d *Dao) StartTask(taskType int, now time.Time) (affectedRow int64, err error)
- func (d *Dao) UpSignTaskHistory(db *gorm.DB, sth *signmodel.SignTaskHistory) (err error)
- func (d *Dao) UpdateEmailState(table string, ids []int64, state int8) (affectedRow int64, err error)
- type LogList
- type PayWithAdmin
- type SignWithName
Constants ¶
const ( //ScoreTypeQuality 质量分 ScoreTypeQuality = 1 //ScoreTypePr 影响力 ScoreTypePr = 2 //ScoreTypeCredit 信用分 ScoreTypeCredit = 3 //ScoreSectionTableName table name ScoreSectionTableName = "score_section_history" )
const ( // PayStateUnpay not pay PayStateUnpay = 0 // PayStatePayed payed PayStatePayed = 1 )
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 (*Dao) CheckUpHasValidContract ¶
CheckUpHasValidContract check if has valid contract
func (*Dao) DelPayInfo ¶
DelPayInfo update payinfo
func (*Dao) DelSignContract ¶
DelSignContract update signcontract
func (*Dao) DelTaskInfo ¶
DelTaskInfo update taskInfo
func (*Dao) FinishTask ¶
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) GetDueSignUp ¶
GetDueSignUp check due expireAfterDays : how many days to expire
func (*Dao) GetLastHistory ¶
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) 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 ¶
GetSignUpCount get sign up's count
func (*Dao) GetUpRankLatestDate ¶
GetUpRankLatestDate get last generate date
func (*Dao) GetUpStatLastDate ¶
GetUpStatLastDate get last update date from db
func (*Dao) InsertContractInfo ¶
InsertContractInfo insert contract
func (*Dao) InsertPayInfo ¶
InsertPayInfo inert pay
func (*Dao) InsertSignUp ¶
InsertSignUp insert sign up
func (*Dao) InsertTaskInfo ¶
InsertTaskInfo insert task
func (*Dao) PayComplete ¶
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 ¶
QueryUpRank query up rank
func (*Dao) QueryUpRankAll ¶
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 ¶
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) UpSignTaskHistory ¶
UpSignTaskHistory .
type LogList ¶
type LogList struct {
LogList []upcrmmodel.SimpleCreditLogWithContent `json:"log_list"`
}
LogList it's log list
type PayWithAdmin ¶
PayWithAdmin pay with name, used to send mail
type SignWithName ¶
SignWithName sign with name, used to send mail