Commit 2d0f40b4 by 杨昕

修改获取媒资数据格式

parent 41c5dbe2
Pipeline #9830 passed with stages
in 33 seconds
......@@ -32,6 +32,8 @@ class MediaController extends Controller
});
return success($result);
}
......
......@@ -75,6 +75,7 @@ class MediaModel extends Eloquent
*/
$media_info = explode("&",$request->media_name);
$mediaCatg = MediaCategoryModel::where('name',$request->media_type)->first();
if (empty($mediaCatg)){
throw new \Exception("媒资类别不存在");
......@@ -303,10 +304,15 @@ class MediaModel extends Eloquent
}
$res = [];
foreach ($tmp as $item){
$res[] = $item->groupBy("book_num");
}
if (isset($res[0]) || empty($res[0])){
return [];
}
return $res;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment