瀏覽代碼

fix 换库修改

ziwen 1 年之前
父節點
當前提交
b56bfbb59d
共有 3 個文件被更改,包括 7 次插入10 次删除
  1. 3 0
      controllers/report.go
  2. 2 2
      models/cygx_yanxuan_special.go
  3. 2 8
      models/cygx_yanxuan_special_user.go

+ 3 - 0
controllers/report.go

@@ -978,6 +978,9 @@ func (this *MobileReportController) SearchReport() {
 				ButtonStyle:     styleMap[v.ArticleTypeId],
 				List:            v.List,
 			}
+			if v.ArticleTypeId == - 1{
+				item.ImgUrlPc = utils.CYGX_YANXUAN_SPECIAL_IMG_PC
+			}
 			if articleType == 1 {
 				resp.ListHz = append(resp.ListHz, &item)
 			} else {

+ 2 - 2
models/cygx_yanxuan_special.go

@@ -81,7 +81,7 @@ func GetYanxuanSpecialList(userId int, condition string, pars []interface{}) (it
 	o := orm.NewOrm()
 	sql := ``
 	sql = `SELECT a.*,b.id AS special_column_id,b.bg_img,b.head_img,b.introduction,b.label,b.mobile,b.nick_name,b.real_name,b.special_name,b.status AS author_status,
-( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac INNER JOIN wx_user as u ON  u.user_id = ac.user_id  WHERE ac.yanxuan_special_id = a.id  ) AS collect_num,
+( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac WHERE ac.yanxuan_special_id = a.id  ) AS collect_num,
 ( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac WHERE ac.yanxuan_special_id = a.id  AND user_id = ? ) AS my_collect_num 
 FROM cygx_yanxuan_special AS a
 JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id 
@@ -118,7 +118,7 @@ func GetYanxuanSpecialById(specialId, userId int) (item *CygxYanxuanSpecialItem,
 	sql := ``
 	sql = `SELECT a.*,b.id AS special_column_id,b.bg_img,b.head_img,b.introduction,b.label,b.mobile,
 b.nick_name,b.real_name,b.special_name,
-( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac INNER JOIN wx_user as u ON  u.user_id = ac.user_id  WHERE ac.yanxuan_special_id = a.id  ) AS collect_num,
+( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac WHERE ac.yanxuan_special_id = a.id  ) AS collect_num,
 ( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac WHERE ac.yanxuan_special_id = a.id  AND user_id = ? ) AS my_collect_num
 FROM cygx_yanxuan_special AS a
 JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id 

+ 2 - 8
models/cygx_yanxuan_special_user.go

@@ -69,15 +69,13 @@ func GetYanxuanSpecialAuthor(reqUserId, sysUserId int) (item *CygxYanxuanSpecial
 	o := orm.NewOrm()
 	sql := ``
 	sql = `SELECT
-	a.*,c.company_name,
+	a.*,
 	( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac  INNER JOIN cygx_yanxuan_special as cs ON  ac.yanxuan_special_id = cs.id  WHERE cs.user_id = a.user_id  ) AS collect_num,
 	( SELECT count( 1 ) FROM cygx_yanxuan_special_follow AS cf  WHERE cf.follow_user_id = a.user_id  ) AS follow_num,
 	( SELECT count( 1 ) FROM cygx_yanxuan_special AS ca  WHERE ca.user_id = a.user_id AND ca.status = 3 ) AS special_article_num,
 	( SELECT count( 1 ) FROM cygx_yanxuan_special_follow AS cf  WHERE cf.follow_user_id =? AND cf.user_id = ?  ) AS is_follow 
 FROM
-	cygx_yanxuan_special_author as a
-	LEFT JOIN wx_user AS u ON u.user_id = a.user_id
-	LEFT JOIN company AS c ON c.company_id = u.company_id WHERE a.user_id=? `
+	cygx_yanxuan_special_author as a WHERE a.user_id=? `
 	err = o.Raw(sql, reqUserId, sysUserId, reqUserId).QueryRow(&item)
 	return
 }
@@ -94,7 +92,6 @@ func GetYanxuanSpecialAuthorBySpecialColumnId(specialColumnId, sysUserId int) (i
 	WHERE cf.user_id = ? AND ca.id = ? ) AS is_follow 
 FROM
 	cygx_yanxuan_special_author as a
-	LEFT JOIN wx_user AS u ON u.user_id = a.user_id
 	LEFT JOIN company AS c ON c.company_id = u.company_id WHERE a.id=? `
 	err = o.Raw(sql, sysUserId, specialColumnId, specialColumnId).QueryRow(&item)
 	return
@@ -123,12 +120,9 @@ func GetYanxuanSpecialAuthorList() (items []*CygxYanxuanSpecialAuthorItem, err e
 	sql := ``
 	sql = `SELECT
 	a.*,
-	c.company_name,
 	IFNULL(( SELECT publish_time FROM cygx_yanxuan_special WHERE user_id = a.user_id AND STATUS = 3 ORDER BY publish_time DESC LIMIT 1 ), a.modify_time) AS latest_publish_time 
 FROM
 	cygx_yanxuan_special_author AS a
-	INNER JOIN wx_user AS u ON u.user_id = a.user_id
-	INNER JOIN company AS c ON c.company_id = u.company_id 
 WHERE
 	a.nick_name <> '' 
 ORDER BY