diff --git a/app/Domains/Stats/Exports/CompanyReportDetailExport.php b/app/Domains/Stats/Exports/CompanyReportDetailExport.php index e65d0ba9..6a2b4871 100644 --- a/app/Domains/Stats/Exports/CompanyReportDetailExport.php +++ b/app/Domains/Stats/Exports/CompanyReportDetailExport.php @@ -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'); diff --git a/database/migrations/2019_10_23_180807_create_virtual_devices_table.php b/database/migrations/2019_10_23_180807_create_virtual_devices_table.php new file mode 100644 index 00000000..91b19466 --- /dev/null +++ b/database/migrations/2019_10_23_180807_create_virtual_devices_table.php @@ -0,0 +1,44 @@ +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'); + } +}