stanley-king 7 سال پیش
والد
کامیت
c8c90f3fad
4فایلهای تغییر یافته به همراه34 افزوده شده و 4 حذف شده
  1. 0 2
      helper/account_helper.php
  2. 34 2
      helper/ugc_helper.php
  3. BIN
      mac_ugcman
  4. BIN
      ugcman

+ 0 - 2
helper/account_helper.php

@@ -405,7 +405,6 @@ class account_helper
             Log::record($ex->getMessage(),Log::ERR);
         }
     }
-
     public static function onAsyncOrderSended($pay_sn,$logistics_no,$logistics_company)
     {
         try
@@ -416,7 +415,6 @@ class account_helper
             Log::record($ex->getMessage(),Log::ERR);
         }
     }
-
     public static function onAsyncOrderComplete($pay_sn)
     {
         try

+ 34 - 2
helper/ugc_helper.php

@@ -223,8 +223,9 @@ class ugc_helper
     public static function init_server()
     {
         $initer = new ugciniter();
-        $initer->init_special();
-        $initer->init_fellows();
+        $initer->init_relation();
+//        $initer->init_special();
+//        $initer->init_fellows();
     }
     public static function send_reward()
     {
@@ -234,6 +235,37 @@ class ugc_helper
 
 class ugciniter
 {
+    public function init_relation()
+    {
+        $i = 0;
+        while (true)
+        {
+            $start = $i * 1000;
+            $items = Model()->table('member_relation')->field('*')->where(['member_id' => ['gt',0]])->order('member_id asc')->limit("{$start},1000")->select();
+            if(empty($items)) {
+                return;
+            }
+            $i++;
+
+            foreach ($items as $item)
+            {
+                $iRelation = new \relation\mem_relation($item);
+                $follows = $iRelation->subscriber();
+                $uids = [];
+                foreach ($follows as $val)
+                {
+                    $uid = intval($val);
+                    if($uid > 0) {
+                        $uids[] = $uid;
+                    }
+                }
+                if(!empty($uids)) {
+                    search\relation_client::instance()->add_follow(array('user_id' => $iRelation->member_id(),'friends' => $uids));
+                }
+            }
+        }
+
+    }
     public function init_fellows()
     {
         $i = 0;

BIN
mac_ugcman