Commit 6395be7b by 杨昕

媒资类别列表

parent f82b7e02
Pipeline #9753 passed with stages
in 33 seconds
......@@ -19,7 +19,16 @@ class MediaCategoryModel extends Model
public static function catgList($request){
try{
$catgList = DB::connection("mongodb")->collection(self::$collection)->paginate(10);
$catgList = DB::connection("mongodb")->collection(self::$collection)->get()->toArray();
foreach ($catgList as &$catg){
$idArr = ($catg['_id'])->jsonSerialize();
$catg['_id'] = $catg['_id'] = $idArr['$oid'];
}
}catch (\Exception $exception){
throw new DatabaseException("组织不存在");
}
......
......@@ -23,13 +23,14 @@ class MediaModel extends Model
}
$users = DB::connection('mongodb')->collection('users')
$users = DB::connection('mongodb')->collection('media')
->where($where)
->paginate(10);
// dd($users);die;
foreach ( $users as $user){
foreach ( $users as &$user){
$idArr = ($user['_id'])->jsonSerialize();
$user['_id'] = $idArr['$oid'];
}
......
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