first commit
This commit is contained in:
30
app/Models/Area.php
Normal file
30
app/Models/Area.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Area extends Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Notes: 上级地区
|
||||
* @Author: <C.Jason>
|
||||
* @Date: 2019/11/19 3:01 下午
|
||||
* @return mixed
|
||||
*/
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo(__CLASS__, 'parent_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 下级地区
|
||||
* @Author: <C.Jason>
|
||||
* @Date: 2019/11/19 3:01 下午
|
||||
* @return mixed
|
||||
*/
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(__CLASS__, 'parent_id');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user