64], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'cx_mch_id' => '平台商户ID', 'order_no' => '订单号', 'user_id' => '用户ID', 'pay_price' => '支付金额', 'send_price' => '赠送金额', 'pay_type' => '支付类型', 'is_pay' => '是否支付:0=否,1=是', 'pay_time' => '支付时间', 'created_at' => '添加时间', 'updated_at' => '更新时间', 'is_delete' => '是否删除:0=否,1=是', 'deleted_at' => '删除时间', ]; } 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(); return true; } else { return false; } } }