Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sarun Mungthanya
SpnPatch-Laravel
Commits
d4fa85b9
"...views/livewire/pages/parameter/parameter-edit.blade.php" did not exist on "2a80d6b356f43d840cccbddf2b0143fdc826823e"
Commit
d4fa85b9
authored
Dec 06, 2024
by
Sarun Mungthanya
Browse files
issue error sql primary duplicate
parent
9885e03c
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/SmartUpdateController.php
View file @
d4fa85b9
...
@@ -283,7 +283,6 @@ class SmartUpdateController extends Controller
...
@@ -283,7 +283,6 @@ class SmartUpdateController extends Controller
$serverchk
=
$resultImport
[
"total"
];
$serverchk
=
$resultImport
[
"total"
];
$SQL2
=
$resultImport
[
"sql"
];
$SQL2
=
$resultImport
[
"sql"
];
}
}
$patchCode
=
$patchDetails
->
PATCHCODE
;
$patchCode
=
$patchDetails
->
PATCHCODE
;
$patchCode
=
str_replace
(
'updatePatchFile("$$file_name_0", "$$file_data_0");'
,
''
,
$patchCode
);
$patchCode
=
str_replace
(
'updatePatchFile("$$file_name_0", "$$file_data_0");'
,
''
,
$patchCode
);
...
@@ -584,7 +583,6 @@ class SmartUpdateController extends Controller
...
@@ -584,7 +583,6 @@ class SmartUpdateController extends Controller
'sql'
=>
''
'sql'
=>
''
];
];
}
}
$dbType
=
config
(
'database.default'
);
$dbType
=
config
(
'database.default'
);
$quoteL
=
$dbType
===
'sqlsrv'
?
'['
:
'`'
;
$quoteL
=
$dbType
===
'sqlsrv'
?
'['
:
'`'
;
$quoteR
=
$dbType
===
'sqlsrv'
?
']'
:
'`'
;
$quoteR
=
$dbType
===
'sqlsrv'
?
']'
:
'`'
;
...
@@ -593,17 +591,21 @@ class SmartUpdateController extends Controller
...
@@ -593,17 +591,21 @@ class SmartUpdateController extends Controller
foreach
(
$rows
as
$row
)
{
foreach
(
$rows
as
$row
)
{
$values
=
[];
$values
=
[];
foreach
((
array
)
$row
as
$column
=>
$value
)
{
foreach
((
array
)
$row
as
$column
=>
$value
)
{
$escapedValue
=
str_replace
(
"'"
,
"''"
,
$value
);
$escapedValue
=
str_replace
(
"'"
,
"''"
,
$value
);
if
(
$escapedValue
===
'0000-00-00 00:00:00'
)
{
if
(
$escapedValue
===
'0000-00-00 00:00:00'
)
{
$escapedValue
=
'2000-01-01 00:00:00'
;
$escapedValue
=
'2000-01-01 00:00:00'
;
}
}
$values
[]
=
"'
$escapedValue
'"
;
if
(
$column
==
'amenddate'
)
{
$values
[]
=
"'"
.
$additionalColumns
[
'amenddate'
]
.
"'"
;
}
else
{
$values
[]
=
"'
$escapedValue
'"
;
}
}
}
$columns
=
array_keys
((
array
)
$row
);
$columns
=
array_keys
((
array
)
$row
);
$quotedColumns
=
array_map
(
fn
(
$col
)
=>
$quoteL
.
$col
.
$quoteR
,
$columns
);
$quotedColumns
=
array_map
(
fn
(
$col
)
=>
$quoteL
.
$col
.
$quoteR
,
$columns
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment