belongsTo(Activity::class)->withDefault(); } public function user() { return $this->belongsTo(User::class)->withDefault(); } public function order() { return $this->belongsTo(Order::class)->withDefault(); } public function sanuser() { return $this->belongsTo(User::class, 'id', 'san_people_id')->withDefault(); } public function getStatusTextAttribute() { if ($this->used_at == '') { return '未使用'; } elseif ($this->used_at) { return '已使用'; } return ''; } }