package service import ( "blazing/cool" "blazing/modules/config/model" ) type ShopService struct { *cool.Service } func NewShopService() *ShopService { return &ShopService{ &cool.Service{ Model: model.NewShopConfig(), PageQueryOp: &cool.QueryOp{ KeyWordField: []string{"desc", "product_name"}, }, }, } } func (s *ShopService) Get(product_id uint32) *model.ShopConfig { m := dbm(s.Model).Where("product_id", product_id) var tt *model.ShopConfig m.Scan(&tt) return tt }