海南旅游SAAS
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.

27 lines
538 B

  1. <?php
  2. namespace App\Models;
  3. use Dcat\Admin\Traits\ModelTree;
  4. use Illuminate\Database\Eloquent\Factories\HasFactory;
  5. class Category extends BaseModel
  6. {
  7. use HasFactory;
  8. use ModelTree;
  9. // 模型树需要的三个属性
  10. protected $parentColumn = 'pid';
  11. protected $orderColumn = 'sort';
  12. protected $titleColumn = 'name';
  13. public function __construct(array $attributes = [])
  14. {
  15. parent::__construct($attributes);
  16. $this->timestamps = false;
  17. }
  18. //覆盖父类,不按id desc排序
  19. protected static function booted() { }
  20. }