Browse Source

极光推送

master
huangjiajun 16 hours ago
parent
commit
676f8850f0
4 changed files with 28 additions and 0 deletions
  1. +1
    -0
      src/dao/jpush_notice_dao.go
  2. +1
    -0
      src/dao/jpush_record_dao.go
  3. +13
    -0
      src/implement/jpush_notice_implement.go
  4. +13
    -0
      src/implement/jpush_record_implement.go

+ 1
- 0
src/dao/jpush_notice_dao.go View File

@@ -5,4 +5,5 @@ import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"
type JpushNoticeDao interface {
GetJpushNotice(id string) (m *model.JpushNotice, err error)
FindJpushNotice(page, limit, types string) (*[]model.JpushNotice, error)
FindJpushNoticeAndTotal(page, limit, types string) (*[]model.JpushNotice, int64, error)
}

+ 1
- 0
src/dao/jpush_record_dao.go View File

@@ -5,4 +5,5 @@ import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"
type JpushRecordDao interface {
GetJpushRecord(id string) (m *model.JpushRecord, err error)
FindJpushRecord(page, limit, title string) (*[]model.JpushRecord, error)
FindJpushRecordAndTotal(page, limit, title string) (*[]model.JpushRecord, int64, error)
}

+ 13
- 0
src/implement/jpush_notice_implement.go View File

@@ -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
}

+ 13
- 0
src/implement/jpush_record_implement.go View File

@@ -39,3 +39,16 @@ func (j JpushRecordDb) FindJpushRecord(page, limit, title string) (*[]model.Jpus
}
return &m, nil
}
func (j JpushRecordDb) FindJpushRecordAndTotal(page, limit, title string) (*[]model.JpushRecord, int64, error) {
var m []model.JpushRecord
sess := j.Db.Where("1=1")
start := (zhios_order_relate_utils.StrToInt(page) - 1) * zhios_order_relate_utils.StrToInt(limit)
if title != "" {
sess.And("title like ?", "%"+title+"%")
}
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
}

Loading…
Cancel
Save