|
@@ -98,14 +98,14 @@ func GetChartCountById(chartId int) (count int, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//新增图表
|
|
|
+// 新增图表
|
|
|
func AddCygxChart(item *CygxChart) (lastId int64, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
lastId, err = o.Insert(item)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//标签分类
|
|
|
+// 标签分类
|
|
|
type ChartPtagResultApi struct {
|
|
|
Data []ChartPtagResultApidate `json:"data"`
|
|
|
Code int `json:"code"`
|
|
@@ -167,7 +167,7 @@ type ChartCollectReq struct {
|
|
|
ChartId int `description:"图表ID"`
|
|
|
}
|
|
|
|
|
|
-//获取图表列表
|
|
|
+// 获取图表列表
|
|
|
func GetChartList(condition string, pars []interface{}, startSize, pageSize int) (items []*HomeChartListResp, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := ` SELECT * FROM cygx_chart AS a WHERE a.publish_status=1 `
|
|
@@ -179,7 +179,7 @@ func GetChartList(condition string, pars []interface{}, startSize, pageSize int)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取所有同步过来的图表
|
|
|
+// 获取所有同步过来的图表
|
|
|
func GetChartListAll() (items []*HomeChartListResp, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := ` SELECT chart_id FROM cygx_chart `
|
|
@@ -195,7 +195,7 @@ func GetChartListAll() (items []*HomeChartListResp, err error) {
|
|
|
// return
|
|
|
//}
|
|
|
|
|
|
-//获取图表列表
|
|
|
+// 获取图表列表
|
|
|
func GetChartListCollection(chartIds string, userId, startSize, pageSize int) (items []*HomeChartListResp, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := ` SELECT a.*,
|
|
@@ -208,7 +208,7 @@ func GetChartListCollection(chartIds string, userId, startSize, pageSize int) (i
|
|
|
LEFT JOIN cygx_chart_top AS t ON t.chart_id = a.chart_id
|
|
|
LEFT JOIN cygx_chart_collect AS c ON c.chart_id = a.chart_id
|
|
|
WHERE
|
|
|
- a.publish_status = 1
|
|
|
+ 1=1
|
|
|
AND a.chart_id IN (` + chartIds + `)
|
|
|
GROUP BY
|
|
|
a.chart_id
|
|
@@ -219,7 +219,7 @@ func GetChartListCollection(chartIds string, userId, startSize, pageSize int) (i
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取图表列表
|
|
|
+// 获取图表列表
|
|
|
func GetChartListCollectionNew(condition string, pars []interface{}, userId, startSize, pageSize int) (items []*HomeChartListResp, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := ` SELECT a.*,
|
|
@@ -244,7 +244,7 @@ func GetChartListCollectionNew(condition string, pars []interface{}, userId, sta
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取图表列表本地
|
|
|
+// 获取图表列表本地
|
|
|
func GetChartListCollectionWithCygx(userId, startSize, pageSize int) (items []*HomeChartListResp, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := ` SELECT
|
|
@@ -258,7 +258,7 @@ func GetChartListCollectionWithCygx(userId, startSize, pageSize int) (items []*H
|
|
|
INNER JOIN cygx_chart AS a ON c.chart_id = a.chart_id
|
|
|
LEFT JOIN cygx_chart_top AS t ON t.chart_id = a.chart_id
|
|
|
WHERE
|
|
|
- a.publish_status = 1
|
|
|
+ 1=1
|
|
|
AND c.user_id =?
|
|
|
GROUP BY
|
|
|
a.chart_id
|
|
@@ -276,7 +276,7 @@ func GetChartListConfig() (items []*HomeChartListResp, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取图表数量
|
|
|
+// 获取图表数量
|
|
|
func GetChartCount(condition string, pars []interface{}) (count int, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT COUNT(1) AS count
|
|
@@ -289,12 +289,12 @@ func GetChartCount(condition string, pars []interface{}) (count int, err error)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取图表数量
|
|
|
+// 获取图表数量
|
|
|
func GetChartCollentCount(condition string, pars []interface{}) (count int, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT COUNT(1) AS count
|
|
|
FROM cygx_chart_all AS a
|
|
|
- WHERE a.publish_status=1 `
|
|
|
+ WHERE 1=1 `
|
|
|
if condition != "" {
|
|
|
sql += condition
|
|
|
}
|