Browse Source

vip车牌导入优化

master
wanghongjun 4 days ago
parent
commit
a6a6453c1b
  1. 6
      app/Imports/ParkingVipListImport.php
  2. 3
      resources/lang/en/imports.php
  3. 3
      resources/lang/zh-CN/imports.php
  4. 3
      resources/lang/zh-TW/imports.php

6
app/Imports/ParkingVipListImport.php

@ -36,12 +36,16 @@ class ParkingVipListImport implements ToModel
$this->index += 1; $this->index += 1;
$license = $row[1] ?? ''; $license = $row[1] ?? '';
if (empty($license)) { if (empty($license)) {
//$this->error[] = imports_error($this->index, 'import33'); $this->error[] = imports_error($this->index, 'import33');
return; return;
} }
$license_id = (new ParkingLicensePlateService( $license_id = (new ParkingLicensePlateService(
$this->logService $this->logService
))->createLicenseId($license); ))->createLicenseId($license);
if (!$license_id) {
$this->error[] = imports_error($this->index, 'import38');
return;
}
if (ParkingVipList::query()->where('license_id', $license_id) if (ParkingVipList::query()->where('license_id', $license_id)
->exists() ->exists()
) { ) {

3
resources/lang/en/imports.php

@ -37,5 +37,6 @@ return [
'import34' => 'The lane cannot be empty.', 'import34' => 'The lane cannot be empty.',
'import35' => 'Lane does not exist', 'import35' => 'Lane does not exist',
'import36' => 'The reason for passage cannot be empty.', 'import36' => 'The reason for passage cannot be empty.',
'import37' => 'The license plate number already exists.' 'import37' => 'The license plate number already exists.',
'import38' => 'Incorrect license plate number'
]; ];

3
resources/lang/zh-CN/imports.php

@ -37,5 +37,6 @@ return [
'import34' => '车道不能为空', 'import34' => '车道不能为空',
'import35' => '车道不存在', 'import35' => '车道不存在',
'import36' => '通行原因不能为空', 'import36' => '通行原因不能为空',
'import37' => '车牌号码已存在' 'import37' => '车牌号码已存在',
'import38' => '车牌号码错误'
]; ];

3
resources/lang/zh-TW/imports.php

@ -37,5 +37,6 @@ return [
'import34' => '車道不能為空', 'import34' => '車道不能為空',
'import35' => '車道不存在', 'import35' => '車道不存在',
'import36' => '通行原因不能為空', 'import36' => '通行原因不能為空',
'import37' => '車牌號碼已存在' 'import37' => '車牌號碼已存在',
'import38' => '車牌號碼錯誤'
]; ];

Loading…
Cancel
Save