64], [['content', 'review_comment'], 'string', 'max' => 2048], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'cx_mch_id' => '平台商户ID', 'user_id' => '用户ID', 'cat_id' => '分类ID', 'contact' => '联系方式:QQ|手机号', 'content' => '反馈内容', 'pic_list' => '反馈图片', 'created_at' => '添加时间', 'updated_at' => '更新时间', 'is_delete' => '是否删除:0=否,1=是 ', 'deleted_at' => '删除时间', 'review_user_id' => '处理人ID', 'review_status' => '处理状态:0=待处理,1=已处理', 'review_time' => '处理时间', 'review_comment' => '处理意见', ]; } public function beforeSave($insert) { if(parent::beforeSave($insert)){ if($this->isNewRecord){ $this->created_at = time(); } $this->updated_at = time(); if($this->is_delete == 1) $this->deleted_at = time(); $this->htmlTagFilter(); return true; } else { return false; } } public function htmlTagFilter() { $this->contact = Model::htmlTagFilter($this->contact); $this->content = Model::htmlTagFilter($this->content); $this->review_comment = Model::htmlTagFilter($this->review_comment); } public static function reviewStatusLabels() { return [ '0' => '待处理', '1' => '已处理', ]; } public static function getReviewStatus($status) { $labels = self::reviewStatusLabels(); return isset($labels[$status]) ? $labels[$status] : "未知"; } }