|
@@ -619,6 +619,7 @@ FROM
|
|
|
a.video_url,
|
|
|
a.sub_category_name,
|
|
|
'' AS content,
|
|
|
+ 1 AS resource,
|
|
|
( SELECT COUNT( 1 ) FROM cygx_article_history_record AS rec WHERE rec.user_id = ` + strconv.Itoa(userId) + ` AND rec.article_id = a.article_id ) AS readnum
|
|
|
FROM
|
|
|
cygx_article AS a
|
|
@@ -635,6 +636,7 @@ FROM
|
|
|
'' AS video_url,
|
|
|
'时间线' AS sub_category_name,
|
|
|
'' AS content,
|
|
|
+ 3 AS resource,
|
|
|
0 AS readnum
|
|
|
FROM
|
|
|
cygx_morning_meeting_review_chapter AS mmc
|
|
@@ -643,8 +645,25 @@ FROM
|
|
|
mm.id = mmc.meeting_id
|
|
|
AND mm.STATUS = 1
|
|
|
AND mmc.industry_id = ? UNION ALL
|
|
|
+ SELECT
|
|
|
+ p.product_interior_id AS id,
|
|
|
+ p.product_interior_id as article_id,
|
|
|
+ p.title,
|
|
|
+ p.publish_time AS publish_date,
|
|
|
+ '' AS video_url,
|
|
|
+ '' AS sub_category_name,
|
|
|
+ '' AS content,
|
|
|
+ 2 AS resource,
|
|
|
+ 0 AS readnum
|
|
|
+ FROM
|
|
|
+ cygx_product_interior AS p
|
|
|
+ INNER JOIN cygx_product_interior_industrial_group_management AS pm
|
|
|
+ WHERE
|
|
|
+ p.product_interior_id = pm.product_interior_id
|
|
|
+ AND p.visible_range = 1
|
|
|
+ AND pm.industrial_management_id = ? UNION ALL
|
|
|
SELECT
|
|
|
- ca.activity_id AS id,
|
|
|
+ cav.video_id AS id,
|
|
|
0 as article_id,
|
|
|
cav.video_name AS title,
|
|
|
ca.activity_time AS publish_time,
|
|
@@ -658,13 +677,13 @@ FROM
|
|
|
INNER JOIN cygx_activity_video AS cav ON ca.activity_id = cav.activity_id
|
|
|
INNER JOIN cygx_industrial_activity_group_management AS cam ON ca.activity_id=cam.activity_id
|
|
|
WHERE
|
|
|
- cam.industrial_management_id = ? AND cam.source = 1
|
|
|
+ cam.industrial_management_id = ? AND cam.source = 1
|
|
|
) AS t`
|
|
|
totalSql := `SELECT COUNT(1) total FROM (` + sql + `) z `
|
|
|
- err = o.Raw(totalSql, industrialManagementId, industrialManagementId).QueryRow(&total)
|
|
|
+ err = o.Raw(totalSql, industrialManagementId, industrialManagementId, industrialManagementId, industrialManagementId).QueryRow(&total)
|
|
|
sql += ` ORDER BY
|
|
|
t.publish_date DESC LIMIT ?,? `
|
|
|
- _, err = o.Raw(sql, industrialManagementId, industrialManagementId, industrialManagementId, startSize, pageSize).QueryRows(&items)
|
|
|
+ _, err = o.Raw(sql, industrialManagementId, industrialManagementId, industrialManagementId, industrialManagementId, startSize, pageSize).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
|