Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
newShopBack
Project
Project
Details
Activity
Releases
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
newshop
newShopBack
Commits
00fd98df
Commit
00fd98df
authored
Dec 26, 2019
by
侯贺政
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
时间验证问题
Signed-off-by:
houhezheng
<
houhezheng@romens.cn
>
parent
431bf16e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
GoodsDetailSettingController.php
...controllers/v1/shopgoods/GoodsDetailSettingController.php
+8
-9
No files found.
backend/controllers/v1/shopgoods/GoodsDetailSettingController.php
View file @
00fd98df
...
...
@@ -130,20 +130,19 @@ class GoodsDetailSettingController extends BaseController
if
(
!
$_model
)
{
throw
new
BadRequestHttpException
(
'该模板不存在'
);
}
//过滤掉部分为空的参数;
兼容启用关闭功能
//过滤掉部分为空的参数;
foreach
(
$params
as
$key
=>
$value
)
{
if
(
in_array
(
$key
,
[
'STATUS'
,
'START_TIME'
,
'END_TIME'
])
&&
(
empty
(
trim
(
$value
))
&&
$value
!=
'0'
))
{
unset
(
$params
[
$key
]);
switch
(
$key
)
{
case
'START_TIME'
:
$_model
->
START_TIME
=
date
(
'Y-m-d H:i:s'
,
$_model
->
START_TIME
);
break
;
case
'END_TIME'
:
$_model
->
END_TIME
=
date
(
'Y-m-d H:i:s'
,
$_model
->
END_TIME
);
break
;
}
}
}
//兼容启用关闭功能,防止时间格式验证失败
if
(
!
isset
(
$params
[
'START_TIME'
]))
{
$_model
->
START_TIME
=
date
(
'Y-m-d H:i:s'
,
$_model
->
START_TIME
);
}
if
(
!
isset
(
$params
[
'END_TIME'
]))
{
$_model
->
END_TIME
=
date
(
'Y-m-d H:i:s'
,
$_model
->
END_TIME
);
}
$_model
->
attributes
=
$params
;
if
(
!
$_model
->
save
())
{
...
...
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