49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Auth;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class DingTalkBindingRequest extends Model
|
|
{
|
|
public const PENDING = 'pending';
|
|
public const APPROVED = 'approved';
|
|
public const REJECTED = 'rejected';
|
|
public const REVOKED = 'revoked';
|
|
|
|
protected $table = 'dingtalk_binding_requests';
|
|
|
|
protected $fillable = [
|
|
'union_id',
|
|
'open_id',
|
|
'dingtalk_user_id',
|
|
'nickname',
|
|
'email_hash',
|
|
'mobile_hash',
|
|
'email_hint',
|
|
'mobile_hint',
|
|
'status',
|
|
'match_reason',
|
|
'matched_user_id',
|
|
'reviewed_by',
|
|
'last_attempted_at',
|
|
'reviewed_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'last_attempted_at' => 'datetime',
|
|
'reviewed_at' => 'datetime',
|
|
];
|
|
|
|
public function matchedUser(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'matched_user_id');
|
|
}
|
|
|
|
public function reviewer(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'reviewed_by');
|
|
}
|
|
}
|