香洲二院小程序
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.
mini_xzey/app/Models/Admin/Doctor.php

64 lines
1.2 KiB

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