|
|
@@ -40,3 +40,16 @@ func (j JpushNoticeDb) FindJpushNotice(page, limit, types string) (*[]model.Jpus |
|
|
|
} |
|
|
|
return &m, nil |
|
|
|
} |
|
|
|
func (j JpushNoticeDb) FindJpushNoticeAndTotal(page, limit, types string) (*[]model.JpushNotice, int64, error) { |
|
|
|
var m []model.JpushNotice |
|
|
|
sess := j.Db.Where("1=1") |
|
|
|
start := (zhios_order_relate_utils.StrToInt(page) - 1) * zhios_order_relate_utils.StrToInt(limit) |
|
|
|
if types != "" { |
|
|
|
sess.In("type", strings.Split(types, ",")) |
|
|
|
} |
|
|
|
count, err := sess.Limit(zhios_order_relate_utils.StrToInt(limit), start).FindAndCount(&m) |
|
|
|
if err != nil { |
|
|
|
return nil, count, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
return &m, count, nil |
|
|
|
} |