项目相关接口、图片视频上传
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user