Browse Source

transfer bugs

zz 5 years ago
parent
commit
23ed857382
1 changed files with 6 additions and 0 deletions
  1. 6 0
      app/Modules/User/Services/UserService.php

+ 6 - 0
app/Modules/User/Services/UserService.php

@@ -436,6 +436,7 @@ WHERE u.openid in (SELECT openid from users WHERE  id = %s)";
             $i = 1;
             $chapter_model = new ChapterOrder();
             $chapter_model->setCurrentTable($to);
+
             foreach ($chapter_order_record as $chapter_order){
                 $temp[] = [
                     'distribution_channel_id'=>$distribution_channel_id,
@@ -449,6 +450,11 @@ WHERE u.openid in (SELECT openid from users WHERE  id = %s)";
                     'created_at'=>$chapter_order->created_at,
                     'updated_at'=>date('Y-m-d H:i:s')
                 ];
+                if($i % 100 == 0){
+                    $chapter_model->insert($temp);
+                    $temp = [];
+                }
+                $i ++;
             }
             //\Log::info('chapter order  is');
             //\Log::info($temp);