StoreValidate.php
2.4 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace app\api\validate;
class StoreValidate extends BaseValidate
{
protected $rule = [
'page' => 'require|integer',
'store_icon' => 'require',
'store_name' => 'require',
'mobile' => 'require|regex:^1\d{10}$',
// 'province' => 'require',
// 'city' => 'require',
// 'region' => 'require',
'images' => 'require',
'content' => 'require',
'image' => 'require',
'house_ids' => 'require',
'type' => 'require|in:1,2',
'red_package' => 'require',
'msg_id' => 'require',
'number' => 'require',
'deposit_id' => 'require',
'inform_id' => 'require',
'goods_id' => 'require'
];
protected $message = [
'page.integer' =>'页数必须是整数',
'store_icon.require' =>'请上传店铺图标',
'store_name.require' =>'请填写店铺名称',
'house_ids.require' =>'请选择入驻社区',
'industry_id.require' =>'请选择行业/关键词',
'name.require' =>'请填写联系人姓名',
'mobile.require' =>'请填写联系人手机号',
'mobile.regex' =>'手机号格式错误',
'code.require' =>'请填写验证码',
'license.require' =>'请上传营业执照',
'content.require' =>'请填写内容',
];
protected $scene = [
'common' => ['page'], // 公共分页验证
'store_add' => ['store_name','house_ids','industry_id','name','mobile','code','license'], // 店铺申请
'store_apply' => ['store_name','province','city','region','name','mobile','code'], // 开通社区提交
'store_report' => ['content'], // 举报建议提交
'store_edit' => ['store_icon','store_name','mobile','images'], // 店铺信息修改
'store_inform_add' => ['content','house_ids','type'], // 发布信息
'store_inform_down' => ['type','inform_id'], // 下架/删除信息
'store_inform_score' => ['red_package'], // 计算金额
'red' => ['red_package','number'], // 发布信息红包
'house_new' => ['house_ids'], // 绑定社区
'comment_detail' => ['msg_id','page'], // 留言详情
'comment_detail_pt' => ['msg_id'], // 留言详情-平台
'comment_reply' => ['msg_id'], // 留言回复
'deposit_order' => ['deposit_id'], // 板币充值提交
'msg' => ['goods_id','content','mobile'], // 客服留言提交
];
}