update
This commit is contained in:
parent
c755ea1db7
commit
0b8ff22189
@ -11,139 +11,139 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\validate\bid;
|
||||
|
||||
|
||||
use app\common\model\bid\BidBiddingDecision;
|
||||
use app\common\model\bid\BidSecurityApply;
|
||||
use app\common\model\dict\DictData;
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
|
||||
/**
|
||||
* BidSecurityApply验证器
|
||||
* Class BidSecurityApplyValidate
|
||||
* @package app\adminapi\validate\bid
|
||||
*/
|
||||
class BidSecurityApplyValidate extends BaseValidate
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置校验规则
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require|checkData',
|
||||
'bidding_decision_id' => 'require|checkBiddingDecision',
|
||||
'applier' => 'require',
|
||||
'pay_type' => 'require|checkPayType',
|
||||
'refund_date' => 'dateFormat:Y-m-d',
|
||||
'annex' => 'checkAnnex',
|
||||
'deposit_bank' => 'require',
|
||||
'account_name' => 'require',
|
||||
'account' => 'require',
|
||||
'flow_id' => 'require|checkFlow',
|
||||
'path' => 'require',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
'bidding_decision_id' => '投标决策',
|
||||
'applier' => '申请人',
|
||||
'pay_type' => '付款方式',
|
||||
'refund_date' => '预计退还时间',
|
||||
'deposit_bank' => '开户银行',
|
||||
'account_name' => '开户名称',
|
||||
'account' => '账号',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return BidSecurityApplyValidate
|
||||
* @author likeadmin
|
||||
* @date 2023/12/16 10:46
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑场景
|
||||
* @return BidSecurityApplyValidate
|
||||
* @author likeadmin
|
||||
* @date 2023/12/16 10:46
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->remove('flow_id',true)->remove('path',true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除场景
|
||||
* @return BidSecurityApplyValidate
|
||||
* @author likeadmin
|
||||
* @date 2023/12/16 10:46
|
||||
*/
|
||||
public function sceneDelete()
|
||||
{
|
||||
return $this->only(['id'])->remove('id','checkData');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 详情场景
|
||||
* @return BidSecurityApplyValidate
|
||||
* @author likeadmin
|
||||
* @date 2023/12/16 10:46
|
||||
*/
|
||||
public function sceneDetail()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
public function sceneApprove()
|
||||
{
|
||||
return $this->only(['id','flow_id','path']);
|
||||
}
|
||||
namespace app\adminapi\validate\bid;
|
||||
|
||||
public function checkData($value): bool|string
|
||||
{
|
||||
$data = BidSecurityApply::where('id',$value)->findOrEmpty();
|
||||
if($data->isEmpty()){
|
||||
return '数据不存在';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkBiddingDecision($value): bool|string
|
||||
{
|
||||
$data = BidBiddingDecision::where('id',$value)->findOrEmpty();
|
||||
if($data->isEmpty()){
|
||||
return '投标决策信息不存在';
|
||||
}
|
||||
if($data['is_margin'] != 1){
|
||||
return '此投标信息没有保证金';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
use app\common\model\bid\BidBiddingDecision;
|
||||
use app\common\model\bid\BidSecurityApply;
|
||||
use app\common\model\dict\DictData;
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
public function checkPayType($value): bool|string
|
||||
|
||||
/**
|
||||
* BidSecurityApply验证器
|
||||
* Class BidSecurityApplyValidate
|
||||
* @package app\adminapi\validate\bid
|
||||
*/
|
||||
class BidSecurityApplyValidate extends BaseValidate
|
||||
{
|
||||
$dict = DictData::where('type_value','pay_type')->column('value');
|
||||
if(!in_array($value,$dict)){
|
||||
return '付款方式无效';
|
||||
|
||||
/**
|
||||
* 设置校验规则
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require|checkData',
|
||||
'bidding_decision_id' => 'require|checkBiddingDecision',
|
||||
'applier' => 'require',
|
||||
'pay_type' => 'require|checkPayType',
|
||||
'refund_date' => 'dateFormat:Y-m-d',
|
||||
'annex' => 'checkAnnex',
|
||||
'deposit_bank' => 'require',
|
||||
'account_name' => 'require',
|
||||
'account' => 'require',
|
||||
'flow_id' => 'require|checkFlow',
|
||||
'path' => 'require',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
'bidding_decision_id' => '投标决策',
|
||||
'applier' => '申请人',
|
||||
'pay_type' => '付款方式',
|
||||
'refund_date' => '预计退还时间',
|
||||
'deposit_bank' => '开户银行',
|
||||
'account_name' => '开户名称',
|
||||
'account' => '账号',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return BidSecurityApplyValidate
|
||||
* @author likeadmin
|
||||
* @date 2023/12/16 10:46
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->remove('id', true)->remove('flow_id', true)->remove('path', true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑场景
|
||||
* @return BidSecurityApplyValidate
|
||||
* @author likeadmin
|
||||
* @date 2023/12/16 10:46
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->remove('flow_id', true)->remove('path', true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除场景
|
||||
* @return BidSecurityApplyValidate
|
||||
* @author likeadmin
|
||||
* @date 2023/12/16 10:46
|
||||
*/
|
||||
public function sceneDelete()
|
||||
{
|
||||
return $this->only(['id'])->remove('id', 'checkData');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 详情场景
|
||||
* @return BidSecurityApplyValidate
|
||||
* @author likeadmin
|
||||
* @date 2023/12/16 10:46
|
||||
*/
|
||||
public function sceneDetail()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
public function sceneApprove()
|
||||
{
|
||||
return $this->only(['id', 'flow_id', 'path']);
|
||||
}
|
||||
|
||||
public function checkData($value): bool|string
|
||||
{
|
||||
$data = BidSecurityApply::where('id', $value)->findOrEmpty();
|
||||
if ($data->isEmpty()) {
|
||||
return '数据不存在';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkBiddingDecision($value): bool|string
|
||||
{
|
||||
$data = BidBiddingDecision::where('id', $value)->findOrEmpty();
|
||||
if ($data->isEmpty()) {
|
||||
return '投标决策信息不存在';
|
||||
}
|
||||
// if($data['is_margin'] != 1){
|
||||
// return '此投标信息没有保证金';
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkPayType($value): bool|string
|
||||
{
|
||||
$dict = DictData::where('type_value', 'pay_type')->column('value');
|
||||
if (!in_array($value, $dict)) {
|
||||
return '付款方式无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user