work on moving customers from tahesab
This commit is contained in:
@@ -208,9 +208,13 @@ class TahesabController extends Controller
|
|||||||
'type' => 2,
|
'type' => 2,
|
||||||
]);
|
]);
|
||||||
$success++;
|
$success++;
|
||||||
} catch (\Exception $e) {
|
} catch (\Throwable $e) {
|
||||||
$failed++;
|
$failed++;
|
||||||
$errors[] = ['name' => $item['name'], 'code' => $item['code'], 'error' => $e->getMessage()];
|
$msg = $e->getMessage();
|
||||||
|
if ($e instanceof \Illuminate\Database\QueryException && (int) ($e->errorInfo[1] ?? 0) === 1062) {
|
||||||
|
$msg = 'این مشتری از قبل در پنل ثبت شده است';
|
||||||
|
}
|
||||||
|
$errors[] = ['name' => $item['name'], 'code' => $item['code'], 'error' => $msg];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user