This commit is contained in:
weiz 2024-03-28 10:25:53 +08:00
parent 6319794258
commit 0d19ff833b

View File

@ -118,6 +118,7 @@
public function checkSecondLevel($value, $rule, $data): bool|string
{
if (empty($value)) return true;
$classify = MaterialClassify::where('id', $value)->where('pid', $data['first_level'])->findOrEmpty();
if ($classify->isEmpty()) {
return '材料中类不存在';
@ -127,6 +128,7 @@
public function checkThreeLevel($value, $rule, $data): bool|string
{
if (empty($value)) return true;
$classify = MaterialClassify::where('id', $value)->where('pid', $data['second_level'])->findOrEmpty();
if ($classify->isEmpty()) {
return '材料小类不存在';