Explorar el Código

修改资产index接口&资产模型的需求数和计划数重写

langshi hace 9 meses
padre
commit
2e42b6dfd1
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      app/Http/Controllers/API/AssetController.php

+ 1 - 1
app/Http/Controllers/API/AssetController.php

@@ -30,7 +30,7 @@ class AssetController extends Controller
                 $fullAsset=  array_merge($parentAssets,$fullAsset);
             }
 
-        $resultAssets = Asset::whereIn('id', $fullAsset)->get(['id','parent_id','path','code'])->each(function ($asset) {
+        $resultAssets = Asset::whereIn('id', $fullAsset)->get()->each(function ($asset) {
             $asset->requirement_total = $asset->total_requirements_count;
             $asset->plan_total = $asset->total_plans_count;
         });