Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ypl_mobile_web
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
邓丽
ypl_mobile_web
Commits
df751eb6
Commit
df751eb6
authored
Apr 19, 2016
by
庄欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台开发版本
parent
05dcc083
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
0 deletions
+84
-0
app/validation/AttachmentValidation.php
+24
-0
app/validation/BaseValidation.php
+16
-0
app/validation/PromotionValidation.php
+44
-0
No files found.
app/validation/AttachmentValidation.php
0 → 100644
View file @
df751eb6
<?php
namespace
validattion
;
use
Phalcon\Validation
;
use
Phalcon\Validation\Validator\StringLength
;
use
Phalcon\Validation\Validator\PresenceOf
;
use
Phalcon\Validation\Validator\Between
;
use
Phalcon\Validation\Validator\Numericality
;
class
AttachmentValidation
extends
BaseValidation
{
public
function
initialize
()
{
$this
->
add
(
'promotion_price'
,
new
PresenceOf
([
'message'
=>
'请输入促销金额'
]));
$this
->
add
(
'promotion_price'
,
new
Numericality
([
'message'
=>
'促销金额必须是数字'
]));
}
}
\ No newline at end of file
app/validation/BaseValidation.php
0 → 100644
View file @
df751eb6
<?php
namespace
validattion
;
use
Phalcon\Validation
;
class
BaseValidation
extends
Validation
{
public
function
getMessages
()
{
$msg
=
[];
foreach
(
parent
::
getMessages
()
as
$message
)
{
$msg
[]
=
$message
;
}
return
implode
(
";"
,
$msg
);
}
}
app/validation/PromotionValidation.php
0 → 100644
View file @
df751eb6
<?php
namespace
validattion
;
use
Phalcon\Validation
;
use
Phalcon\Validation\Validator\StringLength
;
use
Phalcon\Validation\Validator\PresenceOf
;
use
Phalcon\Validation\Validator\Between
;
use
Phalcon\Validation\Validator\Numericality
;
class
PromotionValidation
extends
BaseValidation
{
public
function
initialize
()
{
$this
->
add
(
'promotion_price'
,
new
PresenceOf
([
'message'
=>
'请输入促销金额'
]));
$this
->
add
(
'promotion_price'
,
new
Numericality
([
'message'
=>
'促销金额必须是数字'
]));
$this
->
add
(
'count'
,
new
PresenceOf
([
'message'
=>
'请输入促销限量'
]));
$this
->
add
(
'count'
,
new
Numericality
([
'message'
=>
'促销限量必须是数字'
]));
$this
->
add
(
'per_user_count'
,
new
PresenceOf
([
'message'
=>
'请输入每位用户限购额度'
]));
$this
->
add
(
'per_user_count'
,
new
Numericality
([
'message'
=>
'限购额度必须是数字'
]));
$this
->
add
(
'start_time'
,
new
PresenceOf
([
'message'
=>
'请输入促销开始时间'
]));
$this
->
add
(
'end_time'
,
new
PresenceOf
([
'message'
=>
'请输入促销结束时间'
]));
}
}
\ No newline at end of file
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