Procházet zdrojové kódy

修复订单数据

hefei před 1 rokem
rodič
revize
7a08e6da82
2 změnil soubory, kde provedl 60 přidání a 26 odebrání
  1. 35 0
      app/command/repairPaySuccess.php
  2. 25 26
      app/controller/api/Notify.php

+ 35 - 0
app/command/repairPaySuccess.php

@@ -0,0 +1,35 @@
1
+<?php
2
+declare (strict_types=1);
3
+
4
+namespace app\command;
5
+
6
+use app\common\repositories\store\order\StoreGroupOrderRepository;
7
+use app\common\repositories\store\order\StoreOrderRepository;
8
+use think\console\Command;
9
+use think\console\Input;
10
+use think\console\Output;
11
+use think\facade\Db;
12
+
13
+class repairPaySuccess extends Command
14
+{
15
+    protected function configure()
16
+    {
17
+        // 指令配置
18
+        $this->setName('repairPaySuccess')
19
+            ->setDescription('修复支付成功后数据');
20
+    }
21
+
22
+    /**
23
+     * @param Input $input
24
+     * @param Output $output
25
+     * @return void
26
+     */
27
+    protected function execute(Input $input, Output $output)
28
+    {
29
+        $orderSn = 'wx1744285736344558050';
30
+        $groupOrder = app()->make(StoreGroupOrderRepository::class)->getWhere(['group_order_sn' => $orderSn]);
31
+        app()->make(StoreOrderRepository::class)->paySuccess($groupOrder,1);
32
+        $output->writeln('执行结束');
33
+    }
34
+
35
+}

+ 25 - 26
app/controller/api/Notify.php

@@ -587,30 +587,30 @@ class Notify
587 587
                                     
588 588
                                 }
589 589
 
590
-                                //会员专区,给用户升级判断
591
-                                $orderList = Db::name("store_order")->where("uid", $store_order_data['uid'])->where("mer_id", 496)->where("status", "in", [0, 1, 2, 3])->select();
592
-                                // 初始化总和变量
593
-                                $totalPayPrice = 0;
594
-
595
-                                // 遍历查询结果
596
-                                foreach ($orderList as $order) {
597
-                                    // 累加 pay_price
598
-                                    $totalPayPrice += $order['pay_price'];
599
-                                }
600
-
601
-                                $userdata = Db::name("user")->where("uid", $store_order_data['uid'])->find();
602
-
603
-                                if ($totalPayPrice >= 1180 && $totalPayPrice < 11800) {
604
-
605
-                                    if ($userdata['user_group'] <= 1) {
606
-                                        Db::name("user")->where("uid", $store_order_data['uid'])->update(["user_group" => 2]);
607
-                                    }
608
-
609
-                                } else if ($totalPayPrice >= 11800) {
610
-                                    if ($userdata['user_group'] <= 2) {
611
-                                        Db::name("user")->where("uid", $store_order_data['uid'])->update(["user_group" => 3]);
612
-                                    }
613
-                                }
590
+                                //会员专区,给用户升级判断 todo 疑似重复升级代码先做注释
591
+//                                $orderList = Db::name("store_order")->where("uid", $store_order_data['uid'])->where("mer_id", 496)->where("status", "in", [0, 1, 2, 3])->select();
592
+//                                // 初始化总和变量
593
+//                                $totalPayPrice = 0;
594
+//
595
+//                                // 遍历查询结果
596
+//                                foreach ($orderList as $order) {
597
+//                                    // 累加 pay_price
598
+//                                    $totalPayPrice += $order['pay_price'];
599
+//                                }
600
+//
601
+//                                $userdata = Db::name("user")->where("uid", $store_order_data['uid'])->find();
602
+//
603
+//                                if ($totalPayPrice >= 1180 && $totalPayPrice < 11800) {
604
+//
605
+//                                    if ($userdata['user_group'] <= 1) {
606
+//                                        Db::name("user")->where("uid", $store_order_data['uid'])->update(["user_group" => 2]);
607
+//                                    }
608
+//
609
+//                                } else if ($totalPayPrice >= 11800) {
610
+//                                    if ($userdata['user_group'] <= 2) {
611
+//                                        Db::name("user")->where("uid", $store_order_data['uid'])->update(["user_group" => 3]);
612
+//                                    }
613
+//                                }
614 614
 
615 615
 
616 616
                             } else {
@@ -1669,9 +1669,8 @@ class Notify
1669 1669
 
1670 1670
                     } 
1671 1671
                 }
1672
-                $ds = 1;
1673 1672
             }
1674
-           
1673
+            $ds = 1;
1675 1674
         }
1676 1675
 
1677 1676