Friend.php 1.1 KB

1234567891011121314151617181920212223
  1. <?php
  2. use Faker\Generator as Faker;
  3. $factory->define(App\Models\Friends\FriendModel::class, function (Faker $faker) {
  4. $uids = \App\Models\User\UserModel::get()->pluck('uid')->toArray();
  5. return [
  6. 'last_at' => $faker->unixTime('now') - 7 * 86400 + rand(0, 7*86400),
  7. 'last_msg' => $faker->randomElement(['通过开黑在一起', '相互心动', '通过了你的好友申请', '接受了你的好友申请']),
  8. 'uid' => $faker->randomElement($uids),
  9. 'friend_uid' => $faker->randomElement($uids),
  10. 'is_hide' => $faker->randomElement([0, 0, 0, 0, 0, 0, 0, 0, 1]),
  11. 'is_friend' => $faker->randomElement([1, 1, 1, 1, 1, 1, 1, 1, 0]),
  12. 'star_at' => $faker->randomElement([0, $faker->unixTime('now')]),
  13. 'unread_cnt' => $faker->randomNumber(),
  14. 'each_like' => $faker->randomElement([0, 1]),
  15. 'pair' => $faker->randomElement([0, 1]),
  16. 'like_invite' => $faker->randomElement([0, 1]),
  17. 'gteam' => $faker->randomElement([0, 1]),
  18. 'goodnight' => $faker->randomElement([0, 1])
  19. ];
  20. });