WebsiteCategory.php 730 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Model;
  4. use Hyperf\DbConnection\Model\Model;
  5. /**
  6. */
  7. class WebsiteCategory extends Model
  8. {
  9. /**
  10. * The table associated with the model.
  11. */
  12. protected ?string $table = 'website_category';
  13. /**
  14. * The attributes that are mass assignable.
  15. */
  16. protected array $fillable = ['website_id','name','sort','pid','seo_title', 'seo_keywords','seo_description','pid_arr','alias','category_arr_id','category_id','is_url','web_url'];
  17. /**
  18. * The attributes that should be cast to native types.
  19. */
  20. protected array $casts = [];
  21. public function children()
  22. {
  23. return $this->hasMany(WebsiteCategory::class, 'pid', 'category_id');
  24. }
  25. }