1. 新增 B680 員工卡驗證 API 並更新相關技術文件 (SKILL.md, api-docs.php)。 2. 重構取貨碼與通行碼之日誌追蹤系統,新增 PickupCodeLog 與 PassCodeLog 模型及資料表遷移。 3. 修正 B660 API 路由方法,統一使用 POST 進行驗證。 4. 優化後台銷售中心介面,將「紀錄」頁籤統一為「使用紀錄」並優化狀態顯示組件。 5. 更新多語系 zh_TW.json 以符合新的 UI 命名規範。 6. 調整 Order 模型與 TransactionService 以支援更精確的封閉迴圈交易審核。
49 lines
904 B
PHP
49 lines
904 B
PHP
<?php
|
|
|
|
namespace App\Models\Transaction;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Models\Machine\Machine;
|
|
use App\Models\System\User;
|
|
use App\Traits\TenantScoped;
|
|
|
|
class PickupCodeLog extends Model
|
|
{
|
|
use TenantScoped;
|
|
|
|
protected $fillable = [
|
|
'company_id',
|
|
'machine_id',
|
|
'pickup_code_id',
|
|
'order_id',
|
|
'action',
|
|
'user_id', // Optional, for admin actions recorded here
|
|
'remark',
|
|
'raw_data'
|
|
];
|
|
|
|
protected $casts = [
|
|
'raw_data' => 'array'
|
|
];
|
|
|
|
public function machine()
|
|
{
|
|
return $this->belongsTo(Machine::class);
|
|
}
|
|
|
|
public function pickupCode()
|
|
{
|
|
return $this->belongsTo(PickupCode::class);
|
|
}
|
|
|
|
public function order()
|
|
{
|
|
return $this->belongsTo(Order::class);
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|