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

36 lines
684 B

4 years ago
  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. protected $fillable = [
  15. 'agent_id',
  16. 'name',
  17. 'pid',
  18. 'sort',
  19. 'template',
  20. ];
  21. public function __construct(array $attributes = [])
  22. {
  23. parent::__construct($attributes);
  24. $this->timestamps = false;
  25. }
  26. //覆盖父类,不按id desc排序
  27. protected static function booted() { }
  28. }