Skip to content

Commit c315231

Browse files
committed
改用 Arr::has 取代 array_has
1 parent 5fd6c9d commit c315231

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

app/Http/Controllers/BasicInformationOfficesController.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,14 @@ public function destroy($id, $office)
270270
protected function serialAddr(Array $array){
271271
$res = [];
272272
// dd($array);
273-
foreach ($array as $item)
274-
if (array_has($res, $item['pivot']['c_posting_id'])) $res[$item['pivot']['c_posting_id']] = $res[$item['pivot']['c_posting_id']].';'.$item['c_name_chn'];
275-
else $res[$item['pivot']['c_posting_id']] = $item['c_name_chn'];
273+
foreach ($array as $item) {
274+
$postingId = $item['pivot']['c_posting_id'];
275+
if (Arr::has($res, $postingId)) {
276+
$res[$postingId] = $res[$postingId].';'.$item['c_name_chn'];
277+
} else {
278+
$res[$postingId] = $item['c_name_chn'];
279+
}
280+
}
276281
return $res;
277282
}
278283
}

0 commit comments

Comments
 (0)