mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Update BaseAPIController.php
Refactor If blocks.
This commit is contained in:
parent
62c018835a
commit
df8b896cf3
@ -99,15 +99,17 @@ class BaseAPIController extends Controller
|
||||
|
||||
$query->with($includes);
|
||||
|
||||
if ($updatedAt == intval(Input::get('updated_at'))) {
|
||||
$query->where('updated_at', '>=', date('Y-m-d H:i:s', $updatedAt));
|
||||
if (Input::get('updated_at') > 0) {
|
||||
$updatedAt = intval(Input::get('updated_at'));
|
||||
$query->where('updated_at', '>=', date('Y-m-d H:i:s', $updatedAt));
|
||||
}
|
||||
|
||||
if ($clientPublicId == Input::get('client_id')) {
|
||||
$filter = function ($query) use ($clientPublicId) {
|
||||
|
||||
if (Input::get('client_id') > 0) {
|
||||
$clientPublicId = Input::get('client_id');
|
||||
$filter = function ($query) use ($clientPublicId) {
|
||||
$query->where('public_id', '=', $clientPublicId);
|
||||
};
|
||||
$query->whereHas('client', $filter);
|
||||
};
|
||||
$query->whereHas('client', $filter);
|
||||
}
|
||||
|
||||
if (! Utils::hasPermission('view_all')) {
|
||||
|
Loading…
Reference in New Issue
Block a user