Skip to content

Commit fe87704

Browse files
sort query for insert multiple record
1 parent 4e024ca commit fe87704

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Utils/ParentData.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ public static function getPerson($conn, $individuals, $obje_ids, $sour_ids)
9797
if (empty($check)) {
9898
$value = ['name' => $name, 'givn' => $givn, 'surn' => $surn, 'sex' => $sex, 'uid' => $uid, 'rin' => $rin, 'resn' => $resn, 'rfn' => $rfn, 'afn' => $afn];
9999

100-
//$ParentData[] = $value;
101-
Person::on($conn)->insert($value);
100+
$ParentData[] = $value;
102101
}
103102
// $person = Person::on($conn)->updateOrCreate($key,$value);
104103
// otherFields::insertOtherFields($conn,$individual,$obje_ids,$person);
@@ -107,6 +106,8 @@ public static function getPerson($conn, $individuals, $obje_ids, $sour_ids)
107106
/* foreach (array_chunk($ParentData, 200) as $chunk) {
108107
Person::on($conn)->insert($chunk);
109108
} */
109+
// it's take only 1 second for 3010 record
110+
Person::on($conn)->insert($ParentData);
110111
otherFields::insertOtherFields($conn, $individuals, $obje_ids, $sour_ids);
111112
}
112113
catch (\Exception $e) {

0 commit comments

Comments
 (0)