|
@@ -105,8 +105,8 @@ func GetProductListBySourceIds(ids []int, detail bool, productType ...MerchantPr
|
|
|
|
|
|
func GetTotalPageCountByProductType(productType MerchantProductType) (total int64, latestId int64) {
|
|
|
db := models.Main()
|
|
|
- _ = db.Select("count(*)").Where("type=? and deleted =?", productType, false).Scan(&total).Error
|
|
|
- _ = db.Select("max(id)").Where("type=? and deleted =?", productType, false).Scan(&latestId).Error
|
|
|
+ _ = db.Model(&MerchantProduct{}).Select("count(*)").Where("type=? and deleted =?", productType, false).Scan(&total).Error
|
|
|
+ _ = db.Model(&MerchantProduct{}).Select("max(id)").Where("type=? and deleted =?", productType, false).Scan(&latestId).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -116,6 +116,6 @@ func GetProductListByProductType(productType MerchantProductType, id int64, offs
|
|
|
err = errors.New("productType参数不能为空")
|
|
|
return
|
|
|
}
|
|
|
- err = db.Select(detailColumns).Where("id <= ? and type = ? and deleted =? limit ?,? order by created_time desc", id, productType, false, offset, limit).Find(&list).Error
|
|
|
+ err = db.Select(detailColumns).Where("id <= ? and type = ? and deleted =? order by created_time desc limit ?,? ", id, productType, false, offset, limit).Find(&list).Error
|
|
|
return
|
|
|
}
|