feature: fuzzy search

This commit is contained in:
Tokumeikoi 2020-09-18 14:18:56 +08:00
parent 644aedb999
commit d500769bd7
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ class UserController extends Controller
$sort = $request->input('sort') ? $request->input('sort') : 'created_at';
$userModel = User::orderBy($sort, $sortType);
if ($request->input('email')) {
$userModel->where('email', $request->input('email'));
$userModel->where('email', 'like', '%' . $request->input('email') . '%');
}
if ($request->input('invite_user_id')) {
$userModel->where('invite_user_id', $request->input('invite_user_id'));

View File

@ -119,7 +119,7 @@ class OrderService
private function orderIsUsed(Order $order):bool
{
$month = self::STRTOTIME[$order->cycle];
$orderExpireDay = strtotime('+'. $month . ' month', $order->created_at->timestamp);
$orderExpireDay = strtotime('+' . $month . ' month', $order->created_at->timestamp);
if ($orderExpireDay < time()) return true;
return false;
}