Browse Source

闸机管理数据返回4

master
wanghongjun 2 days ago
parent
commit
81d97f8335
  1. 23
      app/Services/ParkingGateControlService.php
  2. 2
      resources/lang/en/service.php
  3. 2
      resources/lang/zh-CN/service.php
  4. 2
      resources/lang/zh-TW/service.php

23
app/Services/ParkingGateControlService.php

@ -21,6 +21,12 @@ class ParkingGateControlService extends BaseService
2 => 'manual' 2 => 'manual'
]; ];
public static array $leaveTypeArr
= [
1 => 'automatic2',
2 => 'manual2'
];
public static array $leaveRemarkArr public static array $leaveRemarkArr
= [ = [
1 => 'leave_remark1', 1 => 'leave_remark1',
@ -33,6 +39,7 @@ class ParkingGateControlService extends BaseService
public function getItem($item) public function getItem($item)
{ {
$typeArr = $this->getType(); $typeArr = $this->getType();
$leaveTypeArr = $this->getLeaveType();
$item['reserve_id'] = ''; $item['reserve_id'] = '';
if ($item['reservation_id']) { if ($item['reservation_id']) {
@ -56,7 +63,7 @@ class ParkingGateControlService extends BaseService
$item['parking'] = Parking::getName($ParkingChannel['parking_id']); $item['parking'] = Parking::getName($ParkingChannel['parking_id']);
} }
$item['enter_type_str'] = $typeArr[$item['enter_type']] ?? ''; $item['enter_type_str'] = $typeArr[$item['enter_type']] ?? '';
$item['leave_type_str'] = $typeArr[$item['leave_type']] ?? ''; $item['leave_type_str'] = $leaveTypeArr[$item['leave_type']] ?? '';
$item['dwell_time'] = get_time_difference_str( $item['dwell_time'] = get_time_difference_str(
$item['enter_at'], $item['enter_at'],
$item['leave_at'] ?: '' $item['leave_at'] ?: ''
@ -82,6 +89,18 @@ class ParkingGateControlService extends BaseService
return $typeArr; return $typeArr;
} }
/**
* @return array|string[]
*/
public function getLeaveType(): array
{
$typeArr = self::$leaveTypeArr;
foreach ($typeArr as $key => $value) {
$typeArr[$key] = __service($this->menuTitle . '.' . $value);
}
return $typeArr;
}
/** /**
* @return array|string[] * @return array|string[]
*/ */
@ -231,7 +250,7 @@ class ParkingGateControlService extends BaseService
) { ) {
$time_key = $key . '_at'; $time_key = $key . '_at';
$type_key = $key . '_type'; $type_key = $key . '_type';
$typeArr = $this->getType(); $typeArr = $key == 'leave' ? $this->getLeaveType() :$this->getType();
$data = [ $data = [
'channel_name' => '', // 车道名称 'channel_name' => '', // 车道名称
'equipment_name' => '', // 设备名称 'equipment_name' => '', // 设备名称

2
resources/lang/en/service.php

@ -174,6 +174,8 @@ return [
'gate_control' => [ 'gate_control' => [
'automatic' => 'Automatic entry', 'automatic' => 'Automatic entry',
'manual' => 'Manual entry', 'manual' => 'Manual entry',
'automatic2' => 'Automatic exit',
'manual2' => 'Manual exit',
'cat_exists' => 'The current vehicle has not left yet', 'cat_exists' => 'The current vehicle has not left yet',
'cat_not_exists' => 'The current vehicle has not entered the venue', 'cat_not_exists' => 'The current vehicle has not entered the venue',
'not_reservation' => 'No appointment available', 'not_reservation' => 'No appointment available',

2
resources/lang/zh-CN/service.php

@ -174,6 +174,8 @@ return [
'gate_control' => [ 'gate_control' => [
'automatic' => '自动入场', 'automatic' => '自动入场',
'manual' => '手动入场', 'manual' => '手动入场',
'automatic2' => '自动出场',
'manual2' => '手动出场',
'cat_exists' => '当前车辆还未离场', 'cat_exists' => '当前车辆还未离场',
'cat_not_exists' => '当前车辆未入场', 'cat_not_exists' => '当前车辆未入场',
'not_reservation' => '无预约', 'not_reservation' => '无预约',

2
resources/lang/zh-TW/service.php

@ -174,6 +174,8 @@ return [
'gate_control' => [ 'gate_control' => [
'automatic' => '自動入場', 'automatic' => '自動入場',
'manual' => '手動入場', 'manual' => '手動入場',
'automatic2' => '自動出場',
'manual2' => '手動出場',
'cat_exists' => '當前車輛還未離場', 'cat_exists' => '當前車輛還未離場',
'cat_not_exists' => '當前車輛未入場', 'cat_not_exists' => '當前車輛未入場',
'not_reservation' => '無預約', 'not_reservation' => '無預約',

Loading…
Cancel
Save