applyConditions

This commit is contained in:
邓皓元 2019-11-13 17:07:36 +08:00
parent 3ad17f9d0c
commit a7942a3457
2 changed files with 45 additions and 1 deletions

View File

@ -46,7 +46,7 @@ class CompanyReportDetailExport extends AbstractExport implements FromQuery, Wit
];
$builder = $repository->forceNoReset()->select($select)
->withConditions($this->conditions)
->withConditions($this->conditions)->applyConditions()
->groupBy('company_id', 'package_id', 'type', 'unit_price', 'sim')
->orderBy('sim');

View File

@ -0,0 +1,44 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateVirtualDevicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('virtual_devices', function (Blueprint $table) {
$table->increments('id');
$table->bigInteger('sim')->unsigned()->default(0)->comment('SIM号');
$table->string('unique_key', 32)->unsigned()->default(0)->comment('唯一设备编号');
$table->string('imsi', 32)->unsigned()->default(0)->comment('IMSI号');
$table->string('imei', 32)->default("")->comment('IMEI号');
$table->string('plant_no', 32)->default("")->comment('车牌号');
$table->string('model', 32)->default("")->comment('型号');
$table->decimal('first_lon', 10, 6)->default(0.000000)->comment('第一次访问经度');
$table->decimal('first_lat', 10, 6)->default(0.000000)->comment('第一次访问纬度');
$table->decimal('last_lon', 10, 6)->default(0.000000)->comment('最后访问经度');
$table->decimal('last_lat', 10, 6)->default(0.000000)->comment('最后访问纬度');
$table->string('last_location', 255)->default('')->comment('最后访问位置');
$table->tinyInteger("type")->unsigned()->default(0)->comment('平台类型 0:广电 1:车控宝 2:微科 3:省内交通厅 4:省外交通厅 5:北斗行');
$table->timestamps();
$table->unique(['unique_key']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('virtual_devices');
}
}