Jelajahi Sumber

会员升级

Kirin 1 tahun lalu
induk
melakukan
6da3866f47

+ 2 - 4
app/controller/api/v1/PublicController.php

@@ -108,7 +108,6 @@ class PublicController extends BaseController
                         }
                     }
                 }
-//                $levelServices->detection((int)$user['uid']);
                 $pass = [$user['uid']];
                 $send = 0;
                 while ($spread && !in_array($spread['uid'], $pass)) {
@@ -125,12 +124,11 @@ class PublicController extends BaseController
 //                        }
                         $send = $give_action_integral;
                     }
-//                    $levelServices->detection((int)$spread['uid']);
                     $pass[] = $spread['uid'];
                     $spread = $userService->getUserInfo($spread['spread_uid']);
                 }
-//                $this->autoExtract($awardIntegralService->getPrice());
-                return false;
+                app()->make(IntegralJob::class)->autoExtract($awardIntegralService->getPrice());
+                return true;
             } catch (\Throwable $e) {
                 return false;
             }

+ 17 - 14
app/services/user/UserAwardIntegralServices.php

@@ -228,20 +228,23 @@ class UserAwardIntegralServices extends BaseServices
             $dump = '用户' . $uid . $mark . '补' . $inc_integral;
         }
         @file_put_contents('add', $dump . PHP_EOL, FILE_APPEND);
-//        return $this->dao->save([
-//            'uid' => $uid,
-//            'type' => $type == 1 ? 1 : 0,
-//            'num' => $inc_integral,
-//            'price' => $price,
-//            'sum_price' => $total,
-//            'extract_sum' => $extract_sum,
-//            'link_id' => $link_id,
-//            'mark' => $mark,
-//            'order_price' => $order_price,
-//            'add_time' => $add_time ?: time(),
-//            'status' => $inc_integral > 0 ? 0 : 1,
-//        ]);
-        return true;
+        if ($old) {
+            $old->delete();
+        }
+        return $this->dao->save([
+            'uid' => $uid,
+            'type' => $type == 1 ? 1 : 0,
+            'num' => $inc_integral,
+            'price' => $price,
+            'sum_price' => $total,
+            'extract_sum' => $extract_sum,
+            'link_id' => $link_id,
+            'mark' => $mark,
+            'order_price' => $order_price,
+            'add_time' => $add_time ?: time(),
+            'status' => $inc_integral > 0 ? 0 : 1,
+        ]);
+//        return true;
     }