OwnerStoragePriceModelFactory.php 1.0 KB

123456789101112131415161718192021222324
  1. <?php
  2. /** @var \Illuminate\Database\Eloquent\Factory $factory */
  3. use App\OwnerStoragePriceModel;
  4. use Faker\Generator as Faker;
  5. $factory->define(OwnerStoragePriceModel::class, function (Faker $faker) {
  6. $counting_type = ['包仓', '灵活用仓', '统单价'];
  7. $using_type = ['常温', '恒温'];
  8. $discount_type = ['无减免', '按单减免', '固定减免'];
  9. return [
  10. "counting_type" => $counting_type[array_rand($counting_type)], //计费类型
  11. "using_type" => $using_type[array_rand($using_type)], //用仓类型
  12. "minimum_area" => mt_rand(100, 1000) / 50, //最低起租面积
  13. "price" => mt_rand(1, 20) / 10, //单价
  14. "discount_type" => $discount_type[array_rand($discount_type)], //减免类型
  15. "discount_value" => mt_rand(0, 10) / 12, //减免值
  16. // "unit_id" => factory(\App\Unit::class) , //单位ID
  17. 'unit_id' => random_int(1, 7),
  18. 'time_unit_id' => random_int(8, 11),
  19. 'name' => $faker->title,
  20. ];
  21. });