- 取貨碼使用紀錄記實際出貨貨道(PickupCodeLog.raw_data.slot) - 銷售紀錄訂單列(支付金額欄)顯示取貨碼序號(member_barcode) - 遠端指令中心「遠端出貨」→「遠端開櫃」(zh_TW.json Remote Dispense) - 訂單品項記消費者選的貨道(order_items.slot_no + migration),失敗交易也看得到; 訂單明細顯示 Slot;OrderItem/TransactionService 對應 - 通行碼「只能使用一次」:pass_codes.usage_limit/usage_count + migration; 建立表單加勾選;B670(verifyPassCode)驗證時消耗、達上限標 used;PassCode.isValid 判斷 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
41 lines
767 B
PHP
41 lines
767 B
PHP
<?php
|
|
|
|
namespace App\Models\Transaction;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Models\Product\Product;
|
|
|
|
class OrderItem extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'order_id',
|
|
'product_id',
|
|
'product_name',
|
|
'slot_no',
|
|
'barcode',
|
|
'price',
|
|
'quantity',
|
|
'subtotal',
|
|
'metadata',
|
|
];
|
|
|
|
protected $casts = [
|
|
'price' => 'decimal:2',
|
|
'subtotal' => 'decimal:2',
|
|
'metadata' => 'array',
|
|
];
|
|
|
|
public function order()
|
|
{
|
|
return $this->belongsTo(Order::class);
|
|
}
|
|
|
|
public function product()
|
|
{
|
|
return $this->belongsTo(Product::class)->withTrashed();
|
|
}
|
|
}
|