<?php

use Illuminate\Database\Seeder;

class faker_data extends Seeder
{

    public static $status =[
        '未审核', '已审核', '待重审', '待终审', '已完结', '无模型'];
    public static $type =['直发车', '专线'];

    public static $recipients = ['11','22','33','44','55','66','77','88'];
    /**
     * Run the database seeds.
     *s
     * @return void
     */
    public function run()
    {
        //
        dump(123);
        $fake = app(Faker\Generator::class);

        for ($i = 0;$i<5;$i++){
            \App\Owner::create([
                'code'=>\Illuminate\Support\Str::random(4),
                'name'=>\Illuminate\Support\Str::random(5),

            ]);
        }

        for ($i = 0;$i<5;$i++){
            \App\Carrier::create([
                'name'=>$fake->name,
                'mobile'=>rand(1300000000,19999999999),
                'remark'=>\Illuminate\Support\Str::random(13),
                'delivery_fee'=>rand(0,100),
            ]);
        }

        for ($i = 0;$i<5;$i++){
             \App\CarType::create([
                 'name'=>$fake->name,
                 'model'=>\Illuminate\Support\Str::random(3).rand(10,100),
                 'length'=>rand(1,10),
                 'load'=>rand(1,5),
             ]);
        }

        for ($i = 0;$i<100;$i++){
            \App\Waybill::create([
                'status'=>faker_data::$status[rand(0,5)],
                'type'=>faker_data::$type[rand(0,1)],
                'waybill_number'=>\Illuminate\Support\Str::random(3).rand(100000000,9999999999),
                'source_bill'=>\Illuminate\Support\Str::random(4).rand(100000000,9999999999),
                'wms_bill_number'=>\Illuminate\Support\Str::random(3).rand(100000000,9999999999),
                'origination'=>\Illuminate\Support\Str::random(20),
                'destination'=>\Illuminate\Support\Str::random(20),
                'recipient'=>faker_data::$recipients[rand(0,7)],
                'recipient_mobile'=>rand(1300000000,19999999999),
                'charge'=>rand(0,200),
                'collect_fee'=>rand(0,200),
                'ordering_remark'=>\Illuminate\Support\Str::random(20),
                'carrier_bill'=>'STS'.rand(0000000,9999999),
                'origination_city_id'=>rand(1,345),
                'destination_city_id'=>rand(1,345),
                'warehouse_weight'=>rand(0,100)/10,
                'warehouse_weight_unit_id'=>rand(0,6),
                'carrier_weight'=>rand(0,12),
                'carrier_weight_unit_id'=>rand(0,10),
                'carType_id'=>rand(0,5),
                'fee'=>rand(1,15),
                'pick_up_fee'=>rand(0,4),
            ]);
        }

    }
}
