1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- use Faker\Generator as Faker;
- $factory->define(App\Models\PartnerModel::class, function (Faker $faker) {
- $users = \App\Models\User\UserModel::take(40)->get();
- return [
- 'media_id' => 'gh_01c089b58dda',
- 'secret' => $faker->unique()->word,
- 'upload_at' => $faker->unixTime('now'),
- 'update_at' => $faker->unixTime('now'),
- 'created_at' => $faker->unixTime('now'),
- 'is_self' => 1,
- 'is_recommend' => $faker->randomElement([0, 1]),
- 'is_voice_recommend' => $faker->randomElement([0, 1]),
- 'check_photo' => $faker->randomElement([-1, 0, 1]),
- 'photo_1_check' => $faker->randomElement([-1, 0, 1]),
- 'photo_2_check' => $faker->randomElement([-1, 0, 1]),
- 'photo_3_check' => $faker->randomElement([-1, 0, 1]),
- 'photo_4_check' => $faker->randomElement([-1, 0, 1]),
- 'voice_check' => $faker->randomElement([-1, 0, 1]),
- 'base_score' => $faker->numberBetween(0, 100),
- 'is_push_feed' => $faker->randomElement([0, 1]),
- 'is_commit_check' => function(array $mock) {
- if (0 == $mock['check_photo']
- || 0 == $mock['photo_1_check']
- || 0 == $mock['photo_2_check']
- || 0 == $mock['photo_3_check']
- || 0 == $mock['photo_4_check']
- || 0 == $mock['voice_check']) {
- return 1;
- }
- return 0;
- },
- 'is_sell' => 1,
- ];
- });
|