Browse Source

fix:看板消息列表

zqbao 5 months ago
parent
commit
8a07f2fca5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      models/bi_approve/bi_approve_message.go

+ 2 - 1
models/bi_approve/bi_approve_message.go

@@ -98,12 +98,13 @@ func (m *BiApproveMessage) GetPageItemsByCondition(condition string, pars []inte
 		order = ` ORDER BY ` + orderRule
 	}
 	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
+	pars = append(pars, startSize, pageSize)
 	err = global.DmSQL["rddp"].Raw(sql, pars...).Find(&items).Error
 	return
 }
 
 func (m *BiApproveMessage) GetItemById(id int) (item *BiApproveMessage, err error) {
-	sql := fmt.Sprintf(`SELECT * FROM %s WHERE %s = ? LIMIT 1`, m.TableName(), m.PrimaryId())
+	sql := fmt.Sprintf(`SELECT * FROM %s WHERE %s = ? `, m.TableName(), m.PrimaryId())
 	err = global.DmSQL["rddp"].Raw(sql, id).First(&item).Error
 	return
 }