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
5a32c541
Commit
5a32c541
authored
Jul 31, 2020
by
杨昕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' into 'master'
Test See merge request
!16
parents
1ac0eb13
9f72245b
Pipeline
#10251
passed with stages
in 42 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
Handler.php
app/Exceptions/Handler.php
+3
-3
MediaModel.php
app/Model/MediaModel.php
+17
-1
No files found.
app/Exceptions/Handler.php
View file @
5a32c541
...
@@ -56,9 +56,9 @@ class Handler extends ExceptionHandler
...
@@ -56,9 +56,9 @@ class Handler extends ExceptionHandler
$path
=
$request
->
path
();
$path
=
$request
->
path
();
var_dump
(
$exception
->
getMessage
());
//
var_dump($exception->getMessage());
var_dump
(
$exception
->
getFile
());
//
var_dump($exception->getFile());
var_dump
(
$exception
->
getLine
());
die
;
//
var_dump($exception->getLine());die;
#检测当前请求是否是api路由
#检测当前请求是否是api路由
...
...
app/Model/MediaModel.php
View file @
5a32c541
...
@@ -43,6 +43,9 @@ class MediaModel extends Eloquent
...
@@ -43,6 +43,9 @@ class MediaModel extends Eloquent
$limit
=
(
isset
(
$request
->
page_size
)
?
(
int
)(
$request
->
page_size
)
:
Constant
::
PAGE_NUMBER
)
;
$limit
=
(
isset
(
$request
->
page_size
)
?
(
int
)(
$request
->
page_size
)
:
Constant
::
PAGE_NUMBER
)
;
if
(
$limit
>
500
){
$limit
=
500
;
}
$page
=
$request
->
page
??
1
;
$page
=
$request
->
page
??
1
;
...
@@ -79,9 +82,17 @@ class MediaModel extends Eloquent
...
@@ -79,9 +82,17 @@ class MediaModel extends Eloquent
}
}
$aggregate
[][
'$sort'
]
=
[
'start_time'
=>
$sort
];
$aggregate
[][
'$sort'
]
=
[
'start_time'
=>
$sort
];
$count
=
sizeof
(
$collection
->
aggregate
(
$aggregate
)
->
toArray
());
$aggregate1
=
$aggregate
;
$aggregate1
[][
'$group'
]
=
[
'_id'
=>
array
(),
//更具性别进行分组
'count'
=>
array
(
'$sum'
=>
1
)
];
$count
=
$collection
->
aggregate
(
$aggregate1
)
->
toArray
()[
0
][
'count'
];
$skip
=
((
empty
(
$request
->
page
)
?
1
:
$request
->
page
)
-
1
)
*
$limit
;
$skip
=
((
empty
(
$request
->
page
)
?
1
:
$request
->
page
)
-
1
)
*
$limit
;
$aggregate
[][
'$skip'
]
=
$skip
;
$aggregate
[][
'$skip'
]
=
$skip
;
...
@@ -99,6 +110,7 @@ class MediaModel extends Eloquent
...
@@ -99,6 +110,7 @@ class MediaModel extends Eloquent
}
catch
(
\Exception
$exception
){
}
catch
(
\Exception
$exception
){
throw
new
DatabaseException
(
$exception
->
getMessage
());
throw
new
DatabaseException
(
$exception
->
getMessage
());
}
}
return
$medias
;
return
$medias
;
}
}
...
@@ -186,6 +198,8 @@ class MediaModel extends Eloquent
...
@@ -186,6 +198,8 @@ class MediaModel extends Eloquent
}
}
$id
=
MediaModel
::
insertGetId
(
$data
);
$id
=
MediaModel
::
insertGetId
(
$data
);
LogModel
::
addlog
([
"添加媒资信息"
=>
$data
,[
'媒资ID为:=> '
.
$id
]]);
}
catch
(
\Exception
$exception
){
}
catch
(
\Exception
$exception
){
throw
new
DatabaseException
(
$exception
->
getMessage
());
throw
new
DatabaseException
(
$exception
->
getMessage
());
}
}
...
@@ -263,6 +277,8 @@ class MediaModel extends Eloquent
...
@@ -263,6 +277,8 @@ class MediaModel extends Eloquent
throw
new
\Exception
(
"更新失败"
);
throw
new
\Exception
(
"更新失败"
);
}
}
LogModel
::
addlog
([
"更新媒资信息=>"
.
$id
,
$data
]);
}
catch
(
\Exception
$exception
){
}
catch
(
\Exception
$exception
){
throw
new
DatabaseException
(
$exception
->
getMessage
());
throw
new
DatabaseException
(
$exception
->
getMessage
());
}
}
...
...
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