Просмотр исходного кода

feat: NG-15: 新会员注册时增加国家与语言选项.

zhangl 1 год назад
Родитель
Сommit
ccf784f584

+ 1 - 5
frontendApi/modules/v1/controllers/UserController.php

@@ -744,11 +744,7 @@ class UserController extends BaseController {
         $periodNum = Period::instance()->getNowPeriodNum();
 
         $relation = new Relation();
-        $allowable = $relation->loopRelationParentDo(
-            /**
-            * @throws \Exception
-            */
-            $userId, function ($parent) use ($actualId, $periodNum) {
+        $allowable = $relation->loopRelationParentDo($userId, function ($parent) use ($actualId, $periodNum) {
             $parentUser = CalcCache::getUserInfo($parent['PARENT_UID'], $periodNum);
             if ($parentUser['USER_ID'] == $actualId) {
                 return self::LOOP_FINISH;

+ 4 - 0
frontendApi/modules/v1/models/Relation.php

@@ -3,6 +3,7 @@
 namespace frontendApi\modules\v1\models;
 
 use common\helpers\Cache;
+use common\helpers\LoggerTool;
 
 class Relation extends \common\components\ActiveRecord
 {
@@ -20,6 +21,9 @@ class Relation extends \common\components\ActiveRecord
     public function loopRelationParentDo($userId, callable $callbackFunc, int $offset = 0): bool
     {
         $allParents = Cache::getAllRelationParents($userId);
+
+        LoggerTool::debug(json_encode(['loopRelationParentDo', $userId ,$allParents]));
+
         $allData = array_slice($allParents, $offset, $this->_limit);
         unset($allParents);
         if ($allData) {