Browse Source

no message

xingzai 3 years ago
parent
commit
fa764bfdbb
2 changed files with 5 additions and 2 deletions
  1. 3 1
      controllers/article.go
  2. 2 1
      models/seller.go

+ 3 - 1
controllers/article.go

@@ -2,6 +2,7 @@ package controllers
 
 import (
 	"encoding/json"
+	"fmt"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/services"
 	"hongze/hongze_cygx/utils"
@@ -201,7 +202,7 @@ func (this *ArticleController) Detail() {
 		sellerItem, err := models.GetSellerByCompanyId(user.CompanyId)
 		if err != nil {
 			br.Msg = "获取信息失败"
-			br.ErrMsg = "获取销售数据失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
+			br.ErrMsg = "获取销售数据失败2,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
 			return
 		}
 		if sellerItem != nil {
@@ -209,6 +210,7 @@ func (this *ArticleController) Detail() {
 			detail.SellerName = sellerItem.RealName
 		}
 		sellerList, err := models.GetSellerList(articleId)
+		fmt.Println(err)
 		if err != nil {
 			br.Msg = "获取信息失败"
 			br.ErrMsg = "获取销售数据失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)

+ 2 - 1
models/seller.go

@@ -25,7 +25,8 @@ func GetSellerByCompanyId(companyId int) (item *AdminItem, err error) {
 	sql := ` SELECT b.*,c.open_id,c.user_id,a.company_name FROM company_product AS a
 			INNER JOIN admin AS b ON a.seller_id=b.admin_id
 			LEFT JOIN wx_user AS c ON b.mobile=c.mobile
-			WHERE a.company_id=? AND a.product_id=2 `
+			WHERE a.company_id=?  `
+	//WHERE a.company_id=? AND a.product_id=2 `
 	err = o.Raw(sql, companyId).QueryRow(&item)
 	return
 }