star-cloud/app/Models/StaffCardLog.php
sky121113 fc93a0fb8c [FEAT] 實作封閉迴圈交易審核與 API 規格標準化
1. 新增 B680 員工卡驗證 API 並更新相關技術文件 (SKILL.md, api-docs.php)。
2. 重構取貨碼與通行碼之日誌追蹤系統,新增 PickupCodeLog 與 PassCodeLog 模型及資料表遷移。
3. 修正 B660 API 路由方法,統一使用 POST 進行驗證。
4. 優化後台銷售中心介面,將「紀錄」頁籤統一為「使用紀錄」並優化狀態顯示組件。
5. 更新多語系 zh_TW.json 以符合新的 UI 命名規範。
6. 調整 Order 模型與 TransactionService 以支援更精確的封閉迴圈交易審核。
2026-05-05 17:50:26 +08:00

49 lines
908 B
PHP

<?php
namespace App\Models;
use App\Traits\TenantScoped;
use App\Models\Machine\Machine;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class StaffCardLog extends Model
{
use TenantScoped;
public $timestamps = false;
protected $fillable = [
'company_id',
'staff_card_id',
'machine_id',
'payment_type',
'code_id',
'order_id',
'action',
'remark',
'raw_data',
];
protected $casts = [
'raw_data' => 'array',
'created_at' => 'datetime',
];
/**
* 取得關聯的員工卡片
*/
public function staffCard(): BelongsTo
{
return $this->belongsTo(StaffCard::class);
}
/**
* 取得刷卡的機台
*/
public function machine(): BelongsTo
{
return $this->belongsTo(Machine::class);
}
}