|
@@ -328,13 +328,21 @@ func (self *ProductController) GetPdDetail() {
|
|
|
|
|
|
|
|
// 商品分类
|
|
// 商品分类
|
|
|
func (self *ProductController) Categories() {
|
|
func (self *ProductController) Categories() {
|
|
|
|
|
+ employTag := false
|
|
|
|
|
+ user := self.GetCurrentUser(false)
|
|
|
|
|
+ if user != nil && user.Tel != "" {
|
|
|
|
|
+ empploy := user_model.GetEmployer(user.Tel, false)
|
|
|
|
|
+ if empploy != nil {
|
|
|
|
|
+ employTag = true
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
ancestry := self.GetString("ancestry")
|
|
ancestry := self.GetString("ancestry")
|
|
|
var catRet []*product_model.ProductCat
|
|
var catRet []*product_model.ProductCat
|
|
|
cat := new(product_model.ProductCat)
|
|
cat := new(product_model.ProductCat)
|
|
|
cat.Id = 0
|
|
cat.Id = 0
|
|
|
cat.Name = "全部"
|
|
cat.Name = "全部"
|
|
|
catRet = append(catRet, cat)
|
|
catRet = append(catRet, cat)
|
|
|
- cats := product_model.GetProductCatsByAncestry(strings.TrimSpace(ancestry))
|
|
|
|
|
|
|
+ cats := product_model.GetProductCatsByAncestry(strings.TrimSpace(ancestry), employTag)
|
|
|
for _, item := range cats {
|
|
for _, item := range cats {
|
|
|
catRet = append(catRet, item)
|
|
catRet = append(catRet, item)
|
|
|
}
|
|
}
|