订单列表--完善
This commit is contained in:
@@ -25,3 +25,7 @@ func (dt *FsOrderDetailTemplateModel) FindOne(ctx context.Context, id int64) (re
|
||||
err = dt.db.WithContext(ctx).Model(&FsOrderDetailTemplate{}).Where("`id` = ?", id).Take(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (m *FsOrderDetailTemplateModel) TableName() string {
|
||||
return m.name
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ func (o *FsOrderModel) FindPageListByPage(ctx context.Context, rowBuilder *gorm.
|
||||
rowBuilder = rowBuilder.Scopes(handler.Paginate(page, pageSize))
|
||||
|
||||
// 结果
|
||||
result := rowBuilder.WithContext(ctx).Find(&resp)
|
||||
result := rowBuilder.Debug().WithContext(ctx).Find(&resp)
|
||||
if result.Error != nil {
|
||||
return nil, result.Error
|
||||
} else {
|
||||
@@ -93,8 +93,20 @@ type FsOrderRel struct {
|
||||
|
||||
type FsOrderDetails struct {
|
||||
FsOrderDetail
|
||||
FsOrderDetailTemplateInfo FsOrderDetailTemplate `gorm:"foreignKey:id;references:order_detail_template_id"`
|
||||
FsProductInfo FsProduct `gorm:"foreignKey:id;references:product_id"`
|
||||
FsOrderDetailTemplateInfo FsOrderDetailTemplateInfo `gorm:"foreignKey:id;references:order_detail_template_id"`
|
||||
FsProductInfo FsProduct `gorm:"foreignKey:id;references:product_id"`
|
||||
}
|
||||
|
||||
type FsOrderDetailTemplateInfo struct {
|
||||
FsOrderDetailTemplate
|
||||
FsProductDesignInfo FsProductDesignInfo `gorm:"foreignKey:id;references:design_id"` //获取设计数据
|
||||
FsProductSizeInfo FsProductSize `gorm:"foreignKey:id;references:size_id"`
|
||||
}
|
||||
|
||||
type FsProductDesignInfo struct {
|
||||
FsProductDesign
|
||||
OptionData FsProduct `gorm:"foreignKey:id;references:optional_id"` //获取配件信息
|
||||
TemplateData FsProductTemplateV2 `gorm:"foreignKey:id;references:template_id"` //获取模板信息
|
||||
}
|
||||
|
||||
func (m *FsOrderModel) RowSelectBuilder(selectData []string) *gorm.DB {
|
||||
|
||||
@@ -34,3 +34,7 @@ func (d *FsProductDesignModel) Create(ctx context.Context, data *FsProductDesign
|
||||
func (d *FsProductDesignModel) UpdateBySn(ctx context.Context, sn string, data *FsProductDesign) error {
|
||||
return d.db.WithContext(ctx).Model(&FsProductDesign{}).Where("`sn` = ?", sn).Updates(&data).Error
|
||||
}
|
||||
|
||||
func (m *FsProductDesignModel) TableName() string {
|
||||
return m.name
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user