26 lines
476 B
Go
26 lines
476 B
Go
package service
|
|
|
|
import (
|
|
"f5"
|
|
"main/model"
|
|
"main/constant"
|
|
)
|
|
|
|
type chip struct {
|
|
|
|
}
|
|
|
|
func (this *chip) init() {
|
|
}
|
|
|
|
func (this *chip) unInit() {
|
|
}
|
|
|
|
func (this *chip) List(accountId string) (error, []model.Chip) {
|
|
nowTime := f5.GetApp().GetRealSeconds()
|
|
chips := []model.Chip{}
|
|
result := f5.GetApp().GetOrmDb(constant.WHEEL_DB).Table(new(model.Chip).TableName()).Where(
|
|
"account_id = ? AND expiretime < ?", accountId, nowTime).Find(chips)
|
|
return result.Error, chips
|
|
}
|