Partner.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Faker\Generator as Faker;
  3. $factory->define(App\Models\PartnerModel::class, function (Faker $faker) {
  4. $users = \App\Models\User\UserModel::take(40)->get();
  5. return [
  6. 'media_id' => 'gh_01c089b58dda',
  7. 'secret' => $faker->unique()->word,
  8. 'upload_at' => $faker->unixTime('now'),
  9. 'update_at' => $faker->unixTime('now'),
  10. 'created_at' => $faker->unixTime('now'),
  11. 'is_self' => 1,
  12. 'is_recommend' => $faker->randomElement([0, 1]),
  13. 'is_voice_recommend' => $faker->randomElement([0, 1]),
  14. 'check_photo' => $faker->randomElement([-1, 0, 1]),
  15. 'photo_1_check' => $faker->randomElement([-1, 0, 1]),
  16. 'photo_2_check' => $faker->randomElement([-1, 0, 1]),
  17. 'photo_3_check' => $faker->randomElement([-1, 0, 1]),
  18. 'photo_4_check' => $faker->randomElement([-1, 0, 1]),
  19. 'voice_check' => $faker->randomElement([-1, 0, 1]),
  20. 'base_score' => $faker->numberBetween(0, 100),
  21. 'is_push_feed' => $faker->randomElement([0, 1]),
  22. 'is_commit_check' => function(array $mock) {
  23. if (0 == $mock['check_photo']
  24. || 0 == $mock['photo_1_check']
  25. || 0 == $mock['photo_2_check']
  26. || 0 == $mock['photo_3_check']
  27. || 0 == $mock['photo_4_check']
  28. || 0 == $mock['voice_check']) {
  29. return 1;
  30. }
  31. return 0;
  32. },
  33. 'is_sell' => 1,
  34. ];
  35. });