- 新增3个migration(15张表): service/nanny/inventory - 新增15个Model + 13个Controller - 新增55条API路由(总计212条) - 新增3个前端API模块 + 11个管理页面 - vite build验证通过
14 lines
762 B
PHP
14 lines
762 B
PHP
<?php
|
|
namespace App\Models\Nanny;
|
|
use App\Traits\BelongsToStore;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
class Nanny extends Model
|
|
{
|
|
use BelongsToStore;
|
|
protected $fillable = ['store_id','name','phone','id_card','avatar','level','skills','experience_years','health_cert','cooperation_type','base_salary','introduction','status'];
|
|
protected function casts(): array { return ['level'=>'integer','skills'=>'array','experience_years'=>'integer','cooperation_type'=>'integer','base_salary'=>'decimal:2','status'=>'integer']; }
|
|
public function orders(): HasMany { return $this->hasMany(NannyOrder::class); }
|
|
public function schedules(): HasMany { return $this->hasMany(NannySchedule::class); }
|
|
}
|