Behavior.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: durong
  5. * Date: 2019/6/10
  6. * Time: 11:22
  7. */
  8. namespace App\Models;
  9. use Illuminate\Database\Eloquent\Model;
  10. class Behavior extends Model
  11. {
  12. protected $table = 'behavior';
  13. protected $guarded = [];
  14. /**
  15. * 可被批量赋值的字段
  16. * @var array
  17. */
  18. protected $fillable = ['virus_behavior_id','name','behavior_level','behavior_cycle_type','behavior_action_id','behavior_cycle','is_open'];
  19. public function RegisteredRecord()
  20. {
  21. return $this->hasMany('App\Models\RegisteredRecord','virus_behavior_id','virus_behavior_id');
  22. }
  23. public function CommentRecord()
  24. {
  25. return $this->hasMany('App\Models\CommentRecord','virus_behavior_id','virus_behavior_id');
  26. }
  27. public function ReleaseRecord()
  28. {
  29. return $this->hasMany('App\Models\ReleaseRecord','virus_behavior_id','virus_behavior_id');
  30. }
  31. public function GeneralRecord()
  32. {
  33. return $this->hasMany('App\Models\GeneralRecord','virus_behavior_id','virus_behavior_id');
  34. }
  35. }