feat: 统一蝦皮与顺运宝 PDD 关联入口 (#68)
This commit is contained in:
@@ -192,18 +192,19 @@ type ShopeeSpecView struct {
|
||||
}
|
||||
|
||||
// ShopeeProductDetail 是双击弹窗要显示的全部内容。
|
||||
//
|
||||
// `[必须]` 这个弹窗只读,不含可提交的表单——本工单不实现保存,
|
||||
// ShopeeSave 仍是 501,见 #41。
|
||||
type ShopeeProductDetail struct {
|
||||
GoodsID string
|
||||
Title string
|
||||
ShopeeStatus string
|
||||
MainSKUCode string
|
||||
|
||||
PddURL string
|
||||
PddMissing bool
|
||||
StatusText string
|
||||
PddURL string
|
||||
PddGoodsID string
|
||||
PddMissing bool
|
||||
StatusText string
|
||||
CollectStatus string
|
||||
CollectMsg string
|
||||
CanCollect bool
|
||||
|
||||
SKUs []ShopeeSpecView
|
||||
PendingCount int
|
||||
@@ -222,6 +223,7 @@ func GetShopeeProductDetail(db *sql.DB, goodsID string) (*ShopeeProductDetail, e
|
||||
Title: p.Title,
|
||||
ShopeeStatus: p.ShopeeStatus,
|
||||
MainSKUCode: p.MainSKUCode,
|
||||
PddGoodsID: p.PddGoodsID,
|
||||
}
|
||||
if d.Title == "" {
|
||||
d.Title = placeholder
|
||||
@@ -239,12 +241,16 @@ func GetShopeeProductDetail(db *sql.DB, goodsID string) (*ShopeeProductDetail, e
|
||||
d.StatusText = "未填链接"
|
||||
} else {
|
||||
d.PddURL = p.PddGoodsURL
|
||||
status, _, err := repository.GetShopeeCollectStatus(db, p.PddGoodsID)
|
||||
status, msg, err := repository.GetShopeeCollectStatus(db, p.PddGoodsID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if status.Valid {
|
||||
d.CollectStatus = status.String
|
||||
d.CollectMsg = msg.String
|
||||
d.StatusText = collectStatusText(model.CollectStatus(status.String))
|
||||
d.CanCollect = status.String == string(model.CollectPending) ||
|
||||
status.String == string(model.CollectFailed)
|
||||
} else {
|
||||
d.StatusText = "PDD 商品缺失"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user