|
@@ -291,11 +291,11 @@ func GetOutsideReportById(reportId int) (item *OutsideReport, err error) {
|
|
|
WHERE
|
|
|
o.outside_report_id = ?
|
|
|
AND oa.title LIKE '%.pdf%'
|
|
|
- AND oa.create_time = (
|
|
|
- SELECT MAX(oa2.create_time)
|
|
|
+ AND oa.outside_report_attachment_id = (
|
|
|
+ SELECT MAX(oa2.outside_report_attachment_id)
|
|
|
FROM outside_report_attachment oa2
|
|
|
WHERE oa2.outside_report_id = o.outside_report_id AND oa2.title LIKE '%.pdf%'
|
|
|
- )
|
|
|
+ ) GROUP BY o.outside_report_id
|
|
|
LIMIT 1`
|
|
|
err = o.Raw(sql, reportId).QueryRow(&item)
|
|
|
return
|