WIN-2308041133\Administrator 5 months ago
parent
commit
52ce3ef9c1

+ 6 - 0
app/common/repositories/store/order/StoreOrderRepository.php

@@ -1077,6 +1077,7 @@ class StoreOrderRepository extends BaseRepository
         // 触发订单领取后的事件。
         event('order.take', compact('order'));
 //        订单赠送的分红额度和积分处理还是礼包购买数处理,顺便检测升级
+        @file_put_contents('quanju.txt', "-村上春树1\r\n", 8);
         $this->getOrderAward($order);
     }
 
@@ -1099,6 +1100,7 @@ class StoreOrderRepository extends BaseRepository
         $user = User::where('uid', $order['uid'])->find();
         $award_range = $user['award_range'];
         if ($type == 5) {  //节能油商品
+            @file_put_contents('quanju.txt', "-村上春树2\r\n", 8);
             $number = systemConfig('award_energy_saving_oil', 1);
             if ($order['pay_price'] >= $number) {
                 $order_award_range = bcmul($order['pay_price'], 3, 2);
@@ -1165,6 +1167,7 @@ class StoreOrderRepository extends BaseRepository
             }
         }
         //份额和积分变动时触发
+        @file_put_contents('quanju.txt', "-村上春树3\r\n", 8);
         $UserRepository = app()->make(UserRepository::class);
         $UserRepository->checkAward($order['uid']);
 //        上级推荐奖励的分红积分
@@ -1173,6 +1176,7 @@ class StoreOrderRepository extends BaseRepository
 //        $AwardLake = app()->make(AwardLake::class);
         $awardLake = app()->make(AwardLake::class);
         if ($type==5){
+            @file_put_contents('quanju.txt', "-村上春树4\r\n", 8);
             $oil = app()->make(OilLevel::class);
             $oil->checkLevel($order['uid']);
             $awardLake->addOrderLakes(1,$order['pay_price'],$order['order_id']);
@@ -1214,6 +1218,7 @@ class StoreOrderRepository extends BaseRepository
                             'mark' => $user['nickname'] . '成功消费节能油商品' . floatval($order['pay_price']) . '元,奖励上级分红积分' . $order_award_range,
                         ]);
                     }
+                    @file_put_contents('quanju.txt', "-村上春树5\r\n", 8);
                     break;
                 case 6:  //礼包商品
                     $remainder = bcmod($user['pack_count'], 3);  //取余
@@ -1245,6 +1250,7 @@ class StoreOrderRepository extends BaseRepository
             if ($order_award_range>0){//检查上级积分是否达到提现条件
                 $UserRepository = app()->make(UserRepository::class);
                 $UserRepository->checkAward($user['spread_uid']);
+                @file_put_contents('quanju.txt', "-村上春树6\r\n", 8);
             }
             User::where('uid', $user['spread_uid'])->update(['award_integral'=>$after]);
         }

+ 6 - 0
app/common/repositories/user/UserRepository.php

@@ -2718,6 +2718,12 @@ class UserRepository extends BaseRepository
             if ($all_price > $info['award_range']) $all_price = $info['award_range'];
 
             if ($all_price > 0) {
+                $commission2 = $all_price;
+                $commission = systemConfig('extract_commission', 0);
+
+                $all_price = bcdiv(bcmul((string)$all_price, (string)$commission), '100', 2);
+                $commission2 = bcsub($commission2,$all_price,2);  //回奖池的手续费
+
                 //用户获得$all_price的佣金
                 $userBillRepository->incBill($uid, 'brokerage', 'extract_award', [
                     'link_id' => 0,