structure fuel

This commit is contained in:
2019-07-08 20:58:37 -05:00
parent b2bd070c9c
commit 9f9a190cc9
5 changed files with 95 additions and 54 deletions
+12 -1
View File
@@ -110,13 +110,24 @@ class AssetHelper {
* Get the liquid ozone asset
*/
public function GetAssetByType($type, $structureId) {
//See if the row is in the database table
$count = Asset::where([
'location_id' => $structureId,
'type_id' => $type,
'location_flag' => 'StructureFuel',
])->count();
//Get the row if it is in the table
$asset = Asset::where([
'location_id' => $structureId,
'type_id' => $type,
'location_flag' => 'StructureFuel',
])->first();
return $asset['quantity'];
if($count == 0) {
return 0;
} else {
return $asset['quantity'];
}
}
/**