OwnerReportFactory.php 838 B

123456789101112131415161718
  1. <?php
  2. /** @var \Illuminate\Database\Eloquent\Factory $factory */
  3. use App\OwnerReport;
  4. use Faker\Generator as Faker;
  5. $owner = \App\Owner::query()->first();
  6. $factory->define(OwnerReport::class, function (Faker $faker)use($owner) {
  7. if (!$owner)$owner = \App\Owner::query()->first();
  8. return [
  9. // "owner_id" => $owner ? $owner->id : factory(App\Owner::class), //货主ID
  10. "counting_month" => $faker->date(), //结算月
  11. "daily_average_order_amount" => mt_rand(0,10000), //日均单量
  12. "current_month_counting_area" => mt_rand(100,100000) / 50, //结算月盘点面积
  13. "last_month_counting_area" => mt_rand(100,100000) / 50, //结算月上月盘点面积
  14. // "owner_bill_report_id" =>factory(App\OwnerBillReport::class), //账单ID
  15. ];
  16. });