WIN-2308041133\Administrator 4 months ago
parent
commit
d0ea60a0f9

+ 11 - 5
app/common/repositories/store/order/StoreOrderRepository.php

@@ -499,6 +499,9 @@ class StoreOrderRepository extends BaseRepository
                 }
                 //自动打印订单
                 $this->autoPrinter($order->order_id, $order->mer_id, 1);
+                @file_put_contents('quanju.txt', "-支付完成处理积分\r\n", 8);
+                app()->make(StoreOrderRepository::class)->getOrderAward($order);
+                app()->make(StoreOrderRepository::class)->spreadOrder($order['uid'],$order['order_id']); //查找上级是否有冻结份额
             }
 
             if ($groupOrder->user && $groupOrder->user->spread_uid) {
@@ -1079,10 +1082,10 @@ class StoreOrderRepository extends BaseRepository
         // 触发订单领取后的事件。
         event('order.take', compact('order'));
 //        订单赠送的分红额度和积分处理还是礼包购买数处理,顺便检测升级
-        @file_put_contents('quanju.txt', "-测试2\r\n", 8);
-        $this->spreadOrder($order['uid'],$order['order_id']);  //查找上级是否有冻结份额
-        @file_put_contents('quanju.txt', "-村上春树1\r\n", 8);
-        $this->getOrderAward($order); //订单收货赠送分红额度等等
+//        @file_put_contents('quanju.txt', "-测试2\r\n", 8);
+//        $this->spreadOrder($order['uid'],$order['order_id']);  //查找上级是否有冻结份额
+//        @file_put_contents('quanju.txt', "-村上春树1\r\n", 8);
+//        $this->getOrderAward($order); //订单收货赠送分红额度等等
     }
 
 //    订单收货赠送分红额度
@@ -1283,7 +1286,10 @@ class StoreOrderRepository extends BaseRepository
         $order_award_range=0;
         if ($user['spread_uid']>0){
             $make = app()->make(UserBillRepository::class);
-
+            $award_range = User::where('uid', $user['spread_uid'])->value('award_range');
+            if ($award_range<=0){  //上级没有分红额度就不发放分红积分
+                return true;
+            }
             switch ($type) {
                 case 0:  //普通商品
                     $award_integral = User::where('uid',$user['spread_uid'])->value('award_integral');

+ 2 - 2
app/controller/merchant/store/order/Order.php

@@ -194,8 +194,8 @@ class Order extends BaseController
 
 //                因为没有确认收货所以要判断判断积分份额
                 $order = $this->repository->getWhere(['order_id' => $id]);
-                app()->make(StoreOrderRepository::class)->getOrderAward($order);
-                app()->make(StoreOrderRepository::class)->spreadOrder($order['uid'],$order['order_id']); //查找上级是否有冻结份额
+//                app()->make(StoreOrderRepository::class)->getOrderAward($order);
+//                app()->make(StoreOrderRepository::class)->spreadOrder($order['uid'],$order['order_id']); //查找上级是否有冻结份额
                 break;
             case 4: //电子面单
                 if (!systemConfig('crmeb_serve_dump') || merchantConfig($this->request->merId(), 'mer_dump_switch') == 0)