@@ -50,17 +50,36 @@ public static function getFamily($conn, $families, $obje_ids, $sour_ids, $person
5050
5151 $ chan = $ family ->getChan ();
5252
53- $ husband_id = (isset ($ persons_id [$ husb ])) ? $ persons_id [$ husb ] : 0 ;
54- $ wife_id = (isset ($ persons_id [$ wife ])) ? $ persons_id [$ wife ] : 0 ;
53+ $ husband_id = (isset ($ persons_id [$ husb ])) ? $ persons_id [$ husb ] : 0 ;
54+ $ wife_id = (isset ($ persons_id [$ wife ])) ? $ persons_id [$ wife ] : 0 ;
5555
56- Family::on ($ conn )->updateOrCreate (
57- compact ('husband_id ' , 'wife_id ' , 'description ' , 'type_id ' , 'nchi ' , 'rin ' )
58- );
56+ // $family = Family::on($conn)->updateOrCreate(
57+ // compact('husband_id', 'wife_id', 'description', 'type_id', 'nchi', 'rin')
58+ // );
5959
6060 // $value = ['husband_id'=>$husband_id, 'wife_id'=>$wife_id, 'description'=>$description, 'type_id'=>$type_id, 'nchi'=>$nchi, 'rin'=>$rin];
6161 // $familydata [] = $value;
6262 }
6363 // Family::insert($familyData);
64+
65+ $ key = [
66+ ['husband_id ' , $ husband_id ], ['wife_id ' , $ wife_id ], ['description ' , $ description ], ['type_id ' , $ type_id ], ['nchi ' , $ nchi ],
67+ ['rin ' , $ rin ]
68+ ];
69+ $ check = Family::on ($ conn )->where ($ key )->first ();
70+ if (empty ($ check )) {
71+ $ value = ['husband_id ' =>$ husband_id , 'wife_id ' =>$ wife_id ];
72+
73+ $ FamilyData [] = $ value ;
74+ }
75+ // $person = Person::on($conn)->updateOrCreate($key,$value);
76+ // otherFields::insertOtherFields($conn,$individual,$obje_ids,$person);
77+
78+
79+ foreach (array_chunk ($ FamilyData , 200 ) as $ chunk ) {
80+ Family::on ($ conn )->insert ($ chunk );
81+ }
6482 otherFamRecord::insertFamilyData ($ conn , $ families , $ obje_ids , $ sour_ids );
6583 }
6684}
85+
0 commit comments