瀏覽代碼

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

zhangl 1 年之前
父節點
當前提交
ccf784f584
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 1 5
      frontendApi/modules/v1/controllers/UserController.php
  2. 4 0
      frontendApi/modules/v1/models/Relation.php

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

@@ -744,11 +744,7 @@ class UserController extends BaseController {
         $periodNum = Period::instance()->getNowPeriodNum();
         $periodNum = Period::instance()->getNowPeriodNum();
 
 
         $relation = new Relation();
         $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);
             $parentUser = CalcCache::getUserInfo($parent['PARENT_UID'], $periodNum);
             if ($parentUser['USER_ID'] == $actualId) {
             if ($parentUser['USER_ID'] == $actualId) {
                 return self::LOOP_FINISH;
                 return self::LOOP_FINISH;

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

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