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.
64 lines
1.2 KiB
64 lines
1.2 KiB
2 months ago
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
2 weeks ago
|
namespace App\Models\Admin;
|
||
2 months ago
|
|
||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
1 month ago
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
2 months ago
|
|
||
|
class Doctor extends Model
|
||
|
{
|
||
|
use HasFactory;
|
||
|
|
||
1 month ago
|
/**
|
||
|
* @var string
|
||
|
*/
|
||
|
protected $connection = 'mysql_admin';
|
||
|
|
||
|
/**
|
||
|
* @var string
|
||
|
*/
|
||
|
protected $table = 'doctors';
|
||
|
|
||
2 months ago
|
/**
|
||
|
* The attributes that are mass assignable.
|
||
|
*
|
||
|
* @var array<int, string>
|
||
|
*/
|
||
|
protected $fillable = [
|
||
|
'doctor_id',
|
||
|
'doctor_name',
|
||
1 month ago
|
'doctor_title',
|
||
|
'doctor_specialty',
|
||
2 months ago
|
'dept_id',
|
||
1 month ago
|
'avatar',
|
||
|
'introduction',
|
||
2 months ago
|
'sort',
|
||
1 month ago
|
'is_expert',
|
||
|
'is_enable',
|
||
2 months ago
|
];
|
||
|
|
||
|
/**
|
||
|
* The attributes that should be cast.
|
||
|
*
|
||
|
* @var array<string, string>
|
||
|
*/
|
||
|
protected $casts = [
|
||
|
'id' => 'integer',
|
||
|
'sort' => 'integer',
|
||
1 month ago
|
'is_expert' => 'integer',
|
||
|
'is_enable' => 'integer',
|
||
2 months ago
|
];
|
||
1 month ago
|
|
||
|
/**
|
||
|
* 科室
|
||
|
* @return BelongsTo
|
||
|
*/
|
||
|
public function department(): BelongsTo
|
||
|
{
|
||
|
return $this->belongsTo(Department::class, 'dept_id', 'dept_id');
|
||
|
}
|
||
2 months ago
|
}
|