1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace app\common\validate;
- use think\Db;
- use think\Validate;
- class Dinner extends Validate{
- protected $rule = [
- 'name|食品名' => 'require',
- 'money|价格' => 'require',
- 'start_time|(预售)可以售卖的开始时间' => 'require',
- 'end_time|(预售)可以售卖的结束时间' => 'require',
- 'today_start_time|(当日)可以售卖的开始时间' => 'require',
- 'today_end_time|(当日)可以售卖的结束时间' => 'require',
- 'dinner_type_id|分类' => 'require',
- 'imgs|图片' => 'require',
- 'discount|折扣' => 'require|egt:0|elt:1',
- ];
- protected $message = [
- 'discount.require' => "折扣必须是0-1之间的值",
- 'discount.egt' => "折扣必须是0-1之间的值",
- 'discount.elt' => "折扣必须是0-1之间的值",
- 'imgs.elt' => "请上传图片",
- ];
- protected $scene = [
- 'cate0' => ['name','money','dinner_type_id','imgs','start_time','end_time','today_start_time','today_end_time','discount'],
- 'cate1' => ['name','money','dinner_type_id','imgs'],
- ];
- protected function checkUnique($value,$rule,$data=[])
- {
- }
- }
|