fix mapping profile
This commit is contained in:
parent
968938a100
commit
f9d7317dea
@ -104,7 +104,7 @@ class API_DictMappings extends ResourceController {
|
|||||||
return $this->fail($response , 409);
|
return $this->fail($response , 409);
|
||||||
}
|
}
|
||||||
// getting mapid after
|
// getting mapid after
|
||||||
if($update == 0) { $update =$db->insertID(); }
|
if($update == 0) { $update = $db->insertID(); }
|
||||||
|
|
||||||
// dict_mapping_profiles
|
// dict_mapping_profiles
|
||||||
$datasource = '';
|
$datasource = '';
|
||||||
@ -117,7 +117,7 @@ class API_DictMappings extends ResourceController {
|
|||||||
WHEN NOT MATCHED BY TARGET THEN
|
WHEN NOT MATCHED BY TARGET THEN
|
||||||
INSERT (MAPID, LISCODE)
|
INSERT (MAPID, LISCODE)
|
||||||
VALUES (s.MAPID, s.LISCODE)
|
VALUES (s.MAPID, s.LISCODE)
|
||||||
WHEN NOT MATCHED BY SOURCE THEN
|
WHEN NOT MATCHED BY SOURCE and t.MAPID='$update' THEN
|
||||||
DELETE;";
|
DELETE;";
|
||||||
|
|
||||||
if( $db->query($sql) ) {
|
if( $db->query($sql) ) {
|
||||||
|
|||||||
@ -183,6 +183,13 @@ function editProfile(mapid) {
|
|||||||
$("#updateProfile").val(mapid);
|
$("#updateProfile").val(mapid);
|
||||||
$("#hiscodeProfile").val(data.HISCODE);
|
$("#hiscodeProfile").val(data.HISCODE);
|
||||||
$("#descsProfile").val(data.DESCS);
|
$("#descsProfile").val(data.DESCS);
|
||||||
|
// empty mliscode
|
||||||
|
for (let i = 1; i <= 22; i++) {
|
||||||
|
let id = `.mliscode${i}`;
|
||||||
|
let element = $(id);
|
||||||
|
element.val('');
|
||||||
|
}
|
||||||
|
// populate mliscode
|
||||||
for (let i = 0; i < data.mliscodes.length; i++) {
|
for (let i = 0; i < data.mliscodes.length; i++) {
|
||||||
const fieldId = `mliscode${i + 1}`;
|
const fieldId = `mliscode${i + 1}`;
|
||||||
$(`.${fieldId}`).val(data.mliscodes[i].LISCODE);
|
$(`.${fieldId}`).val(data.mliscodes[i].LISCODE);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user