erp/app/admin/validate/merchat/MerchantValidate.php
2024-04-23 18:03:12 +08:00

104 lines
2.4 KiB
PHP

<?php
namespace app\admin\validate\merchat;
use app\common\validate\BaseValidate;
/**
* 商户列表验证器
* Class MerchantValidate
* @package app\admin\validate\merchat
*/
class MerchantValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'mer_id' => 'require',
'category_id' => 'require',
'mer_name' => 'require',
'credit_buy' => 'require',
'settle_cycle' => 'require',
'interest_rate' => 'require',
'mer_address' => 'require',
'mark' => 'require',
'sort' => 'require',
'status' => 'require',
'service_phone' => 'require',
'mer_money' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'mer_id' => 'mer_id',
'category_id' => '商户分类',
'mer_name' => '商户名称',
'credit_buy' => '是否支持先货后款',
'settle_cycle' => '结算周期,单位天',
'interest_rate' => '利率',
'mer_address' => '商户地址',
'mark' => '商户备注',
'sort' => 'sort',
'status' => '商户是否禁用0锁定,1正常',
'service_phone' => '店铺电话',
'mer_money' => '商户余额',
];
/**
* @notes 添加场景
* @return MerchantValidate
* @author likeadmin
* @date 2024/04/23 16:35
*/
public function sceneAdd()
{
return $this->only(['category_id','mer_name','credit_buy','settle_cycle','interest_rate','mer_address','mark','sort','status','service_phone','mer_money']);
}
/**
* @notes 编辑场景
* @return MerchantValidate
* @author likeadmin
* @date 2024/04/23 16:35
*/
public function sceneEdit()
{
return $this->only(['mer_id','category_id','mer_name','credit_buy','settle_cycle','interest_rate','mer_address','mark','sort','status','service_phone','mer_money']);
}
/**
* @notes 删除场景
* @return MerchantValidate
* @author likeadmin
* @date 2024/04/23 16:35
*/
public function sceneDelete()
{
return $this->only(['mer_id']);
}
/**
* @notes 详情场景
* @return MerchantValidate
* @author likeadmin
* @date 2024/04/23 16:35
*/
public function sceneDetail()
{
return $this->only(['mer_id']);
}
}