OwnerStoreOutFeeDetailFactory.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /** @var \Illuminate\Database\Eloquent\Factory $factory */
  3. use App\OwnerStoreOutFeeDetail;
  4. use Faker\Generator as Faker;
  5. $factory->define(OwnerStoreOutFeeDetail::class, function (Faker $faker) {
  6. $step = ['0-20000', '20000-50000', '50000-100000'];
  7. $prices = [1.2, 1.3, 1.5, 1.5];
  8. $work_names = ['出库费1','出库费2'];
  9. $price = $faker->randomElement($prices);
  10. $amount = random_int(1, 100);
  11. return [
  12. 'owner_fee_detail_id' => random_int(1, 100),
  13. 'commodity_id' => random_int(1, 100),
  14. 'owner_id' => random_int(1, 100),
  15. 'source_bill' => $faker->uuid,
  16. 'unit_price' => $price,
  17. 'unit_id' => random_int(1, 3),
  18. 'amount' => $amount,
  19. 'step' => $faker->randomElement($step),
  20. 'tax_fee' => random_int(1, 100),//税费
  21. 'sku' => $faker->uuid,//商家编码
  22. 'packing_material_fee' => random_int(1, 100),//耗材费
  23. 'barcode' => $faker->uuid,//商品条码
  24. 'work_name' => $faker->randomElement($work_names),//作业名称
  25. 'fee' => $price * $amount,//费用
  26. 'price_remark' => '起步费:2.2元(5件以内),续费:0.2元/件',
  27. 'created_at' => now()->subMonth()->startOfMonth()->addDays(random_int(0, 28)),
  28. 'updated_at' => now()->subMonth()->startOfMonth()->addDays(random_int(0, 28)),
  29. ];
  30. });