From 66ac64a05a2b249e0ab2a276d052fecac084c723 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 16 Jan 2023 09:30:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=9B=E9=80=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/listener/CommunityAddress.php | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 app/listener/CommunityAddress.php 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; + } +}