This commit is contained in:
laodaming
2023-06-28 12:25:40 +08:00
parent 19f41f6dbc
commit 5b9a814fbb
4 changed files with 128 additions and 128 deletions

View File

@@ -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)
}