项目相关接口、图片视频上传

This commit is contained in:
2025-05-06 16:18:22 +08:00
parent cbd0b19b91
commit cd304275b8
14 changed files with 416 additions and 21 deletions

View File

@@ -141,16 +141,18 @@ class BaseController
$result = [];
foreach ($checkFields as $fieldName) {
$checkValue = $data[$fieldName] ?? '';
if (is_array($checkValue)) {
$checkValue = json_encode($checkValue);
}
if (mb_strlen(strval($checkValue)) <= 0 && !in_array($fieldName, $this->notRequest)) {
$requiredFields[] = $fieldName;
if (is_array($checkValue) && !empty($checkValue)) {
$result[$fieldName] = $checkValue;
} else {
if (!empty($checkValue) || $checkValue === 0) {
$result[$fieldName] = $checkValue;
if (mb_strlen(strval($checkValue)) <= 0 && !in_array($fieldName, $this->notRequest)) {
$requiredFields[] = $fieldName;
} else {
if (!empty($checkValue) || $checkValue === 0) {
$result[$fieldName] = $checkValue;
}
}
}
}
if ($throw && $requiredFields) {