top.js 237 B

1234567891011
  1. const {mysql} = require('../qcloud')
  2. module.exports = async (ctx) => {
  3. const top = await mysql('books')
  4. .select('id', 'title', 'image', 'count')
  5. .orderBy('count', 'desc')
  6. .limit(9)
  7. ctx.state.data = {
  8. list: top
  9. }
  10. }