- 新增 Preline UI 3.2.3 作為 UI 組件庫 - 更新 tailwind.config.js 整合 Preline - 更新 app.js 初始化 Preline - 完全重寫 README.md 以 Docker 容器化架構為核心 - 新增 Docker 常用指令大全 - 新增故障排除與生產部署指南 - 新增會員系統相關功能(會員、錢包、點數、會籍、禮物) - 新增社交登入測試功能
45 lines
954 B
PHP
45 lines
954 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class MemberPoint extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'member_id',
|
|
'available_points',
|
|
'pending_points',
|
|
'expired_points',
|
|
'used_points',
|
|
];
|
|
|
|
protected $casts = [
|
|
'available_points' => 'integer',
|
|
'pending_points' => 'integer',
|
|
'expired_points' => 'integer',
|
|
'used_points' => 'integer',
|
|
];
|
|
|
|
/**
|
|
* 所屬會員
|
|
*/
|
|
public function member(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Member::class);
|
|
}
|
|
|
|
/**
|
|
* 點數異動紀錄
|
|
*/
|
|
public function transactions(): HasMany
|
|
{
|
|
return $this->hasMany(PointTransaction::class, 'member_id', 'member_id');
|
|
}
|
|
}
|