Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
8883939f
Commit
8883939f
authored
Oct 08, 2016
by
庄欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
促销的修改
parent
14aa8e1e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
20 deletions
+12
-20
app/Sets/Listeners/SetsEditedListener.php
+2
-10
app/Sets/Validation/SetsValidator.php
+10
-10
No files found.
app/Sets/Listeners/SetsEditedListener.php
View file @
8883939f
...
@@ -22,16 +22,7 @@ class SetsEditedListener
...
@@ -22,16 +22,7 @@ class SetsEditedListener
/**
/**
*修改促销信息等等
*修改促销信息等等
*/
*/
$searcher
=
Search
::
getSearcher
();
return
true
;
if
(
$model
->
is_del
==
0
&&
$model
->
is_shelf
==
$model
::
SHELF_UP
&&
$model
->
exists
==
true
)
{
//修改而非新增
if
(
$model
->
wasRecentlyCreated
==
false
)
{
if
(
$model
->
is_promotion
==
1
)
{
}
}
}
}
}
}
}
\ No newline at end of file
app/Sets/Validation/SetsValidator.php
View file @
8883939f
...
@@ -116,42 +116,42 @@ class SetsValidator extends Validator
...
@@ -116,42 +116,42 @@ class SetsValidator extends Validator
return
$messages
;
return
$messages
;
}
}
if
(
$data
[
"is_promotion"
]
==
1
&&
empty
(
$data
[
'promotion'
]
[
'id'
]
))
{
if
(
$data
[
"is_promotion"
]
==
1
&&
empty
(
$data
[
'promotion'
]))
{
if
(
$data
[
'promotion'
][
'promotion_start_time'
]
>=
$data
[
'promotion'
][
'promotion_end_time'
])
{
if
(
$data
[
'promotion'
][
0
][
'promotion_start_time'
]
>=
$data
[
'promotion'
][
0
][
'promotion_end_time'
])
{
$messages
[]
=
"特惠开始时间应小于特惠停止时间"
;
$messages
[]
=
"特惠开始时间应小于特惠停止时间"
;
return
$messages
;
return
$messages
;
}
}
if
((
int
)
$data
[
'promotion'
][
'per_user_count'
]
>
$data
[
'promotion'
][
'p_order_count'
])
{
if
((
int
)
$data
[
'promotion'
][
0
][
'per_user_count'
]
>
$data
[
'promotion'
][
0
][
'p_order_count'
])
{
$messages
[]
=
"特惠的限购额度应小于特惠数量"
;
$messages
[]
=
"特惠的限购额度应小于特惠数量"
;
return
$messages
;
return
$messages
;
}
}
if
(
$data
[
'promotion'
][
'p_order_count'
]
<=
0
)
{
if
(
$data
[
'promotion'
][
0
][
'p_order_count'
]
<=
0
)
{
$messages
[]
=
"特惠数量应大于0"
;
$messages
[]
=
"特惠数量应大于0"
;
return
$messages
;
return
$messages
;
}
}
if
(
$data
[
'promotion'
][
'promotion_start_time'
]
<
$data
[
'start_time'
])
{
if
(
$data
[
'promotion'
][
0
][
'promotion_start_time'
]
<
$data
[
'start_time'
])
{
$messages
[]
=
"特惠的开始时间应大于套系的起始有效时间"
;
$messages
[]
=
"特惠的开始时间应大于套系的起始有效时间"
;
return
$messages
;
return
$messages
;
}
}
if
(
$data
[
'promotion'
][
'promotion_end_time'
]
>
$data
[
'end_time'
])
{
if
(
$data
[
'promotion'
][
0
][
'promotion_end_time'
]
>
$data
[
'end_time'
])
{
$messages
[]
=
"特惠的结束时间应小于在套系终止有效时间"
;
$messages
[]
=
"特惠的结束时间应小于在套系终止有效时间"
;
return
$messages
;
return
$messages
;
}
}
$startdate
=
strtotime
(
$data
[
'promotion'
][
'promotion_start_time'
]);
$startdate
=
strtotime
(
$data
[
'promotion'
][
0
][
'promotion_start_time'
]);
$enddate
=
strtotime
(
$data
[
'promotion'
][
'promotion_end_time'
]);
$enddate
=
strtotime
(
$data
[
'promotion'
][
0
][
'promotion_end_time'
]);
$days
=
round
((
$enddate
-
$startdate
)
/
3600
/
24
)
;
$days
=
round
((
$enddate
-
$startdate
)
/
3600
/
24
)
;
if
(
$days
>
100
)
{
if
(
$days
>
100
)
{
$messages
[]
=
"特惠时间长度不应大于100天"
;
$messages
[]
=
"特惠时间长度不应大于100天"
;
return
$messages
;
return
$messages
;
}
}
if
(
$data
[
'promotion'
][
'promotion_price'
]
>=
$data
[
'price'
])
{
if
(
$data
[
'promotion'
][
0
][
'promotion_price'
]
>=
$data
[
'price'
])
{
$messages
[]
=
"特惠价格应小于套系价格"
;
$messages
[]
=
"特惠价格应小于套系价格"
;
return
$messages
;
return
$messages
;
}
}
if
(
$data
[
'promotion'
][
'promotion_price'
]
<
5
)
{
if
(
$data
[
'promotion'
][
0
][
'promotion_price'
]
<
5
)
{
$messages
[]
=
"特惠价格应大于5元"
;
$messages
[]
=
"特惠价格应大于5元"
;
return
$messages
;
return
$messages
;
}
}
...
...
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