Browse Source

优化日志添加

master
wanghongjun 5 days ago
parent
commit
5dbe76729a
  1. 11
      app/Services/ParkingElectronicMapService.php
  2. 5
      app/Services/ParkingSpaceService.php

11
app/Services/ParkingElectronicMapService.php

@ -9,6 +9,17 @@ use App\Models\ParkingSpace;
class ParkingElectronicMapService extends BaseService class ParkingElectronicMapService extends BaseService
{ {
/**
* 构造函数
* @param OperationLogService $logService
*/
public function __construct(OperationLogService $logService)
{
parent::__construct($logService);
$this->logService = $logService;
$this->logService->menuTitle = 'draw_map';
}
public function saveModel(array $data) public function saveModel(array $data)
{ {
$floor_id = $data['floor_id']; $floor_id = $data['floor_id'];

5
app/Services/ParkingSpaceService.php

@ -29,6 +29,7 @@ class ParkingSpaceService extends BaseService
public function __construct(OperationLogService $logService) public function __construct(OperationLogService $logService)
{ {
parent::__construct($logService); parent::__construct($logService);
$this->logService->menuTitle = 'cat_list';
} }
/** /**
@ -128,7 +129,7 @@ class ParkingSpaceService extends BaseService
]; ];
$model->update($updateData); $model->update($updateData);
$str = $key == 'space_type_id' ? '类型' : '属性'; $str = $key == 'space_type_id' ? 'space_type.update' : 'space_attributes.update';
$newValue = $oldValues; $newValue = $oldValues;
$newValue[$key] = $data_id; $newValue[$key] = $data_id;
@ -137,7 +138,7 @@ class ParkingSpaceService extends BaseService
$this->logService->logUpdatedData( $this->logService->logUpdatedData(
new ParkingSpace(), new ParkingSpace(),
$oldValues, $oldValues,
"更新车位" . $str, $str,
$newValue $newValue
); );
DB::commit(); DB::commit();

Loading…
Cancel
Save