mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-12 16:44:08 -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()
|
public function handle()
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
$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();
|
->withTrashed()->get();
|
||||||
|
|
||||||
if ($assets) {
|
if ($assets) {
|
||||||
|
|
|
@ -281,7 +281,7 @@ class Helper
|
||||||
*/
|
*/
|
||||||
public static function checkLowInventory()
|
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();
|
$accessories = Accessory::withCount('users as users_count')->whereNotNull('min_amt')->get();
|
||||||
$components = Component::withCount('assets as assets_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.updated_at',
|
||||||
'locations.image',
|
'locations.image',
|
||||||
'locations.currency'
|
'locations.currency'
|
||||||
])->withCount('assignedAssets as assignedAssets_count')
|
])->withCount('assignedAssets as assigned_assets_count')
|
||||||
->withCount('assets as assets_count')
|
->withCount('assets as assets_count')
|
||||||
->withCount('users as users_count');
|
->withCount('users as users_count');
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ class LocationsController extends Controller
|
||||||
'locations.image',
|
'locations.image',
|
||||||
'locations.currency'
|
'locations.currency'
|
||||||
])
|
])
|
||||||
->withCount('assignedAssets as assignedAssets_count')
|
->withCount('assignedAssets as assigned_assets_count')
|
||||||
->withCount('assets as assets_count')
|
->withCount('assets as assets_count')
|
||||||
->withCount('users as users_count')->findOrFail($id);
|
->withCount('users as users_count')->findOrFail($id);
|
||||||
return (new LocationsTransformer)->transformLocation($location);
|
return (new LocationsTransformer)->transformLocation($location);
|
||||||
|
|
|
@ -32,7 +32,7 @@ class ApiLocationsCest
|
||||||
$response = json_decode($I->grabResponse(), true);
|
$response = json_decode($I->grabResponse(), true);
|
||||||
// sample verify
|
// sample verify
|
||||||
$location = App\Models\Location::orderByDesc('created_at')
|
$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();
|
->take(10)->get()->shuffle()->first();
|
||||||
$I->seeResponseContainsJson($I->removeTimestamps((new LocationsTransformer)->transformLocation($location)));
|
$I->seeResponseContainsJson($I->removeTimestamps((new LocationsTransformer)->transformLocation($location)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue