오류 수정
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user