updated asset in asset helper

This commit is contained in:
2019-07-08 23:30:58 -05:00
parent 9e198c3102
commit 7f49fbc107
2 changed files with 12 additions and 17 deletions
+11 -16
View File
@@ -134,23 +134,18 @@ class AssetHelper {
* Update an existing asset based off the esi pull
*/
private function UpdateAsset($asset) {
$count = Asset::where([
'item_id' => $asset->item_id,
])->count();
if($count != 0) {
Asset::where([
'item_id' => $asset->item_id,
])->update([
'is_singleton' => $asset->is_singleton,
'location_flag' => $asset->location_flag,
'location_id' => $asset->location_id,
'location_type' => $asset->location_type,
'quantity' => $asset->quantity,
'type_id' => $asset->type_id,
'updated_at' => Carbon::now(),
]);
}
Asset::where([
'item_id' => $asset->item_id,
])->update([
'is_singleton' => $asset->is_singleton,
'location_flag' => $asset->location_flag,
'location_id' => $asset->location_id,
'location_type' => $asset->location_type,
'quantity' => $asset->quantity,
'type_id' => $asset->type_id,
'updated_at' => Carbon::now(),
]);
}
}