mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Fixed more camel-casing -> snake-casing
This commit is contained in:
parent
d5c3ee5ed0
commit
56576d9e45
|
@ -39,7 +39,7 @@ class SyncAssetCounters extends Command
|
|||
public function handle()
|
||||
{
|
||||
$start = microtime(true);
|
||||
$assets = Asset::withCount('checkins', 'checkouts', 'userRequests')
|
||||
$assets = Asset::withCount('checkins as checkins_count', 'checkouts as checkouts_count', 'userRequests as user_requests_count')
|
||||
->withTrashed()->get();
|
||||
|
||||
if ($assets) {
|
||||
|
|
|
@ -281,7 +281,7 @@ class Helper
|
|||
*/
|
||||
public static function checkLowInventory()
|
||||
{
|
||||
$consumables = Consumable::withCount('consumableAssignments as consumableAssignments_count')->whereNotNull('min_amt')->get();
|
||||
$consumables = Consumable::withCount('consumableAssignments as consumable_assignments_count')->whereNotNull('min_amt')->get();
|
||||
$accessories = Accessory::withCount('users as users_count')->whereNotNull('min_amt')->get();
|
||||
$components = Component::withCount('assets as assets_count')->whereNotNull('min_amt')->get();
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class LocationsController extends Controller
|
|||
'locations.updated_at',
|
||||
'locations.image',
|
||||
'locations.currency'
|
||||
])->withCount('assignedAssets as assignedAssets_count')
|
||||
])->withCount('assignedAssets as assigned_assets_count')
|
||||
->withCount('assets as assets_count')
|
||||
->withCount('users as users_count');
|
||||
|
||||
|
@ -123,7 +123,7 @@ class LocationsController extends Controller
|
|||
'locations.image',
|
||||
'locations.currency'
|
||||
])
|
||||
->withCount('assignedAssets as assignedAssets_count')
|
||||
->withCount('assignedAssets as assigned_assets_count')
|
||||
->withCount('assets as assets_count')
|
||||
->withCount('users as users_count')->findOrFail($id);
|
||||
return (new LocationsTransformer)->transformLocation($location);
|
||||
|
|
|
@ -32,7 +32,7 @@ class ApiLocationsCest
|
|||
$response = json_decode($I->grabResponse(), true);
|
||||
// sample verify
|
||||
$location = App\Models\Location::orderByDesc('created_at')
|
||||
->withCount('assignedAssets as assignedAssets_count', 'assets as assets_count', 'users as users_count')
|
||||
->withCount('assignedAssets as assigned_assets_count', 'assets as assets_count', 'users as users_count')
|
||||
->take(10)->get()->shuffle()->first();
|
||||
$I->seeResponseContainsJson($I->removeTimestamps((new LocationsTransformer)->transformLocation($location)));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue