|
@@ -331,6 +331,54 @@ func GetIndustrialManagementArtCount(industrialManagementId int) (count int, err
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+type IndustrialManagementArtHistoryCount struct {
|
|
|
+ IndustrialManagementId int `description:"产业id"`
|
|
|
+ Count int `description:"数量"`
|
|
|
+}
|
|
|
+
|
|
|
+func GetIndustrialManagementArtHistoryCount(condition string) (items []*IndustrialManagementArtHistoryCount, err error) {
|
|
|
+ sql := `SELECT
|
|
|
+ COUNT( 1 ) AS count,
|
|
|
+ mg.industrial_management_id
|
|
|
+ FROM
|
|
|
+ cygx_article_history_record_newpv AS h
|
|
|
+ INNER JOIN cygx_industrial_article_group_management AS mg ON mg.article_id = h.article_id
|
|
|
+ INNER JOIN cygx_article AS a ON a.article_id = h.article_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ AND DATE_SUB( CURDATE(), INTERVAL 30 DAY ) <= date( h.create_time ) ` + condition + `
|
|
|
+ GROUP BY
|
|
|
+ mg.industrial_management_id `
|
|
|
+ o := orm.NewOrm()
|
|
|
+ _, err = o.Raw(sql).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func GetIndustrialManagementActivityHistoryCount() (items []*IndustrialManagementArtHistoryCount, err error) {
|
|
|
+ sql := `SELECT
|
|
|
+ COUNT( 1 ) AS count,
|
|
|
+ mg.industrial_management_id
|
|
|
+ FROM
|
|
|
+ cygx_activity_meet_detail_log AS h
|
|
|
+ INNER JOIN cygx_industrial_activity_group_management AS mg ON mg.activity_id = h.activity_id
|
|
|
+ INNER JOIN cygx_activity AS a ON a.activity_id = h.activity_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ AND DATE_SUB( CURDATE(), INTERVAL 30 DAY ) <= date( h.create_time )
|
|
|
+ GROUP BY
|
|
|
+ mg.industrial_management_id `
|
|
|
+ o := orm.NewOrm()
|
|
|
+ _, err = o.Raw(sql).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func UpdateIndustrialManagementArtticleReadNum() (err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `UPDATE cygx_industrial_management SET article_read_num = 0 ,yanxuan_article_read_num = 0 ,activity_num = 0 `
|
|
|
+ _, err = o.Raw(sql).Exec()
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
func UpdateIndustrialManagementArtReadNum(num, industrialManagementId int) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `UPDATE cygx_industrial_management SET article_read_num = ? WHERE industrial_management_id = ?`
|
|
@@ -338,6 +386,20 @@ func UpdateIndustrialManagementArtReadNum(num, industrialManagementId int) (err
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func UpdateIndustrialManagementArtYanXuanReadNum(num, industrialManagementId int) (err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `UPDATE cygx_industrial_management SET yanxuan_article_read_num = ? WHERE industrial_management_id = ?`
|
|
|
+ _, err = o.Raw(sql, num, industrialManagementId).Exec()
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func UpdateIndustrialManagementActivityNum(num, industrialManagementId int) (err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `UPDATE cygx_industrial_management SET activity_num = ? WHERE industrial_management_id = ?`
|
|
|
+ _, err = o.Raw(sql, num, industrialManagementId).Exec()
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
// 更新产业布局时间
|
|
|
func UpdateIndustrialManagementLayoutTime(layoutTime string, industrialManagementId int) (err error) {
|
|
|
o := orm.NewOrm()
|