1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace app\admin\validate\package;
- use think\Validate;
- class PackageGoodsValidate extends Validate
- {
- protected $rule = [
- 'goods_name' => 'require',
- 'goods_titile' => 'require',
- 'goods_id' => 'require',
- 'goods_category_id' => 'require',
- 'goods_price' => 'require',
- 'goods_nape' => 'require',
- 'goods_equity' => 'require',
- 'goods_img' => 'require|min:0',
- 'goods_status' => 'require',
- 'goods_num' => 'require',
- 'goods_num_type' => 'require',
- 'goods_num_unit' => 'require',
- 'goods_type' => 'require',
- ];
- protected $message = [
- 'goods_name.require' => '产品名称称不能为空',
- 'goods_id.require' => 'id不能为空',
- 'goods_category_id.require' => '所属分类不能为空',
- 'goods_titile.require' => '简介不能为空',
- 'goods_equity.require' => '服务权益不能为空',
- 'goods_img.require' => '图片不能为空',
- 'goods_nape.require' => '服务细项不能为空',
- 'goods_type.require' => '权益类型不能为空',
- 'goods_status.require' => '状态不能为空',
- 'goods_num.require' => '使用次数不能为空',
- 'goods_num_type.require' => '有效天数不能为空',
- 'goods_num_unit.require' => '单位不能为空',
- 'goods_price.require' => '价格不能为空',
- ];
- //场景
- protected $scene = [
- 'add' => ['goods_name','goods_category_id','goods_price','goods_type','goods_titile','goods_equity','goods_img','goods_nape','goods_num','goods_num_unit','goods_num_type',],
- 'update' => ['goods_id'],
- 'info' => ['goods_id'],
- 'del' => ['goods_id']
- ];
- }
|