<?php
/**
 * Created by PhpStorm.
 * User: durong
 * Date: 2019/6/10
 * Time: 11:22
 */

namespace App\Models;
use Illuminate\Database\Eloquent\Model;

class Behavior extends Model
{
    protected $table = 'behavior';
    protected $guarded = [];
    /**
     * 可被批量赋值的字段
     * @var array
     */
    protected $fillable =
        ['virus_behavior_id','name','behavior_level','behavior_cycle_type','behavior_action_id','behavior_cycle','is_open','behavior_binding_users','physical_strength',
        'rainbow_beans','remarks','behavioral_cycle_start_time','behavioral_cycle_end_time','allotted_quantity_rule','behavior_identification','relative_series','trigger_times',
         'effective_trigger', 'absolute_progression','grant_rainbow_beans'
        ];

    public function RegisteredRecord()
    {
        return $this->hasMany('App\Models\RegisteredRecord','virus_behavior_id','virus_behavior_id');
    }

    public function CommentRecord()
    {
        return $this->hasMany('App\Models\CommentRecord','virus_behavior_id','virus_behavior_id');
    }

    public function ReleaseRecord()
    {
        return $this->hasMany('App\Models\ReleaseRecord','virus_behavior_id','virus_behavior_id');
    }

    public function GeneralRecord()
    {
        return $this->hasMany('App\Models\GeneralRecord','virus_behavior_id','virus_behavior_id');
    }
}