66 lines
1.3 KiB
PHP
66 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace app\api\validate;
|
|
use app\common\validate\BaseValidate;
|
|
|
|
|
|
/**
|
|
* 订单验证器
|
|
* Class OrderValidate
|
|
* @package app\admin\validate\order
|
|
*/
|
|
class OrderValidate extends BaseValidate
|
|
{
|
|
|
|
/**
|
|
* 设置校验规则
|
|
* @var string[]
|
|
*/
|
|
protected $rule = [
|
|
'verify_code' => 'require',
|
|
'refund_message' => 'require',
|
|
// 'refund_num' => 'require|number',
|
|
'id' => 'require|number',
|
|
'old_cart_id' => 'require|array',
|
|
'refund_type' => 'require|number',
|
|
];
|
|
|
|
|
|
/**
|
|
* 参数描述
|
|
* @var string[]
|
|
*/
|
|
protected $field = [
|
|
'verify_code' => '验证码',
|
|
'refund_message' => '退款原因',
|
|
// 'refund_num' => '退款数量',
|
|
'id' => '订单id',
|
|
'old_cart_id' => '购物车id',
|
|
'refund_type' => '退款申请类型',
|
|
];
|
|
|
|
|
|
/**
|
|
* @notes 添加场景
|
|
* @return OrderValidate
|
|
* @author likeadmin
|
|
* @date 2024/04/24 10:37
|
|
*/
|
|
public function sceneCheck()
|
|
{
|
|
return $this->only(['verify_code']);
|
|
}
|
|
|
|
/**
|
|
* @notes 退款场景
|
|
* @return OrderValidate
|
|
*/
|
|
public function sceneAdd()
|
|
{
|
|
return $this->only(['refund_message','id','old_cart_id','refund_type']);
|
|
}
|
|
|
|
|
|
|
|
}
|