오류 수정

This commit is contained in:
2026-02-11 21:51:10 +09:00
parent b0e7cf0df0
commit 99a072f732
5 changed files with 80 additions and 20 deletions

View File

@@ -152,18 +152,24 @@ class Processible extends BaseController
$rows = $this->request->getPost('rows');
$rows = json_decode($rows, true);
// dd($rows);
// exit;
if (count($rows) > 0) {
$results = [];
$hasError = false;
foreach ($rows as $row):
$this->model->saveCount($row);
$result = $this->model->saveCount($row);
$results[] = $result;
if (!$result['success']) {
$hasError = true;
}
endforeach;
return $this->response->setJSON([
'code' => '0',
'msg' => 'success'
'code' => $hasError ? '9' : '0',
'msg' => $hasError ? '일부 저장 실패' : 'success',
'debug' => $results // 디버깅 정보 포함
]);
} else {