OwnerLogisticFeeReportFactory.php 1.2 KB

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