From 01c7ff2ddf4c63db6736300579ff884445b71d85 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 3 Nov 2023 14:42:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/store/product/StoreMicro.php | 2 +- app/listener/paySuccessOrder.php | 22 ++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/app/controller/api/store/product/StoreMicro.php b/app/controller/api/store/product/StoreMicro.php index 3bdfac10..d2ec7752 100644 --- a/app/controller/api/store/product/StoreMicro.php +++ b/app/controller/api/store/product/StoreMicro.php @@ -111,7 +111,7 @@ class StoreMicro extends BaseController $find['extend'] = []; $find['param_temp_id'] = []; $find['mer_labels'] = []; - $find['delivery_way'] = [0 => "2"]; + $find['delivery_way'] = [0 => "2",1=>'1']; $find["guarantee_template_id"] = ""; $find['product_type'] = $product_type; $find['mer_cate_id'] = [0 => 0]; diff --git a/app/listener/paySuccessOrder.php b/app/listener/paySuccessOrder.php index 1d152951..003df3da 100644 --- a/app/listener/paySuccessOrder.php +++ b/app/listener/paySuccessOrder.php @@ -12,7 +12,9 @@ use app\common\repositories\system\merchant\MerchantRepository; use crmeb\utils\DingTalk; use think\facade\Db; use think\facade\Log; - +/** + * 支付后逻辑 + */ class paySuccessOrder { @@ -38,6 +40,24 @@ class paySuccessOrder if (!$merchant || $merchant['street_id'] == 0) { throw new \Exception('商户地址不存在', 200); } + if($merchant['type_id']==13){ + $codes=explode(',',$event['order']['user_address_code']); + $count_code=count($codes); + if($count_code>4){ + $merchant_two= Db::name('merchant')->where('street_id',$count_code[3])->where('type_id',17)->where('category_id',$merchant['category_id'])->find(); + if($merchant_two){ + $datas=[ + 'master_mer_id'=>$merchant['mer_id'], + 'mer_id'=>$merchant_two['mer_id'], + 'order_id'=>$event['order']['order_id'], + 'status'=>1 + ]; + Db::name('store_order_behalf')->insert($datas); + } + + } + } + $this->streetId = $merchant['street_id']; $commission_rate = ($event['order']['commission_rate'] / 100);