浏览代码

Also fix orderByRaw in SeedFollows

Neil Alexander 7 年之前
父节点
当前提交
efbb1017e7
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      app/Console/Commands/SeedFollows.php

+ 3 - 3
app/Console/Commands/SeedFollows.php

@@ -41,10 +41,10 @@ class SeedFollows extends Command
     {
     {
         $limit = 10000;
         $limit = 10000;
 
 
-        for ($i=0; $i < $limit; $i++) { 
+        for ($i=0; $i < $limit; $i++) {
             try {
             try {
-                $actor = Profile::orderByRaw('rand()')->firstOrFail();
-                $target = Profile::orderByRaw('rand()')->firstOrFail();
+                $actor = Profile::inRandomOrder()->firstOrFail();
+                $target = Profile::inRandomOrder()->firstOrFail();
 
 
                 $follow = new Follower;
                 $follow = new Follower;
                 $follow->profile_id = $actor->id;
                 $follow->profile_id = $actor->id;