|
@@ -53,7 +53,7 @@ func getInitJyProduct(ctx context.Context) (*sProductManager, error) {
|
|
|
|
|
|
deptProductPower = map[string]map[int]bool{}
|
|
|
)
|
|
|
- classList, err := g.DB().Query(ctx, "SELECT * FROM jy_product_class WHERE state =1")
|
|
|
+ classList, err := g.DB().Query(ctx, "SELECT * FROM jy_product_class")
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
@@ -61,7 +61,7 @@ func getInitJyProduct(ctx context.Context) (*sProductManager, error) {
|
|
|
return nil, err
|
|
|
}
|
|
|
//查询所有产品
|
|
|
- productList, err := g.DB().Query(ctx, "SELECT * FROM jy_product_item WHERE state =1")
|
|
|
+ productList, err := g.DB().Query(ctx, "SELECT * FROM jy_product_item")
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
@@ -123,7 +123,7 @@ func getInitJyProduct(ctx context.Context) (*sProductManager, error) {
|
|
|
}
|
|
|
|
|
|
// GetList 获取商品列表
|
|
|
-func (p *sProductManager) GetList(deptId int64, buySet ...int) []*model.ProductTop {
|
|
|
+func (p *sProductManager) GetList(deptId int64, all bool, buySet ...int) []*model.ProductTop {
|
|
|
var (
|
|
|
result []*model.ProductTop
|
|
|
set int = 3 //1个人 2企业 3个人和企业都支持
|
|
@@ -136,6 +136,10 @@ func (p *sProductManager) GetList(deptId int64, buySet ...int) []*model.ProductT
|
|
|
for _, top := range p.ProductRoot {
|
|
|
var t []*model.ProductClass
|
|
|
for _, ps := range top.ProductClassList {
|
|
|
+ if all {
|
|
|
+ t = append(t, ps)
|
|
|
+ continue
|
|
|
+ }
|
|
|
if pMap := p.DeptProductPower[ps.Code]; len(pMap) > 0 {
|
|
|
// todo 上线前删除注释
|
|
|
//if !pMap[gconv.Int(deptId)] {
|