瀏覽代碼

会员升级

Kirin 1 年之前
父節點
當前提交
e95985cad5
共有 2 個文件被更改,包括 28 次插入18 次删除
  1. 18 18
      app/jobs/integral/IntegralJob.php
  2. 10 0
      app/services/supplier/finance/SupplierFlowingWaterServices.php

+ 18 - 18
app/jobs/integral/IntegralJob.php

@@ -57,25 +57,25 @@ class IntegralJob extends BaseJobs
                 $spread = $userService->getUserInfo($user['spread_uid']);
                 if ($spread) {
                     if ($awardIntegralService->getPaySum($spread['uid']) >= 1000 || $awardIntegralService->getHourExtractPaySum($spread['uid'], 24) >= 1000) {
-//                        if ($awardIntegralService->getPaySum($spread['uid']) > 0) {
-//                            $award_ratio = sys_config('recommend_integral', 0);
-//                            $award_speed_ratio = sys_config('recommend_speed_integral', 0);
-//                            $award_ratio = bcadd($award_ratio, $award_speed_ratio, 2);
-//                            $give_action_integral = bcdiv(bcmul($award_price, $award_ratio), 100, 2);
-//                            if ($give_action_integral > 0) {
-//                                $first = $awardIntegralService->getFirstStaticIntegral($spread['uid']);
-//                                $mark = ',推荐用户' . $user['nickname'] . "({$user['uid']})" . '购买商品,获得加速积分';
-//                                $awardIntegralService->incUpdateIntegral($first['id'], $integral_price, $give_action_integral, $mark);
-//                            }
-//                        } else {
-                        $award_ratio = sys_config('recommend_integral', 0);
-                        $give_action_integral = bcdiv(bcmul($award_price, $award_ratio), 100, 2);
-                        if ($give_action_integral > 0) {
-                            $extract_sum = bcmul($give_action_integral, $rate, 2);
-                            $mark = '推荐用户' . $user['nickname'] . "({$user['uid']})" . '购买商品,获得推荐积分';
-                            $awardIntegralService->incIntegral($spread['uid'], $integral_price, $give_action_integral, $total_price, 1, $extract_sum, $order['id'], $mark);
+                        if ($awardIntegralService->getPaySum($spread['uid']) > 0) {
+                            $award_ratio = sys_config('recommend_integral', 0);
+                            $award_speed_ratio = sys_config('recommend_speed_integral', 0);
+                            $award_ratio = bcadd($award_ratio, $award_speed_ratio, 2);
+                            $give_action_integral = bcdiv(bcmul($award_price, $award_ratio), 100, 2);
+                            if ($give_action_integral > 0) {
+                                $first = $awardIntegralService->getFirstStaticIntegral($spread['uid']);
+                                $mark = ',推荐用户' . $user['nickname'] . "({$user['uid']})" . '购买商品,获得加速积分';
+                                $awardIntegralService->incUpdateIntegral($first['id'], $integral_price, $give_action_integral, $mark);
+                            }
+                        } else {
+                            $award_ratio = sys_config('recommend_integral', 0);
+                            $give_action_integral = bcdiv(bcmul($award_price, $award_ratio), 100, 2);
+                            if ($give_action_integral > 0) {
+                                $extract_sum = bcmul($give_action_integral, $rate, 2);
+                                $mark = '推荐用户' . $user['nickname'] . "({$user['uid']})" . '购买商品,获得推荐积分';
+                                $awardIntegralService->incIntegral($spread['uid'], $integral_price, $give_action_integral, $total_price, 1, $extract_sum, $order['id'], $mark);
+                            }
                         }
-//                        }
                     }
                 }
                 $levelServices->detection((int)$user['uid']);

+ 10 - 0
app/services/supplier/finance/SupplierFlowingWaterServices.php

@@ -145,6 +145,16 @@ class SupplierFlowingWaterServices extends BaseServices
             return true;
         }
         if ($order['supplier_id'] <= 0) return true;
+        if ($type == 1) {
+            $res = $this->search([
+                'type' => 1,
+                'link_id' => $order['order_id'],
+                'supplier_id' => $order['supplier_id'],
+                'pay_type' => $order['pay_type'] ?? '',
+                'uid' => $order['uid'] ?? 0,
+            ])->find();
+            if ($res) return true;
+        }
         $data = $cartInfoServices->getOrderCartInfoSettlePrice($order['id']);
         $pay_postage = 0;
         if (isset($order['shipping_type']) && !in_array($order['shipping_type'], [2, 4])) {