|
@@ -117,9 +117,18 @@ func GetLatestByReportIds(ids []int) (item *Report, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+// GetPublishByReportId 根据id获取报告
|
|
|
+func GetPublishByReportId(id int) (item *Report, err error) {
|
|
|
+ err = global.MYSQL["rddp"].Where("id = ? and state = 2", id).First(&item).Error
|
|
|
+ if err == utils.ErrNoRow {
|
|
|
+ err = nil
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
// GetByReportId 根据id获取报告
|
|
|
func GetByReportId(id int) (item *Report, err error) {
|
|
|
- err = global.MYSQL["rddp"].Where("id = ? and state = 2", id).First(&item).Error
|
|
|
+ err = global.MYSQL["rddp"].Where("id = ? ", id).First(&item).Error
|
|
|
if err == utils.ErrNoRow {
|
|
|
err = nil
|
|
|
}
|