"老年", self::AUDIENCE_CROWD_STAFF=>"员工", self::AUDIENCE_CROWD_MIDDLE_MIN_STUDENT=>"中小学生", self::AUDIENCE_CROWD_COLLEGE_STUDENT=>"大学生", self::AUDIENCE_CROWD_PREGNANT_WOMAN=>"孕妇", self::AUDIENCE_CROWD_EMERGENCY_RELATED_POPULATIONS=>"应急相关人群", self::AUDIENCE_CROWD_CHRONIC_DISEASE_POPULATION=>"慢病人群", self::AUDIENCE_CROWD_MENTAL_FAMILY_MEMBERS=>"精神障碍患者家属", self::AUDIENCE_CROWD_SOCIAL_WORKER=>"社工", self::AUDIENCE_CROWD_NURSING_STAFF=>"护理人员", self::AUDIENCE_CROWD_OTHER=>"其他", ); //方式[1:健康宣传活动,2:健康教育讲座,3:培训,4:小组讨论与座谈,5:知识竞赛,6:心理行为问题筛查与健康咨询,7:其它] const MODE_HEALTH_PROMOTION_ACTIVITIES = 1; const MODE_HEALTH_EDUCATION_LECTURE = 2; const MODE_TRAIN = 3; const MODE_GROUP_DISCUSSION_AND_DISCUSSION = 4; const MODE_KNOWLEDGE_COMPETITION = 5; const MODE_PSYCHOLOGICAL_AND_HEALTH_COUNSELING = 6; const MODE_OTHER = 7; //活动类型[1:科普基地,2:宣传活动,3:特色服务] const TYPE_SCIENCE_POPULARIZATION_BASE = 1; const TYPE_PROMOTION_ACTIVITIES = 2; const TYPE_FEATURED_SERVICES = 3; const TYPE_FEATURED_REPORT_RECEIPT = 4; const TYPE_MAP= array( self::TYPE_SCIENCE_POPULARIZATION_BASE=>"科普基地", self::TYPE_PROMOTION_ACTIVITIES=>"宣传活动", self::TYPE_FEATURED_SERVICES=>"特色项目", self::TYPE_FEATURED_REPORT_RECEIPT=>"回执上报", ) ; const MODE_MAP= array( self::MODE_HEALTH_PROMOTION_ACTIVITIES=>"健康宣传活动", self::MODE_HEALTH_EDUCATION_LECTURE=>"健康教育讲座", self::MODE_TRAIN=>"培训", self::MODE_GROUP_DISCUSSION_AND_DISCUSSION=>"小组讨论与座谈", self::MODE_KNOWLEDGE_COMPETITION=>"知识竞赛", self::MODE_PSYCHOLOGICAL_AND_HEALTH_COUNSELING=>"心理行为问题筛查与健康咨询", self::MODE_OTHER=>"其它", ) ; const ACTIVITIES_TYPE_MAP = array( self::ACTIVITIES_TYPE_COMMUNITY=>"进社区", self::ACTIVITIES_TYPE_ENTERPRISE=>"进企业", self::ACTIVITIES_TYPE_SCHOOL=>"进学校", self::ACTIVITIES_TYPE_SPECIAL_GROUP=>"进特殊群体", ); const AUDIT_STATUS_PENDING = 0; const AUDIT_STATUS_PASS = 1; const AUDIT_STATUS_REJECT = 2; const AUDIT_STATUS_MAP = array( self::AUDIT_STATUS_PENDING=>"待审核", self::AUDIT_STATUS_PASS=>"已通过", self::AUDIT_STATUS_REJECT=>"已驳回", ); // protected $casts = ['cover'=>'array','comment_tag'=>'array']; public static function boot () { parent::boot(); if(self::$mode == 'admin'){ static::creating(function ($model){ $model->creator = Admin::user()->id; }); } if(self::$mode == 'admin'){ static::updating(function ($model){ $model->updator = Admin::user()->id; }); } } public function setExtAttribute($ext) { if (is_array($ext)) { $this->attributes['ext'] = json_encode($ext); } } public function getExtAttribute($ext) { return json_decode($ext, true); } }