OwnerStoreFeeDetailFactory.php 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /** @var \Illuminate\Database\Eloquent\Factory $factory */
  3. use App\OwnerStoreFeeDetail;
  4. use Faker\Generator as Faker;
  5. $factory->define(OwnerStoreFeeDetail::class, function (Faker $faker) {
  6. $prices = [1.2, 1.3, 1.5, 1.5];
  7. $work_names = ['入库费1', '入库费2'];
  8. $price = $faker->randomElement($prices);
  9. $amount = random_int(1, 100);
  10. return [
  11. //
  12. 'owner_fee_detail_id' => random_int(1, 100),
  13. 'unit_id' => random_int(1, 3),
  14. 'unit_price' => $price,
  15. 'amount' => $amount,
  16. 'owner_id' => random_int(1, 100),
  17. 'fee' => $price * $amount,//费用
  18. 'commodity_id' => random_int(1, 100),
  19. 'packing_material_fee' => random_int(1, 100),//包材费
  20. 'tax_fee' => random_int(1, 100),//税费
  21. 'sku' => $faker->uuid,//sku
  22. 'barcode' => $faker->uuid,//条码
  23. 'work_name' => $faker->randomElement($work_names),//作业名称
  24. 'asn_code' => $faker->uuid,//条码
  25. 'created_at' => now()->subMonth()->startOfMonth()->addDays(random_int(0, 28)),
  26. 'updated_at' => now()->subMonth()->startOfMonth()->addDays(random_int(0, 28)),
  27. ];
  28. });