|
|
@@ -55,20 +55,14 @@ func (p PublicPlatoonFreePunishWithUserDb) PublicPlatoonFreePunishWithUserUpdate |
|
|
|
|
|
|
|
func (p PublicPlatoonFreePunishWithUserDb) PublicPlatoonFreePunishWithUserCountAndGetPageByParams(page int, limit int, params map[string]interface{}) ([]model.PublicPlatoonFreePunishWithUser, int64, error) { |
|
|
|
|
|
|
|
var publicPlatoonFreePunishWithUser model.PublicPlatoonFreePunishWithUser |
|
|
|
total, err := p.Db.Where("").Count(&publicPlatoonFreePunishWithUser) |
|
|
|
if err != nil { |
|
|
|
return nil, 0, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
|
|
|
|
var m []model.PublicPlatoonFreePunishWithUser |
|
|
|
session := p.Db |
|
|
|
var total int64 |
|
|
|
var err1 error |
|
|
|
if params != nil { |
|
|
|
query := fmt.Sprintf("%s = ?", params["key"]) |
|
|
|
err1 = session.Where(query, params["value"]).Limit(limit, (page-1)*limit).Find(&m) |
|
|
|
total, err1 = p.Db.Where(query, params["value"]).Limit(limit, (page-1)*limit).FindAndCount(&m) |
|
|
|
} else { |
|
|
|
err1 = session.Where("1=1").Limit(limit, (page-1)*limit).Find(&m) |
|
|
|
total, err1 = p.Db.Where("1=1").Limit(limit, (page-1)*limit).FindAndCount(&m) |
|
|
|
} |
|
|
|
if err1 != nil { |
|
|
|
return nil, 0, zhios_order_relate_logx.Error(err1) |
|
|
|