MachineTableSeeder.php 2.37 KB
<?php

use Carbon\Carbon;
use Illuminate\Database\Seeder;

class MachineTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $insert = [
            [
                'id' => 1,
                'mac_no' => '1802270339800001',
                'he_cloud_device_id' => '80048969',
                'one_day_price' => 1,
                'deposit' => 19900,
                'free_time' => 0,
                'spot_id' => 23,
                'business_id' => 5,
                'wx_mini_program' => 'test',
                'ali_mini_program' => 'test',
                'type' => 1,
                'address'=>'111',
                'hatch_number' => 9,
                'position' => DB::raw( 'GeomFromText(\'POINT(31.2753965207 120.7460761070)\' )' ),
                'created_at' => Carbon::now(),
                'updated_at' => Carbon::now(),
            ],
            [
                'id' => 2,
                'mac_no' => '1802270339800002',
                'he_cloud_device_id' => '',
                'one_day_price' => 1,
                'deposit' => 19900,
                'free_time' => 0,
                'spot_id' => 23,
                'business_id' => 5,
                'wx_mini_program' => 'test',
                'ali_mini_program' => 'test',
                'type' => 1,
                'address'=>'111',
                'hatch_number' => 9,
                'position' => DB::raw( 'GeomFromText(\'POINT(31.2758550066 120.7593154907)\' )' ),
                'created_at' => Carbon::now(),
                'updated_at' => Carbon::now(),
            ],
            [
                'id' => 3,
                'mac_no' => '1802270339800003',
                'he_cloud_device_id' => '',
                'one_day_price' => 1,
                'deposit' => 19900,
                'free_time' => 0,
                'spot_id' => 23,
                'business_id' => 5,
                'wx_mini_program' => 'test',
                'ali_mini_program' => 'test',
                'type' => 1,
                'address'=>'111',
                'hatch_number' => 9,
                'position' => DB::raw( 'GeomFromText(\'POINT(31.2429300520 120.7545518875)\' )' ),
                'created_at' => Carbon::now(),
                'updated_at' => Carbon::now(),
            ],

        ];
        DB::table('machine')->insert($insert);
    }
}