[RELEASE] 釋出 demo 分支修復內容至正式生產環境 main 分支
本次正式生產環境發布包含以下修復: 1. 修復員工識別卡「最後使用」資料無法更新之問題 (透過 StaffCardLog 模型事件監聽器自動回寫,並排除租戶 Scope)。 2. 修正員工識別卡刪除/解除關聯時網頁直接渲染顯示 JSON 字串之錯誤,改為判斷 AJAX 請求並執行正常的重導向。 3. 補齊多語系語系檔(zh_TW.json, en.json, ja.json)中有關「刪除員工識別卡」的翻譯對照。
This commit is contained in:
commit
115a4f0263
@ -126,10 +126,14 @@ class StaffCardController extends Controller
|
||||
{
|
||||
$staffCard->delete();
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => __('Staff card deleted successfully'),
|
||||
]);
|
||||
if (request()->ajax()) {
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => __('Staff card deleted successfully'),
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()->route('admin.data-config.staff-cards.index')->with('success', __('Staff card deleted successfully'));
|
||||
}
|
||||
|
||||
public function toggleStatus(StaffCard $staffCard)
|
||||
|
||||
@ -30,6 +30,25 @@ class StaffCardLog extends Model
|
||||
'created_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
* 註冊 Model 事件以自動更新 StaffCard 的最後使用狀態
|
||||
*/
|
||||
protected static function booted()
|
||||
{
|
||||
static::created(function ($log) {
|
||||
if ($log->staff_card_id) {
|
||||
// 使用 withoutGlobalScopes 確保不論在任何 Session Context 下皆能正確寫入
|
||||
$staffCard = StaffCard::withoutGlobalScopes()->find($log->staff_card_id);
|
||||
if ($staffCard) {
|
||||
$staffCard->update([
|
||||
'last_used_at' => $log->created_at ?? now(),
|
||||
'last_machine_id' => $log->machine_id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 取得關聯的員工卡片
|
||||
*/
|
||||
|
||||
@ -144,6 +144,7 @@
|
||||
"Are you sure you want to delete this product?": "Are you sure you want to delete this product?",
|
||||
"Are you sure you want to delete this product? All related historical translation data will also be removed.": "Are you sure you want to delete this product? All related historical translation data will also be removed.",
|
||||
"Are you sure you want to delete this role? This action cannot be undone.": "Are you sure you want to delete this role? This action cannot be undone.",
|
||||
"Are you sure you want to delete this staff card? This action cannot be undone.": "Are you sure you want to delete this staff card? This action cannot be undone.",
|
||||
"Are you sure you want to delete your account?": "Are you sure you want to delete your account?",
|
||||
"Are you sure you want to disable this advertisement?": "Are you sure you want to disable this advertisement?",
|
||||
"Are you sure you want to disable this pass code? It will no longer be valid for machine access.": "Are you sure you want to disable this pass code? It will no longer be valid for machine access.",
|
||||
|
||||
@ -144,6 +144,7 @@
|
||||
"Are you sure you want to delete this product?": "この商品を削除してもよろしいですか?",
|
||||
"Are you sure you want to delete this product? All related historical translation data will also be removed.": "この商品を削除してもよろしいですか?関連するすべての翻訳履歴データも削除されます。",
|
||||
"Are you sure you want to delete this role? This action cannot be undone.": "このロールを削除してもよろしいですか?取り消しはできません。",
|
||||
"Are you sure you want to delete this staff card? This action cannot be undone.": "このスタッフカードを削除してもよろしいですか?この操作は取り消せません。",
|
||||
"Are you sure you want to delete your account?": "アカウントを削除してもよろしいですか?",
|
||||
"Are you sure you want to disable this advertisement?": "この広告を無効にしてもよろしいですか?",
|
||||
"Are you sure you want to disable this pass code? It will no longer be valid for machine access.": "このパスコードを無効にしてもよろしいですか?機器へのアクセスに使用できなくなります。",
|
||||
|
||||
@ -144,6 +144,7 @@
|
||||
"Are you sure you want to delete this product?": "您確定要刪除此商品嗎?",
|
||||
"Are you sure you want to delete this product? All related historical translation data will also be removed.": "確定要刪除此商品嗎?所有相關的歷史翻譯數據也將被移除。",
|
||||
"Are you sure you want to delete this role? This action cannot be undone.": "您確定要刪除此角色嗎?此操作將無法復原。",
|
||||
"Are you sure you want to delete this staff card? This action cannot be undone.": "您確定要刪除此員工識別卡嗎?此操作將無法復原。",
|
||||
"Are you sure you want to delete your account?": "您確定要刪除您的帳號嗎?",
|
||||
"Are you sure you want to disable this advertisement?": "您確定要停用此廣告嗎?",
|
||||
"Are you sure you want to disable this pass code? It will no longer be valid for machine access.": "您確定要停用此通行碼嗎?停用後將無法再用於機台存取。",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user