Rule.php 542 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Model;
  4. use Hyperf\DbConnection\Model\Model;
  5. /**
  6. */
  7. class Rule extends Model
  8. {
  9. /**
  10. * The table associated with the model.
  11. */
  12. protected ?string $table = 'rule';
  13. /**
  14. * The attributes that are mass assignable.
  15. */
  16. protected array $fillable = [];
  17. /**
  18. * The attributes that should be cast to native types.
  19. */
  20. protected array $casts = [];
  21. public function arts()
  22. {
  23. return $this->hasMany(Article::class,'rule_id','id');
  24. }
  25. }