huangjiajun преди 14 часа
родител
ревизия
676f8850f0
променени са 4 файла, в които са добавени 28 реда и са изтрити 0 реда
  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 Целия файл

@@ -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 Целия файл

@@ -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 Целия файл

@@ -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 Целия файл

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

Зареждане…
Отказ
Запис