You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.0 KiB
50 lines
1.0 KiB
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
use Laravel\Sanctum\HasApiTokens;
|
|
|
|
class MiniappUser extends Authenticatable
|
|
{
|
|
use HasApiTokens;
|
|
use SoftDeletes;
|
|
|
|
protected $fillable = [
|
|
'openid',
|
|
'unionid',
|
|
'nickname',
|
|
'avatar_url',
|
|
'name',
|
|
'mobile',
|
|
'company',
|
|
'teacher_id',
|
|
'converted_at',
|
|
'status',
|
|
];
|
|
|
|
protected $casts = [
|
|
'teacher_id' => 'integer',
|
|
'converted_at' => 'datetime',
|
|
'status' => 'integer',
|
|
];
|
|
|
|
public function teacher(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Teacher::class);
|
|
}
|
|
|
|
public function courseSignups(): HasMany
|
|
{
|
|
return $this->hasMany(CourseSignup::class);
|
|
}
|
|
|
|
public function activitySignups(): HasMany
|
|
{
|
|
return $this->hasMany(ActivitySignup::class);
|
|
}
|
|
}
|