From 71a381a88249b223ee24c0784f83ab7f61e340a0 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Sun, 21 Apr 2024 13:59:03 +0800 Subject: [PATCH] 1 --- app/api/model/user/IdentityOrder.php | 4 +++- app/api/service/Goods.php | 16 ++-------------- app/api/service/Notify.php | 4 ++++ app/api/service/identity/Payment.php | 2 +- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/app/api/model/user/IdentityOrder.php b/app/api/model/user/IdentityOrder.php index e7ac9343..2651b8d7 100644 --- a/app/api/model/user/IdentityOrder.php +++ b/app/api/model/user/IdentityOrder.php @@ -29,11 +29,12 @@ class IdentityOrder extends BaseIdentityOrder /** * @notes:创建订单 * @param array $identityInfo + * @param $method * @return bool * @throws BaseException * @author: wanghousheng */ - public function createOrder(array $identityInfo): bool + public function createOrder(array $identityInfo, $method): bool { $data = [ 'user_id' => UserService::getCurrentLoginUserId(), @@ -43,6 +44,7 @@ class IdentityOrder extends BaseIdentityOrder 'pay_price' => $identityInfo['price'], 'month' => $identityInfo['month'], 'platform' => getPlatform(), + 'pay_method' => $method, 'store_id' => self::$storeId, ]; return $this->save($data); diff --git a/app/api/service/Goods.php b/app/api/service/Goods.php index 1be938a2..32cc9cf6 100644 --- a/app/api/service/Goods.php +++ b/app/api/service/Goods.php @@ -174,24 +174,12 @@ class Goods extends GoodsService public function brandList($storeid) { $model = new GoodsModel; - - $goodsList = $model->getList([ - 'status' => 10, - 'is_delete' => 0, - 'is_brand' => $_GET['is_brand'], - 'is_new' => $_GET['is_new'], - 'is_in_store' => $_GET['is_in_store'] ?? '',//是否店内 - 'store_id' => $storeid, - 'categoryId' => (int)$_GET['categoryId'], - ], 15); - + $parmas = $this->request->get(); + $goodsList = $model->getList($parmas); if (empty($goodsList) && $goodsList->isEmpty()) { return []; } $list = $goodsList->toArray(); - // echo "
";
-        // print_r($list);
-        // exit()
         $list['data'] = $this->newFormatGoodsList($list['data']);
         return $list;
 
diff --git a/app/api/service/Notify.php b/app/api/service/Notify.php
index 74643325..738e9ca6 100644
--- a/app/api/service/Notify.php
+++ b/app/api/service/Notify.php
@@ -26,6 +26,7 @@ use app\common\library\payment\Facade as PaymentFacade;
 use app\common\library\payment\gateway\Driver;
 use app\common\library\payment\gateway\driver\wechat\V3 as WechatPaymentV3;
 use cores\exception\BaseException;
+use think\facade\Db;
 
 /**
  * 服务类:第三方支付异步通知
@@ -67,6 +68,7 @@ class Notify
      */
     public function wechatV3(): string
     {
+        Db::table('yoshop_wx_server')->insertGetId(['content' => '进入v3', 'created_at' => date('Y-m-d H:i:s')]);
         try {
             // 通过微信支付v3平台证书序号 获取支付模板
             $wechatpaySerial = \request()->header('wechatpay-serial');
@@ -131,6 +133,7 @@ class Notify
      */
     private function orderPaySucces(PaymentTradeModel $tradeInfo, array $paymentData)
     {
+        Db::table('yoshop_wx_server')->insertGetId(['content' => '第一步', 'created_at' => date('Y-m-d H:i:s')]);
         // 记录日志
         Log::append('Notify-orderPaySucces', [
             'orderType' => OrderTypeEnum::data()[$tradeInfo['order_type']]['name'],
@@ -166,6 +169,7 @@ class Notify
             }
             // 订单支付成功业务处理 (开通会员、分销商)
             if ($tradeInfo['order_type'] == OrderTypeEnum::MEMBER || $tradeInfo['order_type'] == OrderTypeEnum::DEALER) {
+                Db::table('yoshop_wx_server')->insertGetId(['content' => '进入异步通知开始处理会员分销业务', 'created_at' => date('Y-m-d H:i:s')]);
                 $service = new identity\PaySuccess();
                 $service->setOrderNo($tradeInfo['order_no'])
                     ->setMethod($tradeInfo['pay_method'])
diff --git a/app/api/service/identity/Payment.php b/app/api/service/identity/Payment.php
index 4c7d8f1f..15746759 100644
--- a/app/api/service/identity/Payment.php
+++ b/app/api/service/identity/Payment.php
@@ -166,7 +166,7 @@ class Payment extends BaseService
         if (UserService::isDealerMember() && $info['type'] != IdentityEnum::DEALER) {
             throwError('非法操作');
         }
-        if (!$model->createOrder($info->toArray())) {
+        if (!$model->createOrder($info->toArray(), $this->method)) {
             throwError($model->getError() ?: '创建订单失败');
         }
         $model['order_id'] = (int)$model['order_id'];