GoodsValidate.php
1.2 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
<?php
namespace app\api\validate;
class GoodsValidate extends BaseValidate
{
protected $rule = [
'sort' => 'require|in:1,2,3',
'lat' => 'require',
'lng' => 'require',
'page' => 'require|integer',
'goods_id' => 'require|integer',
'tag_id' => 'require',
'recruit_id' => 'require',
'job' => 'require',
'skill' => 'require',
'sign_id' => 'require',
'reason' => 'require'
];
protected $message = [
'sort.in' =>'排序类型选择错误',
'page.integer' =>'页数必须是整数'
];
protected $scene = [
'common' => ['page'], // 公共分页验证
'goods_detail' => ['goods_id'], // 商品详情
'talent' => ['sort','lat','lng','page'], // 人才列表
'talent_detail' => ['talent_id'], // 人才详情
'recruit' => ['sort','tag_id','lat','lng','page'], // 招募合伙人列表
'recruit_detail' => ['recruit_id','lat','lng'], // 招募合伙人详情
'sign' => ['recruit_id','job','skill'], // 报名
'team' => ['recruit_id'], // 团队成员
'del' => ['recruit_id','sign_id','reason'], // 移除团队成员
];
}