瀏覽代碼

no message

xingzai 1 年之前
父節點
當前提交
e68c81504c
共有 4 個文件被更改,包括 14 次插入6 次删除
  1. 8 1
      controllers/user.go
  2. 2 2
      models/activity_help_ask.go
  3. 3 2
      models/article_comment.go
  4. 1 1
      models/company.go

+ 8 - 1
controllers/user.go

@@ -326,7 +326,14 @@ func (this *UserController) Detail() {
 					br.ErrMsg = "获取用户所在公司剩余的点失败,Err:" + err.Error()
 					return
 				}
-				if companyReportPermissionDetail == nil {
+				companyProduct, err := models.GetCompanyProductDetail(user.CompanyId, 2)
+				if err != nil {
+					br.Msg = "获取信息失败"
+					br.ErrMsg = "获取客户信息失败,Err:" + err.Error()
+					return
+				}
+
+				if companyReportPermissionDetail == nil || companyProduct.IsSuspend == 1 {
 					hasPermission = 1
 				} else {
 					detail.PermissionStatus = companyReportPermissionDetail.Status

+ 2 - 2
models/activity_help_ask.go

@@ -55,7 +55,7 @@ func GetActivityAskList(userId int) (items []*CygxAskList, err error) {
 			cygx_activity_help_ask AS k
 			INNER JOIN cygx_activity AS a ON a.activity_id = k.activity_id 
 		WHERE
-			user_id = ? AND a.publish_status = 1 ORDER BY k.ask_id DESC`
+			user_id = ? AND a.publish_status = 1  AND chart_permission_id = 31  ORDER BY k.ask_id DESC`
 	_, err = o.Raw(sql, userId).QueryRows(&items)
 	return
 }
@@ -72,7 +72,7 @@ func GetArticleAskList(userId int) (items []*CygxAskList, err error) {
 			cygx_article_ask AS k
 			INNER JOIN cygx_article AS a ON a.article_id = k.article_id 
 		WHERE
-			user_id = ? AND a.publish_status = 1 ORDER BY k.ask_id DESC`
+			user_id = ? AND a.publish_status = 1  article_type_id > 0  ORDER BY k.ask_id DESC`
 	_, err = o.Raw(sql, userId).QueryRows(&items)
 	return
 }

+ 3 - 2
models/article_comment.go

@@ -40,11 +40,12 @@ type AddCygxArticleCommentReq struct {
 func GetCommentList(userId int) (items []*CygxArticleComment, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
-			* 
+			c.* 
 		FROM
 			cygx_article_comment AS c
+			INNER JOIN cygx_article as  a ON c.article_id = a.article_id 
 		WHERE
-			user_id = ? ORDER BY c.create_time DESC`
+			user_id = ?  AND  a.article_type_id  > 0  ORDER BY c.create_time DESC`
 
 	_, err = o.Raw(sql, userId).QueryRows(&items)
 	return

+ 1 - 1
models/company.go

@@ -22,7 +22,7 @@ func GetCompanyDetailById(companyId int) (item *CompanyDetail, err error) {
 
 	sql := ` SELECT a.company_id,a.company_name,b.status,b.seller_id,b.seller_name,c.mobile,p.product_id
             FROM company AS a
-			INNER JOIN company_product AS b ON a.company_id=b.company_id
+			INNER JOIN company_product AS b ON a.company_id=b.company_id AND is_suspend = 1
 			INNER JOIN company_report_permission AS p ON p.company_id = a.company_id
 			INNER JOIN chart_permission AS cp ON cp.chart_permission_id=p.chart_permission_id
 			LEFT JOIN admin AS c ON b.seller_id=c.admin_id