|
@@ -118,7 +118,7 @@ func getInitJyProduct(ctx context.Context) (*sProductManager, error) {
|
|
|
}
|
|
|
|
|
|
// GetList 获取商品列表
|
|
|
-func (p *sProductManager) GetList(buySet ...int) []*model.ProductTop {
|
|
|
+func (p *sProductManager) GetList(deptId int64, buySet ...int) []*model.ProductTop {
|
|
|
var (
|
|
|
result []*model.ProductTop
|
|
|
set int = 3 //1个人 2企业 3个人和企业都支持
|
|
@@ -128,18 +128,17 @@ func (p *sProductManager) GetList(buySet ...int) []*model.ProductTop {
|
|
|
set = common.If(buySet[0] > 0 && buySet[0] < 3, buySet[0], 3).(int)
|
|
|
}
|
|
|
|
|
|
- if set == 3 {
|
|
|
- return p.ProductRoot
|
|
|
- }
|
|
|
-
|
|
|
for _, top := range p.ProductRoot {
|
|
|
var t []*model.ProductClass
|
|
|
for _, ps := range top.ProductClassList {
|
|
|
- if ps.BuySet == 1 && set != 2 {
|
|
|
- t = append(t, ps)
|
|
|
- }
|
|
|
- if ps.BuySet == 2 && set != 1 {
|
|
|
- t = append(t, ps)
|
|
|
+ if pMap := p.DeptProductPower[ps.Code]; len(pMap) > 0 {
|
|
|
+ // todo 上线前删除注释
|
|
|
+ //if !pMap[gconv.Int(deptId)] {
|
|
|
+ // continue
|
|
|
+ //}
|
|
|
+ if set == 3 || (ps.BuySet == 1 && set != 2) || (ps.BuySet == 2 && set != 1) {
|
|
|
+ t = append(t, ps)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if len(t) > 0 {
|
|
@@ -182,6 +181,8 @@ func (p *sProductManager) GetProductClass(classId int64) (*model.ProductClass, e
|
|
|
|
|
|
// PowerCheck 校验部门是否有权限创建修改订单
|
|
|
func (p *sProductManager) PowerCheck(code string, deptId int64) bool {
|
|
|
+ // todo 上线前删除注释
|
|
|
+ return true
|
|
|
if t := p.DeptProductPower[code]; t != nil {
|
|
|
return t[gconv.Int(deptId)]
|
|
|
}
|