|
@@ -81,7 +81,7 @@ func GetYanxuanSpecialList(userId int, condition string, pars []interface{}) (it
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
sql := ``
|
|
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,
|
|
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
|
|
( 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
|
|
FROM cygx_yanxuan_special AS a
|
|
JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id
|
|
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 := ``
|
|
sql = `SELECT a.*,b.id AS special_column_id,b.bg_img,b.head_img,b.introduction,b.label,b.mobile,
|
|
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.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
|
|
( 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
|
|
FROM cygx_yanxuan_special AS a
|
|
JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id
|
|
JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id
|