fix
This commit is contained in:
parent
fec2ea5789
commit
46ee5a94bd
@ -8,25 +8,19 @@ import (
|
|||||||
// fs_shopping_cart 新版购物车表
|
// fs_shopping_cart 新版购物车表
|
||||||
type FsShoppingCart struct {
|
type FsShoppingCart struct {
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // id
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // id
|
||||||
|
UserId *int64 `gorm:"default:0;" json:"user_id"` // 用户id
|
||||||
ProductId *int64 `gorm:"default:0;" json:"product_id"` // 产品id
|
ProductId *int64 `gorm:"default:0;" json:"product_id"` // 产品id
|
||||||
TemplateId *int64 `gorm:"default:0;" json:"template_id"` // 模板id
|
TemplateId *int64 `gorm:"default:0;" json:"template_id"` // 模板id
|
||||||
ModelId *int64 `gorm:"default:0;" json:"model_id"` // 模型id
|
ModelId *int64 `gorm:"default:0;" json:"model_id"` // 模型id
|
||||||
PriceId *int64 `gorm:"default:0;" json:"price_id"` // 价格id
|
|
||||||
SizeId *int64 `gorm:"default:0;" json:"size_id"` // 尺寸id
|
SizeId *int64 `gorm:"default:0;" json:"size_id"` // 尺寸id
|
||||||
MaterialId *int64 `gorm:"default:0;" json:"material_id"` // 材质id
|
|
||||||
FittingId *int64 `gorm:"default:0;" json:"fitting_id"` // 配件id
|
FittingId *int64 `gorm:"default:0;" json:"fitting_id"` // 配件id
|
||||||
PurchaseQuantity *int64 `gorm:"default:0;" json:"purchase_quantity"` // 购买数量
|
PurchaseQuantity *int64 `gorm:"default:0;" json:"purchase_quantity"` // 购买数量
|
||||||
UnitPrice *int64 `gorm:"default:0;" json:"unit_price"` // 当时加入购物车的单价,不作为支付计算,支付计算需要实时价格(厘)换算美元除以1000
|
|
||||||
TotalPrice *int64 `gorm:"default:0;" json:"total_price"` // 当时加入购物车单价x数量的总价,不作为支付计算,支付计算需要实时价格
|
|
||||||
Logo *string `gorm:"default:'';" json:"logo"` //
|
|
||||||
CombineImage *string `gorm:"default:'';" json:"combine_image"` //
|
|
||||||
RenderImage *string `gorm:"default:'';" json:"render_image"` //
|
|
||||||
Snapshot *string `gorm:"default:'';" json:"snapshot"` //
|
Snapshot *string `gorm:"default:'';" json:"snapshot"` //
|
||||||
IsHighlyCustomized *int64 `gorm:"default:0;" json:"is_highly_customized"` // 是否高度定制 0非 1是(针对客人高度定制只能后台增加如购物车)
|
IsHighlyCustomized *int64 `gorm:"default:0;" json:"is_highly_customized"` // 是否高度定制 0非 1是(针对客人高度定制只能后台增加如购物车)
|
||||||
Status *int64 `gorm:"default:0;" json:"status"` // 0未下单 1已下单
|
Status *int64 `gorm:"default:0;" json:"status"` // 0未下单 1已下单
|
||||||
IsEffective *int64 `gorm:"default:1;" json:"is_effective"` // 是否有效 0非 1是(针对对购物车下单,此前数据表更失效)
|
IsEffective *int64 `gorm:"default:1;" json:"is_effective"` // 是否有效 0非 1是(针对对购物车下单,此前数据表更失效)
|
||||||
IsDeleted *int64 `gorm:"default:0;" json:"is_deleted"` // 0正常 1删除
|
|
||||||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||||
|
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||||
}
|
}
|
||||||
type FsShoppingCartModel struct {
|
type FsShoppingCartModel struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
|
@ -50,7 +50,7 @@ func (l *GetProductTemplateTagsLogic) GetProductTemplateTags(req *types.GetProdu
|
|||||||
//白板用户
|
//白板用户
|
||||||
if !userinfo.IsUser() && !userinfo.IsGuest() {
|
if !userinfo.IsUser() && !userinfo.IsGuest() {
|
||||||
// 返回固定模板标签列表
|
// 返回固定模板标签列表
|
||||||
productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetListByTagNames(l.ctx, []string{"A1a"}, req.Limit, 1, "`id` DESC")
|
productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetListByTagNames(l.ctx, []string{"A1"}, req.Limit, 1, "`id` DESC")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get template tags")
|
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get template tags")
|
||||||
@ -64,7 +64,7 @@ func (l *GetProductTemplateTagsLogic) GetProductTemplateTags(req *types.GetProdu
|
|||||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get ai recommend product template tag list")
|
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get ai recommend product template tag list")
|
||||||
}
|
}
|
||||||
// 返回固定模板A1a
|
// 返回固定模板A1a
|
||||||
productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetListByTagNames(l.ctx, []string{"A1a"}, req.Limit, 1, "`id` DESC")
|
productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetListByTagNames(l.ctx, []string{"A1"}, req.Limit, 1, "`id` DESC")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get template tags")
|
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get template tags")
|
||||||
@ -73,7 +73,7 @@ func (l *GetProductTemplateTagsLogic) GetProductTemplateTags(req *types.GetProdu
|
|||||||
//元数据是空的
|
//元数据是空的
|
||||||
if userMaterial.Metadata == nil {
|
if userMaterial.Metadata == nil {
|
||||||
// 返回固定模板A1a
|
// 返回固定模板A1a
|
||||||
productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetListByTagNames(l.ctx, []string{"A1a"}, req.Limit, 1, "`id` DESC")
|
productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetListByTagNames(l.ctx, []string{"A1"}, req.Limit, 1, "`id` DESC")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get template tags")
|
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get template tags")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user