lihaiMiddleOffice/app/psi/validate/OutboundProductValidate.php

93 lines
1.6 KiB
PHP

<?php
namespace app\psi\validate;
use app\common\validate\BaseValidate;
/**
* PsiOutboundProduct验证器
* Class OutboundProductValidate
* @package app\psi\validate
*/
class OutboundProductValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
'oid' => 'require',
'nums' => 'require',
'price' => 'require',
'total_price' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
'product_id' => '商品',
'batch' => '批次',
'nums' => '数量',
'price' => '零售价格',
'total_price' => '总价格',
'status' => '状态',
];
/**
* @notes 添加场景
* @return OutboundProductValidate
* @author admin
* @date 2025/03/10 11:08
*/
public function sceneAdd()
{
return $this->only(['oid']);
}
/**
* @notes 编辑场景
* @return OutboundProductValidate
* @author admin
* @date 2025/03/10 11:08
*/
public function sceneEdit()
{
return $this->only(['id', 'nums', 'price', 'total_price']);
}
/**
* @notes 删除场景
* @return OutboundProductValidate
* @author admin
* @date 2025/03/10 11:08
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return OutboundProductValidate
* @author admin
* @date 2025/03/10 11:08
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}