...
|
...
|
@@ -2,6 +2,7 @@ package models |
|
|
|
|
|
import (
|
|
|
"fmt"
|
|
|
"oppmg/utils"
|
|
|
"time"
|
|
|
|
|
|
"github.com/astaxie/beego/orm"
|
...
|
...
|
@@ -82,10 +83,10 @@ func DeleteBulletin(id int) (err error) { |
|
|
return
|
|
|
}
|
|
|
|
|
|
func GetBulletins(companyId int64, status int8, page, pageSize int) (v []*Bulletin, total int, err error) {
|
|
|
func GetBulletins(companyId int64, status int8, offset, pageSize int) (v []*Bulletin, total int, err error) {
|
|
|
sql := "select * from bulletin where (status=? or ?=0) and company_id =? order by create_at desc limit ?,?"
|
|
|
o := orm.NewOrm()
|
|
|
if _, err = o.Raw(sql, status, status, companyId, page-1, pageSize).QueryRows(&v); err != nil {
|
|
|
if err = utils.ExecuteQueryAllWithOrmer(o, &v, sql, status, status, companyId, offset, pageSize); err != nil {
|
|
|
return
|
|
|
}
|
|
|
|
...
|
...
|
|