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.
56 lines
1.0 KiB
56 lines
1.0 KiB
1 month ago
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
2 weeks ago
|
namespace App\Models\Admin;
|
||
1 month ago
|
|
||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
||
|
class DepartmentTip extends Model
|
||
|
{
|
||
|
use HasFactory;
|
||
|
|
||
|
/**
|
||
|
* @var string
|
||
|
*/
|
||
|
protected $connection = 'mysql_admin';
|
||
|
|
||
|
/**
|
||
|
* @var string
|
||
|
*/
|
||
|
protected $table = 'department_tips';
|
||
|
|
||
|
/**
|
||
|
* The attributes that are mass assignable.
|
||
|
*
|
||
|
* @var array<int, string>
|
||
|
*/
|
||
|
protected $fillable = [
|
||
|
'dept_id',
|
||
|
'title',
|
||
|
'message',
|
||
|
'is_enable'
|
||
|
];
|
||
|
|
||
|
/**
|
||
|
* The attributes that should be cast.
|
||
|
*
|
||
|
* @var array<string, string>
|
||
|
*/
|
||
|
protected $casts = [
|
||
|
'id' => 'integer',
|
||
|
'is_enable' => 'integer',
|
||
|
];
|
||
|
|
||
|
/**
|
||
|
* 科室分类
|
||
|
* @return BelongsTo
|
||
|
*/
|
||
|
public function department(): BelongsTo
|
||
|
{
|
||
|
return $this->belongsTo(Department::class, 'dept_id', 'dept_id');
|
||
|
}
|
||
|
}
|