This commit is contained in:
aozhiwei 2024-11-13 11:32:18 +08:00
parent a413a2494c
commit 74bab3600c
2 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ func (this *ChipApi) List(c *gin.Context) {
}{}
for _, m := range chips {
v := new(vo.Chip)
v.FromModel(m)
v.FromModel(&m)
q5.AppendSlice(&rspObj.Data, v)
}
c.JSON(200, rspObj)

View File

@ -16,10 +16,10 @@ func (this *chip) init() {
func (this *chip) unInit() {
}
func (this *chip) List(accountId string) (error, []*model.Chip) {
func (this *chip) List(accountId string) (error, []model.Chip) {
nowTime := f5.GetApp().GetRealSeconds()
chips := []*model.Chip{}
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, []*model.Chip{}
return result.Error, chips
}