|
@@ -95,7 +95,7 @@ func (r *ReportPdf) ToView() (item *ReportPdfView) {
|
|
|
func (r *ReportPdf) Update(cols []string) (err error) {
|
|
|
reportPushStatus := new(ReportPushStatus)
|
|
|
o := orm.NewOrm()
|
|
|
- sql := `SELECT * FROM report_pdf WHERE report_pdf_id=? AND report_type=?`
|
|
|
+ sql := `SELECT * FROM report_push_status WHERE report_id=? AND report_type=?`
|
|
|
err = o.Raw(sql, r.ReportPdfId, utils.ReportTypePdf).QueryRow(&reportPushStatus)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
return
|
|
@@ -117,7 +117,7 @@ func (r *ReportPdf) Update(cols []string) (err error) {
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
- if (reportPushStatus == nil || err.Error() == utils.ErrNoRow()) && r.State == utils.ReportStatusUp {
|
|
|
+ if reportPushStatus == nil && r.State == utils.ReportStatusUp {
|
|
|
insertPushStatus := &ReportPushStatus{
|
|
|
ReportId: r.ReportPdfId,
|
|
|
State: 0,
|