dyjh há 6 anos atrás
pai
commit
dd708794dd
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      app/Http/Controllers/Api/V1/AlbumController.php

+ 1 - 1
app/Http/Controllers/Api/V1/AlbumController.php

xqd
@@ -1457,7 +1457,7 @@ class AlbumController extends Controller
         if ($validator->fails()) {
             return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
         }
-        $cat_id = $request->input('cat_id');
+        $cat_id = $request->input('cat_id') ?? 0;
         $store_id = request('store_id');
         $cats = AlbumCatModel::where([['parent_id',$cat_id],['store_id',$store_id]])->orderByDesc('sort')->get();
         return $this->api($cats);