|
@@ -17,18 +17,18 @@ type UserCertificateDb struct { |
|
|
Db *xorm.Engine |
|
|
Db *xorm.Engine |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (u UserCertificateDb) FindUserCertificate(page, limit, uid string) (*[]model.UserCertificate, error) { |
|
|
|
|
|
|
|
|
func (u UserCertificateDb) FindUserCertificate(page, limit, uid string) (*[]model.UserCertificate, int64, error) { |
|
|
var m []model.UserCertificate |
|
|
var m []model.UserCertificate |
|
|
sess := u.Db.Where("1=1") |
|
|
sess := u.Db.Where("1=1") |
|
|
if uid != "" { |
|
|
if uid != "" { |
|
|
sess.In("uid", strings.Split(uid, ",")) |
|
|
sess.In("uid", strings.Split(uid, ",")) |
|
|
} |
|
|
} |
|
|
start := (zhios_order_relate_utils.StrToInt(page) - 1) * zhios_order_relate_utils.StrToInt(limit) |
|
|
start := (zhios_order_relate_utils.StrToInt(page) - 1) * zhios_order_relate_utils.StrToInt(limit) |
|
|
err := sess.Limit(zhios_order_relate_utils.StrToInt(limit), start).OrderBy("id desc").Find(&m) |
|
|
|
|
|
|
|
|
total, err := sess.Limit(zhios_order_relate_utils.StrToInt(limit), start).OrderBy("id desc").FindAndCount(&m) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
|
|
|
|
|
return nil, 0, zhios_order_relate_logx.Error(err) |
|
|
} |
|
|
} |
|
|
return &m, nil |
|
|
|
|
|
|
|
|
return &m, total, nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (u UserCertificateDb) GetUserCertificateByNo(no string) (m *model.UserCertificate, err error) { |
|
|
func (u UserCertificateDb) GetUserCertificateByNo(no string) (m *model.UserCertificate, err error) { |
|
|