|
@@ -126,7 +126,7 @@ func (m *BaseFromBloombergIndex) GetItemByCondition(condition string, pars []int
|
|
|
func (m *BaseFromBloombergIndex) GetCountByCondition(condition string, pars []interface{}) (count int, err error) {
|
|
|
sqlStr := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
|
|
|
var totalNull sql.NullInt64
|
|
|
- err = global.DbMap[utils.DbNameIndex].Raw(sqlStr, pars...).Scan(&count).Error
|
|
|
+ err = global.DbMap[utils.DbNameIndex].Raw(sqlStr, pars...).Scan(&totalNull).Error
|
|
|
if !totalNull.Valid {
|
|
|
count = 0
|
|
|
} else {
|