Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
media-resource
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨昕
media-resource
Commits
6395be7b
Commit
6395be7b
authored
Jul 02, 2020
by
杨昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
媒资类别列表
parent
f82b7e02
Pipeline
#9753
passed with stages
in 33 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
MediaCategoryModel.php
app/Model/MediaCategoryModel.php
+10
-1
MediaModel.php
app/Model/MediaModel.php
+3
-2
No files found.
app/Model/MediaCategoryModel.php
View file @
6395be7b
...
@@ -19,7 +19,16 @@ class MediaCategoryModel extends Model
...
@@ -19,7 +19,16 @@ class MediaCategoryModel extends Model
public
static
function
catgList
(
$request
){
public
static
function
catgList
(
$request
){
try
{
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
){
}
catch
(
\Exception
$exception
){
throw
new
DatabaseException
(
"组织不存在"
);
throw
new
DatabaseException
(
"组织不存在"
);
}
}
...
...
app/Model/MediaModel.php
View file @
6395be7b
...
@@ -23,13 +23,14 @@ class MediaModel extends Model
...
@@ -23,13 +23,14 @@ class MediaModel extends Model
}
}
$users
=
DB
::
connection
(
'mongodb'
)
->
collection
(
'users'
)
$users
=
DB
::
connection
(
'mongodb'
)
->
collection
(
'media'
)
->
where
(
$where
)
->
where
(
$where
)
->
paginate
(
10
);
->
paginate
(
10
);
// dd($users);die;
// dd($users);die;
foreach
(
$users
as
$user
){
foreach
(
$users
as
&
$user
){
$idArr
=
(
$user
[
'_id'
])
->
jsonSerialize
();
$idArr
=
(
$user
[
'_id'
])
->
jsonSerialize
();
$user
[
'_id'
]
=
$idArr
[
'$oid'
];
$user
[
'_id'
]
=
$idArr
[
'$oid'
];
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment