Files
bl/modules/config/service/shop.go

43 lines
785 B
Go
Raw Normal View History

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,product_name,seerdou_price,jindou_price,remark",
},
2026-02-14 07:36:05 +08:00
PageQueryOp: &cool.QueryOp{
KeyWordField: []string{"desc", "product_name"},
},
},
}
}
func (s *ShopService) Get(product_id uint32) *model.ShopConfig {
2026-02-14 23:14:43 +08:00
m := dbm_enable(s.Model).Where("product_id", product_id)
var tt *model.ShopConfig
m.Scan(&tt)
return tt
}