package service import ( "blazing/cool" "blazing/modules/config/model" "context" "github.com/gogf/gf/v2/frame/g" ) type ShopService struct { *cool.Service } func NewShopService() *ShopService { return &ShopService{ &cool.Service{ Model: model.NewShopConfig(), ListQueryOp: &cool.QueryOp{ Where: func(ctx context.Context) []g.Array { return [][]interface{}{ {"is_enable", 1, true}, } }, Select: "product_id,seerdou_price,jindou_price,remark", }, PageQueryOp: &cool.QueryOp{ KeyWordField: []string{"remark"}, }, }, } } func (s *ShopService) Get(product_id uint32) *model.ShopConfig { m := dbm_enable(s.Model).Where("product_id", product_id) var tt *model.ShopConfig m.Scan(&tt) return tt }