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
fe8bb9ca
Commit
fe8bb9ca
authored
Jul 06, 2020
by
杨昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code format
parent
598c1633
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
UsersController.php
app/Http/Controllers/Api/Client/UsersController.php
+1
-1
MediaCategoryModel.php
app/Model/MediaCategoryModel.php
+5
-8
No files found.
app/Http/Controllers/Api/Client/UsersController.php
View file @
fe8bb9ca
...
@@ -35,7 +35,7 @@ class UsersController extends Controller
...
@@ -35,7 +35,7 @@ class UsersController extends Controller
if
(
preg_match
(
"['|
\"
|\/|
\\
\|\.|:]"
,
$request
->
uuid
))
{
if
(
preg_match
(
"['|
\"
|\/|
\\
\|\.|:]"
,
$request
->
uuid
))
{
throw
new
ControllerException
(
400
,
'uuid含有非法字符'
);
throw
new
ControllerException
(
'uuid含有非法字符'
,
400
);
}
}
$password
=
strtolower
(
$request
->
password
);
$password
=
strtolower
(
$request
->
password
);
$username
=
$request
->
username
;
$username
=
$request
->
username
;
...
...
app/Model/MediaCategoryModel.php
View file @
fe8bb9ca
...
@@ -11,6 +11,10 @@ class MediaCategoryModel extends Eloquent
...
@@ -11,6 +11,10 @@ class MediaCategoryModel extends Eloquent
{
{
protected
$collection
=
"media_category"
;
protected
$collection
=
"media_category"
;
protected
$connection
=
'mongodb'
;
//使用mongodb
protected
$primaryKey
=
'_id'
;
/**
/**
* 查询媒资列表
* 查询媒资列表
* @param $request
* @param $request
...
@@ -21,14 +25,7 @@ class MediaCategoryModel extends Eloquent
...
@@ -21,14 +25,7 @@ class MediaCategoryModel extends Eloquent
try
{
try
{
$catgList
=
DB
::
connection
(
"mongodb"
)
->
collection
(
self
::
$collection
)
->
get
()
->
toArray
();
$catgList
=
MediaCategoryModel
::
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
(
"组织不存在"
);
...
...
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