Created
June 17, 2018 03:24
-
-
Save devalexandre/9e9539f4c1c33ae50cdeb7f3b89ffe0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async searsh({params,request}){ | |
const { field, word } = request.only(['field','word']); | |
const page = params.page | |
const total = params.total || 20 | |
const data = await MDO | |
.query() | |
.where(field, 'like', `%${word}%`) | |
.paginate(page,total) | |
return data | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment