diff --git a/app/listener/CommunityAddress.php b/app/listener/CommunityAddress.php new file mode 100644 index 00000000..778dca1d --- /dev/null +++ b/app/listener/CommunityAddress.php @@ -0,0 +1,33 @@ +where('user_id', $event['uid'])->find(); + if ($find && $find['village_id'] != 0) { + $data = [ + 'user_id' => $event['uid'], + 'area_id' => $find['area_id'], + 'street_id' => $find['street_id'], + 'village_id' => $find['village_id'], + 'village_code' => $find['village_code'], + 'brigade_id' => $find['brigade_id'], + 'community_id' => $event['community_id'] + ]; + Db::name('community_address')->insert($data); + return true; + } + return false; + } +}