53 lines
1.2 KiB
PHP
53 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/** 下注订单头 {@see ticket_orders} */
|
|
final class TicketOrder extends Model
|
|
{
|
|
protected $fillable = [
|
|
'order_no',
|
|
'player_id',
|
|
'draw_id',
|
|
'currency_code',
|
|
'total_bet_amount',
|
|
'total_rebate_amount',
|
|
'total_actual_deduct',
|
|
'total_estimated_payout',
|
|
'status',
|
|
'submit_source',
|
|
'client_trace_id',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'player_id' => 'integer',
|
|
'draw_id' => 'integer',
|
|
'total_bet_amount' => 'integer',
|
|
'total_rebate_amount' => 'integer',
|
|
'total_actual_deduct' => 'integer',
|
|
'total_estimated_payout' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function player(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Player::class);
|
|
}
|
|
|
|
public function draw(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Draw::class);
|
|
}
|
|
|
|
public function items(): HasMany
|
|
{
|
|
return $this->hasMany(TicketItem::class, 'order_id');
|
|
}
|
|
}
|