This commit is contained in:
Tokumeikoi
2020-04-22 16:57:00 +08:00
parent 45a76b25ef
commit c17b614e13
3 changed files with 118 additions and 100 deletions

View File

@ -2,6 +2,7 @@
namespace App\Services;
use App\Models\Order;
use App\Models\User;
class UserService
@ -63,4 +64,15 @@ class UserService
}
return true;
}
public function isNotCompleteOrderByUserId(int $userId):bool
{
$order = Order::whereIn('status', [0, 1])
->where('user_id', $userId)
->first();
if (!$order) {
return false;
}
return true;
}
}