|
@@ -1,6 +1,7 @@
|
|
|
package models
|
|
|
|
|
|
import (
|
|
|
+ "eta/eta_forum_task/utils"
|
|
|
"time"
|
|
|
|
|
|
"github.com/beego/beego/v2/client/orm"
|
|
@@ -17,8 +18,19 @@ type ForumChartEdbMapping struct {
|
|
|
// 根据chartInfoId获取edbInfoIds
|
|
|
func GetEdbInfoIdsByChartInfoId(chartInfoId int) (edbInfoIds string, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
- sql := `SELECT edb_info_ids FROM forum_chart_edb_mapping WHERE chart_info_id = ?`
|
|
|
- err = o.Raw(sql, chartInfoId).QueryRow(&edbInfoIds)
|
|
|
+ item := new(ForumChartEdbMapping)
|
|
|
+ sql := `SELECT * FROM forum_chart_edb_mapping WHERE chart_info_id = ?`
|
|
|
+ err = o.Raw(sql, chartInfoId).QueryRow(&item)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ if err == nil {
|
|
|
+ edbInfoIds = item.EdbInfoIds
|
|
|
+ return
|
|
|
+ }
|
|
|
+ err = nil
|
|
|
+ }
|
|
|
+
|
|
|
return
|
|
|
}
|
|
|
|