64], [['title'], 'string', 'max' => 128], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'cx_mch_id' => '平台商户ID', 'user_id' => '用户ID', 'order_no' => '提交的订单号', 'transfer_order_no' => '发起打款的订单号', 'amount' => '金额', 'is_pay' => '支付状态: 0=未支付,1=已支付', 'pay_type' => '支付方式', 'title' => '支付摘要', 'created_at' => '添加时间', 'updated_at' => '更新时间', ]; } public function beforeSave($insert) { if(parent::beforeSave($insert)){ if($this->isNewRecord){ $this->created_at = time(); } $this->updated_at = time(); $this->htmlTagFilter(); return true; } else { return false; } } public function htmlTagFilter() { $this->title = Model::htmlTagFilter($this->title); } }