| Total Complexity | 3 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Category extends Model |
||
| 9 | { |
||
| 10 | protected $guarded = []; |
||
| 11 | |||
| 12 | public static $searchField = [ |
||
| 13 | 'name' => '名称', |
||
| 14 | ]; |
||
| 15 | |||
| 16 | public static $listField = [ |
||
| 17 | 'parentName' => '上级分类', |
||
| 18 | 'entityName' => '关联模型', |
||
| 19 | 'order' => '排序', |
||
| 20 | ]; |
||
| 21 | |||
| 22 | public function parent() |
||
| 25 | } |
||
| 26 | |||
| 27 | public function children() |
||
| 28 | { |
||
| 29 | return $this->hasMany('App\Model\Admin\Category', 'pid'); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function entity() |
||
| 35 | } |
||
| 36 | } |
||
| 37 |