Documentation ¶
Index ¶
- Constants
- Variables
- func GetTaskDuration(date time.Time, taskType int8) (startDate, endDate time.Time)
- func GetTaskExpireLimit(today time.Time, taskType int8) (minDate, maxDate time.Time)
- type Dao
- func (d *Dao) CheckUpHasValidContract(mid int64, date time.Time) (exist bool, err error)
- func (d *Dao) Close()
- 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) 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) GetDueTask(now time.Time) (result []*TaskWithAdmin, err error)
- func (d *Dao) GetPay(signID []uint32) (result []signmodel.SignPay, 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) InsertContractInfo(info interface{}) (affectedRow int64, err error)
- func (d *Dao) InsertPayInfo(info *signmodel.SignPay) (affectedRow int64, err error)
- func (d *Dao) InsertSignUp(up *signmodel.SignUp) (affectedRow int64, err error)
- func (d *Dao) InsertTaskInfo(info *signmodel.SignTask) (affectedRow int64, err error)
- func (d *Dao) PayComplete(ids []uint32) (affectedRow int64, err error)
- func (d *Dao) Ping(c context.Context) (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) SetHTTPClient(client *bm.Client)
- func (d *Dao) StartTask(taskType int, now time.Time) (affectedRow int64, err error)
- func (d *Dao) UpdateEmailState(table string, ids []uint32, state int8) (affectedRow int64, err error)
- type PayWithAdmin
- type SignWithName
- type TaskWithAdmin
Constants ¶
const ( //PayStateUnpay not pay PayStateUnpay = 0 //PayStatePayed payed PayStatePayed = 1 )
Variables ¶
var days
var ( //NeedCheckTaskType task type NeedCheckTaskType = []int8{ signmodel.TaskTypeWeek, signmodel.TaskTypeMonth, signmodel.TaskTypeQuarter, } )
Functions ¶
func GetTaskDuration ¶
GetTaskDuration this will return task duration, [startDate, endDate)
Types ¶
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
Dao upcrm dao
func (*Dao) CheckUpHasValidContract ¶
CheckUpHasValidContract check if has valid contract
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) GetDueSignUp ¶
GetDueSignUp check due expireAfterDays : how many days to expire
func (*Dao) GetDueTask ¶
func (d *Dao) GetDueTask(now time.Time) (result []*TaskWithAdmin, err error)
GetDueTask get due tasks
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) InsertContractInfo ¶
InsertContractInfo insert contract
func (*Dao) InsertPayInfo ¶
InsertPayInfo inert pay
func (*Dao) InsertSignUp ¶
InsertSignUp insert sign up up : sign up
func (*Dao) InsertTaskInfo ¶
InsertTaskInfo insert task
func (*Dao) PayComplete ¶
PayComplete finish pay by pay id
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) SetHTTPClient ¶
SetHTTPClient set http client
type PayWithAdmin ¶
PayWithAdmin pay with name, used to send mail
func (*PayWithAdmin) GetEndDate ¶
func (s *PayWithAdmin) GetEndDate() string
GetEndDate used for template
func (*PayWithAdmin) GetPayValue ¶
func (s *PayWithAdmin) GetPayValue() float64
GetPayValue for template
type SignWithName ¶
SignWithName sign with name, used to send mail
func (*SignWithName) GetEndDate ¶
func (s *SignWithName) GetEndDate() string
GetEndDate used for template
type TaskWithAdmin ¶
type TaskWithAdmin struct { signmodel.SignTaskHistory Name string AdminID int AdminName string }
TaskWithAdmin task with admin
func (*TaskWithAdmin) EndDate ¶
func (s *TaskWithAdmin) EndDate() xtime.Time
EndDate used for template