WaybillFactory.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /** @var \Illuminate\Database\Eloquent\Factory $factory */
  3. use Faker\Generator as Faker;
  4. $factory->define(\App\Waybill::class, function (Faker $faker) {
  5. $created_at = $faker->dateTimeThisMonth(now()->subMonth());
  6. $updated_at = $faker->dateTimeThisMonth($created_at);
  7. $types = ['直发车', '专线'];
  8. $status = ['未审核', '已审核', '待重审', '待终审', '已完结', '无模型',];
  9. return [
  10. 'created_at'=>$created_at,
  11. 'updated_at'=>$updated_at,
  12. 'type'=>$faker->randomElement($types),
  13. 'waybill_number'=>$faker->uuid,
  14. 'source_bill'=>$faker->uuid,
  15. 'owner_id'=>random_int(1,100),
  16. 'wms_bill_number'=>$faker->uuid,
  17. 'origination'=>$faker->city,
  18. 'destination'=>$faker->city,
  19. 'recipient'=>$faker->name,
  20. 'recipient_mobile'=>$faker->phoneNumber,
  21. 'charge'=>random_int(1,100),
  22. 'collect_fee'=>random_int(1,100),
  23. 'ordering_remark'=>$faker->sentence,
  24. 'logistic_id'=>random_int(1,100),
  25. 'carrier_bill'=>$faker->uuid,
  26. 'origination_city_id'=>random_int(1,10),
  27. 'destination_city_id'=>random_int(1,10),
  28. 'warehouse_weight'=>random_int(1,10),
  29. 'warehouse_weight_unit_id'=>random_int(1,10),
  30. 'carrier_weight'=>random_int(1,10),
  31. 'carrier_weight_unit_id'=>random_int(1,10),
  32. 'carType_id'=>random_int(1,10),
  33. 'fee'=>random_int(1,10),
  34. 'pick_up_fee'=>random_int(1,10),
  35. 'other_fee'=>random_int(1,10),
  36. 'dispatch_remark'=>$faker->sentence,
  37. 'waybill_price_model_id'=>random_int(1,10),
  38. 'warehouse_weight_other'=>random_int(1,10),
  39. 'warehouse_weight_unit_id_other'=>random_int(1,10),
  40. 'carrier_weight_other'=>random_int(1,10),
  41. 'carrier_weight_unit_id_other'=>random_int(1,10),
  42. 'car_owner_info'=>$faker->sentence,
  43. 'status'=>$faker->randomElement($status),
  44. 'mileage'=>random_int(1,10),
  45. 'amount'=>random_int(1,10),
  46. 'inquire_tel'=>$faker->phoneNumber,
  47. 'amount_unit_id'=>random_int(1,7),
  48. 'other_charge'=>random_int(1,100),
  49. 'other_charge_remark'=>$faker->sentence,
  50. 'deliver_at'=>now(),
  51. 'district_id'=>random_int(1,10),
  52. 'order_id'=>random_int(2511,100000),
  53. 'is_to_pay'=>random_int(0,1),
  54. ];
  55. });