2026-01-09 21:12:39 +08:00
|
|
|
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{
|
2026-01-10 03:14:23 +08:00
|
|
|
KeyWordField: []string{"desc", "product_name"},
|
2026-01-09 21:12:39 +08:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-01-10 03:14:23 +08:00
|
|
|
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
|
|
|
|
|
|
|
|
|
|
}
|