Behavior.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 =
  19. ['virus_behavior_id','name','behavior_level','behavior_cycle_type','behavior_action_id','behavior_cycle','is_open','behavior_binding_users','physical_strength',
  20. 'rainbow_beans','remarks','behavioral_cycle_start_time','behavioral_cycle_end_time','allotted_quantity_rule','behavior_identification','relative_series','trigger_times',
  21. 'effective_trigger', 'absolute_progression','grant_rainbow_beans'
  22. ];
  23. public function RegisteredRecord()
  24. {
  25. return $this->hasMany('App\Models\RegisteredRecord','virus_behavior_id','virus_behavior_id');
  26. }
  27. public function CommentRecord()
  28. {
  29. return $this->hasMany('App\Models\CommentRecord','virus_behavior_id','virus_behavior_id');
  30. }
  31. public function ReleaseRecord()
  32. {
  33. return $this->hasMany('App\Models\ReleaseRecord','virus_behavior_id','virus_behavior_id');
  34. }
  35. public function GeneralRecord()
  36. {
  37. return $this->hasMany('App\Models\GeneralRecord','virus_behavior_id','virus_behavior_id');
  38. }
  39. }