1. 新增機台異常日誌手動解除功能,包含資料庫欄位更新與 UI 操作按鈕。 2. 實作機台庫存變動紀錄系統 (Machine Stock Movements),支援追蹤補貨與銷售產生的庫存異動。 3. 重構取貨碼 (Pickup Code) 與通行碼 (Pass Code) 管理介面,採用極簡奢華風 UI 並拆分 Partial Views 提升可維護性。 4. 優化取貨操作日誌,明確區分「取貨成功」與「取貨失敗」,並加入顏色標籤增強辨識度。 5. 擴充多語系支援 (繁中、英文、日文),確保所有新功能與操作狀態均有對應翻譯。 6. 更新 IoT API 規格文件與相關 Service 邏輯,加強指令確認 (ACK) 處理機制。
58 lines
1.1 KiB
PHP
58 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models\System;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Traits\TenantScoped;
|
|
use App\Models\System\User;
|
|
|
|
class SystemOperationLog extends Model
|
|
{
|
|
use HasFactory, TenantScoped;
|
|
|
|
protected $appends = [
|
|
'translated_note',
|
|
];
|
|
|
|
/**
|
|
* 動態翻譯備註
|
|
*/
|
|
public function getTranslatedNoteAttribute(): ?string
|
|
{
|
|
if (empty($this->note)) {
|
|
return null;
|
|
}
|
|
|
|
return __($this->note, array_merge(
|
|
$this->old_values ?? [],
|
|
$this->new_values ?? []
|
|
));
|
|
}
|
|
|
|
|
|
protected $fillable = [
|
|
'company_id',
|
|
'user_id',
|
|
'module',
|
|
'action',
|
|
'target_id',
|
|
'target_type',
|
|
'old_values',
|
|
'new_values',
|
|
'note',
|
|
'ip_address',
|
|
'user_agent',
|
|
];
|
|
|
|
protected $casts = [
|
|
'old_values' => 'array',
|
|
'new_values' => 'array',
|
|
];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|