init: 项目初始代码
This commit is contained in:
28
app/api/validate/GoodsConnect.php
Normal file
28
app/api/validate/GoodsConnect.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace app\api\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class GoodsConnect extends Validate
|
||||
{
|
||||
/**
|
||||
* 定义验证规则
|
||||
* 格式:'字段名' => ['规则1','规则2'...]
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => ['require','integer','gt:0'],
|
||||
'goods_id|商品ID' => ['integer','require','gt:0'],
|
||||
'goods_category_id|商品分类ID' => ['integer','require','gt:0'],
|
||||
'connect_good_id|关联商品ID' => ['integer','gt:0','require'],
|
||||
];
|
||||
|
||||
/**
|
||||
* 定义错误信息
|
||||
* 格式:'字段名.规则名' => '错误信息'
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $message = [];
|
||||
}
|
||||
Reference in New Issue
Block a user