2048], [['order_no'], 'string', 'max' => 128], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'cx_mch_id' => '平台商户ID', 'scene' => '场景类型', 'type' => '类型:1=收入,2=支出', 'user_id' => '用户ID', 'money' => '金额', 'before_account_balance' => '变化前账户余额', 'after_account_balance' => '变化后账户余额', 'desc' => '描述', 'order_type' => '订单类型', 'order_no' => '订单号', 'ext' => '扩展信息', 'created_at' => '添加时间', 'is_delete' => '是否删除:0=否,1=是', 'deleted_at' => '删除时间', ]; } public function beforeSave($insert) { if(parent::beforeSave($insert)){ if($this->isNewRecord){ $this->created_at = time(); } if($this->is_delete == 1) $this->deleted_at = time(); $this->htmlTagFilter(); return true; } else { return false; } } public function htmlTagFilter() { $this->desc = Model::htmlTagFilter($this->desc); } }