搜索
SQL:
1 | SELECT * FROM users WHERE (username LIKE '%search%') OR (profession LIKE '%search%') OR (skilled_subject LIKE '%search%') ORDER BY username ASC; |
对应的 Eloquent
:
1 | public function search() { |
scotch.io 对 Eloquent
有详细讲解。
SQL:
1 | SELECT * FROM users WHERE (username LIKE '%search%') OR (profession LIKE '%search%') OR (skilled_subject LIKE '%search%') ORDER BY username ASC; |
对应的 Eloquent
:
1 | public function search() { |
scotch.io 对 Eloquent
有详细讲解。