|
|
|
|
@ -186,8 +186,12 @@ public function Save(Request $request)
|
|
|
|
|
$bitian_zh[]='星期';
|
|
|
|
|
}
|
|
|
|
|
foreach ($bitian as $key => $field) { //必填项不能为空
|
|
|
|
|
if (array_key_exists($field, $planInfo) && $planInfo[$field] !== '' && $planInfo[$field] !== null && $planInfo[$field] !== [] && $planInfo[$field] !== 0) {
|
|
|
|
|
} else {
|
|
|
|
|
$allowZeroFields = ['max_total'];
|
|
|
|
|
$isValid = array_key_exists($field, $planInfo) && $planInfo[$field] !== '' && $planInfo[$field] !== null && $planInfo[$field] !== [];
|
|
|
|
|
if (!in_array($field, $allowZeroFields)) {
|
|
|
|
|
$isValid = $isValid && $planInfo[$field] !== 0;
|
|
|
|
|
}
|
|
|
|
|
if (!$isValid) {
|
|
|
|
|
return \Yz::echoError1($bitian_zh[$key] . ' 不能为空');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -524,8 +528,12 @@ public function SaveAdmin(Request $request)
|
|
|
|
|
$bitian_zh[]='星期';
|
|
|
|
|
}
|
|
|
|
|
foreach ($bitian as $key => $field) {
|
|
|
|
|
if (array_key_exists($field, $planInfo) && $planInfo[$field] !== '' && $planInfo[$field] !== null && $planInfo[$field] !== [] && $planInfo[$field] !== 0) {
|
|
|
|
|
} else {
|
|
|
|
|
$allowZeroFields = ['max_total'];
|
|
|
|
|
$isValid = array_key_exists($field, $planInfo) && $planInfo[$field] !== '' && $planInfo[$field] !== null && $planInfo[$field] !== [];
|
|
|
|
|
if (!in_array($field, $allowZeroFields)) {
|
|
|
|
|
$isValid = $isValid && $planInfo[$field] !== 0;
|
|
|
|
|
}
|
|
|
|
|
if (!$isValid) {
|
|
|
|
|
return \Yz::echoError1($bitian_zh[$key] . ' 不能为空');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|