fix
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package gmodel
|
||||
|
||||
import "context"
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
type GetStockListReq struct {
|
||||
@@ -12,7 +14,7 @@ type GetStockListReq struct {
|
||||
}
|
||||
|
||||
func (s *FsUserStockModel) GetStockList(ctx context.Context, req GetStockListReq) (resp []FsUserStock, total int64, err error) {
|
||||
db := s.db.WithContext(ctx).Model(&FsUserStock{})
|
||||
db := s.db.Debug().WithContext(ctx).Model(&FsUserStock{})
|
||||
if req.UserId > 0 {
|
||||
db = db.Where("`user_id` = ?", req.UserId)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user