123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace app\model;
- use support\Model;
- class MedicalDept extends Model
- {
- protected $table = 'medical_dept';
- protected $primaryKey = 'dept_id';
- protected $dateFormat = 'U';
- public const CREATED_AT = 'dept_addTime';
- public const UPDATED_AT = 'dept_updateTime';
-
- public function getByPrimaryKey($id)
- {
- return self::where('dept_id', $id)->first();
- }
-
- public function getAllSubDept($path)
- {
- return self::where('dept_path', 'like', $path . '%')->get()->toArray();
- }
- }
|