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

28 lines
597 B

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