From cd5932e051504518e05bc4e8610ea15345dc39b8 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Wed, 13 Sep 2023 14:35:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=95=86=E6=88=B7=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E5=8F=91=E5=B8=83=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/store/merchant/MerchantIntention.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 3a8383ad..fc55dce3 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -70,9 +70,43 @@ class MerchantIntention extends BaseController 'id' => $intention->mer_intention_id ] ]); + $areaInfo = Db::name('geo_area')->where('area_code', $data['area_id'] ?? '')->find(); + $cityId = Db::name('geo_city')->where('city_code', $areaInfo['city_code'] ?? '')->value('city_id', 0); + $streetId = Db::name('geo_street')->where('street_code', $data['street_id'] ?? '')->value('street_id', 0); + $sendData = [ + 'company_name' => $data['mer_name'], + 'organization_code' => $data['social_credit_code'] ?? '', + 'master_name' => $data['name'], + 'master_phone' => $data['phone'], + 'city' => $cityId, + 'area' => $areaInfo['area_id'] ?? 0, + 'street' => $streetId, + 'mer_intention_id' => $intention->mer_intention_id + ]; return app('json')->success('提交成功'); } + //发送商户入驻申请 + public function sendMerIntentionApply($data) + { + $postUrl = env('TASK_WORKER_HOST_URL') . '/api/lstSet'; + Log::info("商户入驻申请HOST: {$postUrl}"); + Log::info("发送商户入驻申请信息: " . json_encode($data)); + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $postUrl); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost); + $data = curl_exec($ch); + curl_close($ch); + $ok = false; + if (!empty($data) && is_string($data)) { + Log::info("商户入驻申请反馈信息" . json_encode($data)); + } + return $ok; + } + public function update($id) { if (!$this->repository->getWhere(['mer_intention_id' => (int)$id, 'uid' => $this->userInfo->uid, 'is_del' => 0])) @@ -126,6 +160,7 @@ class MerchantIntention extends BaseController 'images', 'merchant_category_id', 'mer_type_id', + 'social_credit_code', 'area_id', 'street_id', 'village_id',