29 lines
623 B
PHP
29 lines
623 B
PHP
<?php
|
|
namespace app\api\validate;
|
|
|
|
use think\Validate;
|
|
|
|
class GoodsBuyNow extends Validate
|
|
{
|
|
/**
|
|
* 定义验证规则
|
|
* 格式:'字段名' => ['规则1','规则2'...]
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $rule = [
|
|
'id' => ['integer'],
|
|
'goods_id|商品ID' => ['require','integer','gt:0'],
|
|
'name|链接名称' => ['require','length:1,128'],
|
|
'url|链接地址' => ['require','length:1,128'],
|
|
];
|
|
|
|
/**
|
|
* 定义错误信息
|
|
* 格式:'字段名.规则名' => '错误信息'
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $message = [];
|
|
}
|