512], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'cx_mch_id' => '平台商户ID', 'user_id' => '用户ID', 'name' => '名称', 'is_default' => '是否默认', 'is_delete' => '是否删除', 'created_at' => '添加时间', ]; } public function beforeSave($insert) { if(parent::beforeSave($insert)){ if($this->isNewRecord){ $this->created_at = time(); } $this->htmlTagFilter(); return true; } else { return false; } } public function htmlTagFilter() { $this->name = Model::htmlTagFilter($this->name); } }