| 123456789101112131415161718192021222324252627282930313233 |
- <?php
- /** @var \Illuminate\Database\Eloquent\Factory $factory */
- use App\OwnerStoreFeeDetail;
- use Faker\Generator as Faker;
- $factory->define(OwnerStoreFeeDetail::class, function (Faker $faker) {
- $prices = [1.2, 1.3, 1.5, 1.5];
- $work_names = ['入库费1', '入库费2'];
- $price = $faker->randomElement($prices);
- $amount = random_int(1, 100);
- return [
- //
- 'owner_fee_detail_id' => random_int(1, 100),
- 'unit_id' => random_int(1, 3),
- 'unit_price' => $price,
- 'amount' => $amount,
- 'owner_id' => random_int(1, 100),
- 'fee' => $price * $amount,//费用
- 'commodity_id' => random_int(1, 100),
- 'packing_material_fee' => random_int(1, 100),//包材费
- 'tax_fee' => random_int(1, 100),//税费
- 'sku' => $faker->uuid,//sku
- 'barcode' => $faker->uuid,//条码
- 'work_name' => $faker->randomElement($work_names),//作业名称
- 'asn_code' => $faker->uuid,//条码
- 'created_at' => now()->subMonth()->startOfMonth()->addDays(random_int(0, 28)),
- 'updated_at' => now()->subMonth()->startOfMonth()->addDays(random_int(0, 28)),
- ];
- });
|