contract active api

This commit is contained in:
glovetleong
2021-07-27 09:28:51 +08:00
parent 247b21010e
commit 7f209db917
14 changed files with 402 additions and 28 deletions
+15
View File
@@ -82,6 +82,21 @@ class ExistCheck implements Rule
}
}
if ($this->type == 'contract_active') {
foreach ($value as $key => $row) {
if(!empty($row)) {
$id = Hasher::decode('contracts', $row);
$data = Contract::
where('id', $id)
->where('status', config('constants.contract.status.active'))
->count();
if (!$data) {
return false;
}
}
}
}
if ($this->type == 'contract_entity') {
foreach ($value as $key => $row) {
if(!empty($row)) {