OrderValidate.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Created by PhpStorm.
* User: 29925
* Date: 2018/8/16
* Time: 15:21
*/
namespace app\admin\validate;
use think\Validate;
class OrderValidate extends Validate
{
protected $rule = [
'user_id' => 'require',
'sort_id' => 'require',
'order_sn' => 'require',
'options' => 'require',
'number' => 'require|number',
'over_time' => 'require',
];
protected $message = [
'user_id.require' => '用户ID不能为空',
'sort_id.require' => '订单类型不能为空',
'options.require' => '订单内容不能为空',
'order_sn.require' => '订单号不能为空',
'number.require' => '订单确认码不能为空',
'number.number' => '订单确认码必须为数字',
'over_time.require' => '超时时间不能为空',
];
protected $scene = [
'add' => ['user_id', 'sort_id', 'options', 'order_sn', 'number', 'over_time'],
'edit' => ['options'],
];
}