90 lines
1.7 KiB
PHP
90 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace app\admin\validate\warehouse_order;
|
|
|
|
|
|
use app\common\validate\BaseValidate;
|
|
|
|
|
|
/**
|
|
* 仓储商品单验证器
|
|
* Class WarehouseOrderValidate
|
|
* @package app\admin\validate\warehouse_order
|
|
*/
|
|
class WarehouseOrderValidate extends BaseValidate
|
|
{
|
|
|
|
/**
|
|
* 设置校验规则
|
|
* @var string[]
|
|
*/
|
|
protected $rule = [
|
|
'id' => 'require',
|
|
'warehouse_id' => 'require',
|
|
'batch' => 'require',
|
|
'total_price' => 'require',
|
|
'status' => 'require',
|
|
];
|
|
|
|
|
|
/**
|
|
* 参数描述
|
|
* @var string[]
|
|
*/
|
|
protected $field = [
|
|
'id' => 'id',
|
|
'warehouse_id' => '仓库',
|
|
'batch' => '批次',
|
|
'total_price' => '总价格',
|
|
'status' => '状态',
|
|
];
|
|
|
|
|
|
/**
|
|
* @notes 添加场景
|
|
* @return WarehouseOrderValidate
|
|
* @author admin
|
|
* @date 2024/08/20 10:50
|
|
*/
|
|
public function sceneAdd()
|
|
{
|
|
return $this->only(['warehouse_id','batch','total_price','status']);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 编辑场景
|
|
* @return WarehouseOrderValidate
|
|
* @author admin
|
|
* @date 2024/08/20 10:50
|
|
*/
|
|
public function sceneEdit()
|
|
{
|
|
return $this->only(['id','warehouse_id','batch','total_price','status']);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 删除场景
|
|
* @return WarehouseOrderValidate
|
|
* @author admin
|
|
* @date 2024/08/20 10:50
|
|
*/
|
|
public function sceneDelete()
|
|
{
|
|
return $this->only(['id']);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 详情场景
|
|
* @return WarehouseOrderValidate
|
|
* @author admin
|
|
* @date 2024/08/20 10:50
|
|
*/
|
|
public function sceneDetail()
|
|
{
|
|
return $this->only(['id']);
|
|
}
|
|
|
|
} |