OwnerLogisticFeeDetailFactory.php 1.3 KB

1234567891011121314151617181920212223242526
  1. <?php
  2. /** @var \Illuminate\Database\Eloquent\Factory $factory */
  3. use App\OwnerLogisticFeeDetail;
  4. use Faker\Generator as Faker;
  5. $factory->define(OwnerLogisticFeeDetail::class, function (Faker $faker) {
  6. $province = ['北京', '广东省', '湖北省', '广东省', '四川省', '上海', '山西省', '上海', '江西省', '贵州省', '湖南省', '广东省', '云南省', '山东省', '贵州省', '云南省', '新疆维吾尔自治区', '辽宁省', '福建省'];
  7. $logistic_ids = \App\Logistic::query()->pluck('id')->toArray();
  8. return [
  9. 'logistic_bill' => $faker->uuid,
  10. 'initial_weight' => random_int(1, 100),
  11. 'initial_weight_price' => random_int(1, 100),
  12. 'additional_weight' => random_int(1, 100),
  13. 'additional_price' => random_int(1, 100),
  14. 'logistic_id' => $faker->randomElement($logistic_ids),
  15. 'province' => $faker->randomElement($province),
  16. 'owner_id' => random_int(1, 100),
  17. 'additional_weigh_weight' => random_int(1, 100),
  18. 'tax_fee' => random_int(1, 100),
  19. 'fee' => random_int(1, 100),
  20. 'created_at' => now()->subMonth()->startOfMonth()->addDays(random_int(1, 28))->toDateTimeString(),
  21. 'updated_at' => now()->subMonth()->startOfMonth()->addDays(random_int(1, 28))->toDateTimeString(),
  22. ];
  23. });