255], [['serial_no'], 'string', 'max' => 60], [['goods_id'], 'string', 'max' => 20], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'cx_mch_id' => '平台商户ID', 'order_id' => '订单ID', 'goods_id' => '商品ID', 'num' => '购买商品数量', 'unit_price' => '商品单价', 'total_original_price' => '商品原总价(优惠前)', 'total_price' => '商品总价(优惠后)', 'goods_attr_info' => '购买商品信息', 'is_delete' => '是否删除:0=否,1=是', 'created_at' => '添加时间', 'updated_at' => '更新时间', 'deleted_at' => '删除时间', 'is_refund' => '是否退款', 'refund_status' => '售后状态:0=未售后,1=售后中,2=售后结束', 'plugin_sign' => '插件标识', 'serial_no' => '商品货号', 'goods_type' => '商品类型', ]; } 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; } } }