|
@@ -88,3 +88,19 @@ func GetReportPdfById(id int) (item *ReportPdfView, err error) {
|
|
|
err = o.Raw(sql, id).QueryRow(&item)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// 更新pv
|
|
|
+func UpdateReportPdfPv(id int) (err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `UPDATE report_pdf SET pv = pv + 1 WHERE report_pdf_id = ?`
|
|
|
+ _, err = o.Raw(sql, id).Exec()
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// 更新uv和pv
|
|
|
+func UpdateReportPdfUvAndPv(id int) (err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `UPDATE report_pdf SET uv = uv + 1 AND pv = pv + 1 WHERE report_pdf_id = ?`
|
|
|
+ _, err = o.Raw(sql, id).Exec()
|
|
|
+ return
|
|
|
+}
|