Prechádzať zdrojové kódy

Merge branch 'refs/heads/peterguo-dev' into dev

peterguo 1 mesiac pred
rodič
commit
3316007732

+ 3 - 1
app/Http/Controllers/API/ContainerController.php

@@ -220,7 +220,9 @@ class ContainerController extends Controller
 
     public function linkage(string $libraryId)
     {
-        $items = Container::withCount('folder')->allowed()->where("library_id", $libraryId)->get(['id', 'name'])->each(function ($items) {
+        $items = Container::withCount(['folder' => function ($query) {
+            $query->where('parent_id', 0);
+        }])->allowed()->where("library_id", $libraryId)->get(['id', 'name'])->each(function ($items) {
             // 设置固定的type值
             $items->type = 'container';
             $items->uniId=$items->type.'_'.$items->id;