Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
KenWilliamson committed Apr 14, 2022
1 parent 2288e0b commit 0bb75df
Show file tree
Hide file tree
Showing 9 changed files with 1,068 additions and 1,072 deletions.
1,884 changes: 946 additions & 938 deletions coverage.out

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module github.com/Ulbora/six910-mysql

go 1.16
go 1.18

require (
github.com/Ulbora/Level_Logger v1.0.2
github.com/Ulbora/dbinterface v1.0.5
github.com/Ulbora/dbinterface_mysql v1.0.7
github.com/Ulbora/six910-database-interface v1.1.3
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/Ulbora/six910-database-interface v1.1.5
)

require github.com/go-sql-driver/mysql v1.6.0 // indirect
78 changes: 4 additions & 74 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,80 +4,11 @@ github.com/Ulbora/dbinterface v1.0.5 h1:hzAsS92kIKIApFb6av1vGGz4+lRNOyfzhh5HXxoU
github.com/Ulbora/dbinterface v1.0.5/go.mod h1:msBriehF2JgLgSpNWq2Yc3MKy3/Rn9aChefibmW1xWM=
github.com/Ulbora/dbinterface_mysql v1.0.7 h1:rFOaRaKaARFLEd8hYxvFIbbN49FFI2j/m7iy10sGOas=
github.com/Ulbora/dbinterface_mysql v1.0.7/go.mod h1:8XA1eoibXMbJNIfL5mvl7b77FZPSRewInYCNFRC65AQ=
github.com/Ulbora/six910-database-interface v1.0.6 h1:OAiy4V3rLopgUCCqh7XjW9bjLcKo16gkMepx7VOTS6E=
github.com/Ulbora/six910-database-interface v1.0.6/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.7 h1:QzJygI2IVhI4Bl98BvqJrNxv3G6eJ3PzkNv7+DiYyTU=
github.com/Ulbora/six910-database-interface v1.0.7/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.8 h1:QNVCqVO6S+WNoqLitKyQIijfqDQdFfpY3zqGWWHV6tk=
github.com/Ulbora/six910-database-interface v1.0.8/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.9 h1:kXUvatZs8/7kg1zNMXwN7FtInKZhE5chuyB0OYzZz8M=
github.com/Ulbora/six910-database-interface v1.0.9/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.10 h1:U9jFLnNSC8DPf6wTbKSf3ZNCAJ/NW6arjKJ98iNapT4=
github.com/Ulbora/six910-database-interface v1.0.10/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.11 h1:6AS+sIARgRp03G0esqBnVxKqpUxZnolluMbN6dYw4JQ=
github.com/Ulbora/six910-database-interface v1.0.11/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.12 h1:CzMXQJT2rVgJj0+vi27iF2O+SzTkW9wle/ic6YODO0U=
github.com/Ulbora/six910-database-interface v1.0.12/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.14 h1:d9r9g3lL2PHneYXVoLfPUF02570x0yTfbFDL82CmM+U=
github.com/Ulbora/six910-database-interface v1.0.14/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.15 h1:u6ta1KHz02lVSF9oGGU76/BlwP0x4P7yOS4b2NAOl7o=
github.com/Ulbora/six910-database-interface v1.0.15/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.16 h1:ufq46Ws2CDKrhggSO+kBxjf+eSmw8qPBN5l895SsHxc=
github.com/Ulbora/six910-database-interface v1.0.16/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.18 h1:1/FUHbY14RJ8lJtSeDXTAu6oke62zEwClq5+UoWuo54=
github.com/Ulbora/six910-database-interface v1.0.18/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.19 h1:gfVmg0TAn065ytdFcVYrY1Zvct4L/xiQClVnTSmGpFw=
github.com/Ulbora/six910-database-interface v1.0.19/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.20 h1:c4niG5rNG4uXB2dOUsOUYPyLoQfY8dIHpnLhlV4f/nc=
github.com/Ulbora/six910-database-interface v1.0.20/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.21 h1:H8OPfohHVbk/D0mCB+/ExdsK55h4VTlJTDqzo9Mo7Ic=
github.com/Ulbora/six910-database-interface v1.0.21/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.22 h1:69dlWaB9CZt6zuMhCMOpQuphaEMlngq52dYsg16zJ/8=
github.com/Ulbora/six910-database-interface v1.0.22/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.23 h1:t4F0oO6ARPRoZXOb442c0Huy2xnLUAgtuCXhLvXLF0o=
github.com/Ulbora/six910-database-interface v1.0.23/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.24 h1:0P2SOSmCE3Co0X4uC6ttj4OX99Fu0NBL/FOxvOZ+6wE=
github.com/Ulbora/six910-database-interface v1.0.24/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.25 h1:WnBpy3qiok96VKEE+5rNl1j4M8/+vMs4aUCBOm9bviA=
github.com/Ulbora/six910-database-interface v1.0.25/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.26 h1:ekq9Apl4uMXTEG6kgDs4SXnvdhDO8qRW+tKrQHLYFxk=
github.com/Ulbora/six910-database-interface v1.0.26/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.27 h1:OowpQR7w1JY74zvR8P6UQt2HuQ5tM0c30l1lCDAgxVY=
github.com/Ulbora/six910-database-interface v1.0.27/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.28 h1:Fh/TLhIiTUuqUGRPJ5zaaN51dtIQOvKdfeSBit7aR+E=
github.com/Ulbora/six910-database-interface v1.0.28/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.29 h1:jF3SikjFMm7aahxOX2PEFTPg2ogG5g4pEI2+uVu6Zgs=
github.com/Ulbora/six910-database-interface v1.0.29/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.30 h1:KMGRNVhAFbTpDGr2KQBnIq2uLYfnqITcV6Dxe653Muo=
github.com/Ulbora/six910-database-interface v1.0.30/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.31 h1:1JqzuEKOxn0HLmyusO60ZH05YCC+pjpOV+GheNJYtZ8=
github.com/Ulbora/six910-database-interface v1.0.31/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.32 h1:+jRvIG9JlNjgNav//ItGy0uBDUkfm3426LkyEfxlkbY=
github.com/Ulbora/six910-database-interface v1.0.32/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.33 h1:YUuSe7KoRN7ngAGNeuCtgXUTfiJVKE3Rvx2t0ny4L8w=
github.com/Ulbora/six910-database-interface v1.0.33/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.34 h1:BK0I1xKqLyAliqTjnk/mbni6xni9fXzcFyKyThGeqRY=
github.com/Ulbora/six910-database-interface v1.0.34/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.35 h1:VnThn51n2hHpCwnUD2r3GBXPGNBKeURf15HHjFXkOdA=
github.com/Ulbora/six910-database-interface v1.0.35/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.36 h1:SgidSG+F282G3ufQ4qDhtg5RzfVakCPneiCmkR1AlEo=
github.com/Ulbora/six910-database-interface v1.0.36/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.37 h1:QmLF7xsqU8DVos97zA8tE8UHoVbtPfmt645jKXTrEx8=
github.com/Ulbora/six910-database-interface v1.0.37/go.mod h1:OGqZQ5ETgqxsHB636qmivSR36NzQxhV4T+ATsIUJSLM=
github.com/Ulbora/six910-database-interface v1.0.38 h1:4G+XIgQ0OUCjYt08XBb71lun84muPa2p5xZVwPJd894=
github.com/Ulbora/six910-database-interface v1.0.38/go.mod h1:xKoESfGA7CV8kFeZwMtwnBAezrBFzTdtrSRaeUn0QBQ=
github.com/Ulbora/six910-database-interface v1.1.0 h1:JjJKWsEfDu/Heq6wYnKYg0LZTqUUaNvzsZvYdHkm2bI=
github.com/Ulbora/six910-database-interface v1.1.0/go.mod h1:xKoESfGA7CV8kFeZwMtwnBAezrBFzTdtrSRaeUn0QBQ=
github.com/Ulbora/six910-database-interface v1.1.1 h1:LSCAw1d+SJnahx/aAltl+VDxUlmR15yaH5++GDxtsMk=
github.com/Ulbora/six910-database-interface v1.1.1/go.mod h1:xKoESfGA7CV8kFeZwMtwnBAezrBFzTdtrSRaeUn0QBQ=
github.com/Ulbora/six910-database-interface v1.1.2 h1:aQx2e/0iJnz196f+B4VGd/VnZUQ0Tyb132g+gTKN/ZI=
github.com/Ulbora/six910-database-interface v1.1.2/go.mod h1:xKoESfGA7CV8kFeZwMtwnBAezrBFzTdtrSRaeUn0QBQ=
github.com/Ulbora/six910-database-interface v1.1.3 h1:oLkXYxKp5Lznv/6khdAuaRkWCl9qwamZCLBI5IG/ems=
github.com/Ulbora/six910-database-interface v1.1.3/go.mod h1:xKoESfGA7CV8kFeZwMtwnBAezrBFzTdtrSRaeUn0QBQ=
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
github.com/Ulbora/six910-database-interface v1.1.4 h1:5YH6fMLCUccs/mXXOlt2ZPxKtO39EDWo0iyPLyE41w0=
github.com/Ulbora/six910-database-interface v1.1.4/go.mod h1:HHC7AiKhsROflRoKg7gXL+de0ECcpaqgkhhJOtM0pQU=
github.com/Ulbora/six910-database-interface v1.1.5 h1:MtjcsgdFtxvjlRo7ocvGDDFMFPY6e4EvBQ6Dm+TMZSY=
github.com/Ulbora/six910-database-interface v1.1.5/go.mod h1:HHC7AiKhsROflRoKg7gXL+de0ECcpaqgkhhJOtM0pQU=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand All @@ -89,5 +20,4 @@ golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
1 change: 1 addition & 0 deletions mockDb.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ type MockSix910Mysql struct {
MockUpdateProductQuantitySuccess bool
MockProduct *mdb.Product
MockProductList *[]mdb.Product
MockProductSubSkuList *[]mdb.Product
MockProductIDList *[]int64
MockDeleteProductSuccess bool

Expand Down
5 changes: 5 additions & 0 deletions mockDbMeths.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,11 @@ func (d *MockSix910Mysql) GetProductIDListByCategories(storeID int64, catList *[
return d.MockProductIDList
}

//GetProductSubSkuList GetProductSubSkuList
func (d *MockSix910Mysql) GetProductSubSkuList(parentProdID int64) *[]mdb.Product {
return d.MockProductSubSkuList
}

//DeleteProduct DeleteProduct
func (d *MockSix910Mysql) DeleteProduct(id int64) bool {
return d.MockDeleteProductSuccess
Expand Down
6 changes: 6 additions & 0 deletions mockDb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,12 @@ func TestMockSix910Mysql_Mocks(t *testing.T) {
t.Fail()
}

sdb.MockProductSubSkuList = &prodlst
fprodsslst := si.GetProductSubSkuList(3)
if len(*fprodsslst) != 1 {
t.Fail()
}

var prodIDlst []int64
prodIDlst = append(prodIDlst, 1)
sdb.MockProductIDList = &prodIDlst
Expand Down
113 changes: 68 additions & 45 deletions product.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (d *Six910Mysql) AddProduct(p *mdb.Product) (bool, int64) {
p.ShippingMarkup, p.Visible, p.Searchable, p.MultiBox, p.ShipSeparately, p.FreeShipping,
time.Now(), p.DistributorID, p.Promoted, p.Dropship, p.Size, p.Color, p.ParentProductID,
p.StoreID, p.Thumbnail, p.Image1, p.Image2, p.Image3, p.Image4, p.SpecialProcessing,
p.SpecialProcessingType)
p.SpecialProcessingType, p.HasSubSkus)
suc, id := d.DB.Insert(insertProduct, a...)
d.Log.Debug("suc in add Product", suc)
d.Log.Debug("id in add Product", id)
Expand All @@ -59,7 +59,7 @@ func (d *Six910Mysql) UpdateProduct(p *mdb.Product) bool {
p.ShippingMarkup, p.Visible, p.Searchable, p.MultiBox, p.ShipSeparately, p.FreeShipping,
time.Now(), p.DistributorID, p.Promoted, p.Dropship, p.Size, p.Color, p.ParentProductID,
p.Thumbnail, p.Image1, p.Image2, p.Image3, p.Image4, p.SpecialProcessing,
p.SpecialProcessingType, p.ID)
p.SpecialProcessingType, p.HasSubSkus, p.ID)
suc := d.DB.Update(updateProduct, a...)
return suc
}
Expand Down Expand Up @@ -179,6 +179,26 @@ func (d *Six910Mysql) GetProductList(storeID int64, start int64, end int64) *[]m
return &rtn
}

//GetProductSubSkuList GetProductSubSkuList
func (d *Six910Mysql) GetProductSubSkuList(parentProdID int64) *[]mdb.Product {
if !d.testConnection() {
d.DB.Connect()
}
var rtn = []mdb.Product{}
var a []interface{}
a = append(a, parentProdID)
rows := d.DB.GetList(getProductByParentSku, a...)
if rows != nil && len(rows.Rows) != 0 {
foundRows := rows.Rows
for r := range foundRows {
foundRow := foundRows[r]
rowContent := d.parseProductRow(&foundRow)
rtn = append(rtn, *rowContent)
}
}
return &rtn
}

//GetProductIDList GetProductIDList
func (d *Six910Mysql) GetProductIDList(storeID int64) *[]int64 {
if !d.testConnection() {
Expand Down Expand Up @@ -321,49 +341,52 @@ func (d *Six910Mysql) parseProductRow(foundRow *[]string) *mdb.Product {
ppid, err := strconv.ParseInt((*foundRow)[32], 10, 64)
d.Log.Debug("ppid err in get Product", err)
if err == nil {
rtn.ID = id
rtn.Cost = cost
rtn.DateEntered = eTime
rtn.DateUpdated = uTime
rtn.Depth = depth
rtn.DistributorID = did
rtn.Dropship = dship
rtn.FreeShipping = sFree
rtn.Height = height
rtn.Map = mapPrice
rtn.Msrp = msrp
rtn.MultiBox = mbox
rtn.ParentProductID = ppid
rtn.Price = price
rtn.Promoted = promoted
rtn.SalePrice = salePrice
rtn.Searchable = searchable
rtn.ShipSeparately = sSep
rtn.ShippingMarkup = sMarkup
rtn.SpecialProcessing = sproc
rtn.Stock = stock
rtn.StockAlert = stockAlert
rtn.StoreID = sid
rtn.Visible = visible
rtn.Weight = weight
rtn.Width = width
rtn.Sku = (*foundRow)[1]
rtn.Gtin = (*foundRow)[2]
rtn.Name = (*foundRow)[3]
rtn.ShortDesc = (*foundRow)[4]
rtn.Desc = (*foundRow)[5]
rtn.Currency = (*foundRow)[11]
rtn.Manufacturer = (*foundRow)[12]
rtn.Size = (*foundRow)[30]
rtn.Color = (*foundRow)[31]
rtn.Thumbnail = (*foundRow)[34]
rtn.Image1 = (*foundRow)[35]
rtn.Image2 = (*foundRow)[36]
rtn.Image3 = (*foundRow)[37]
rtn.Image4 = (*foundRow)[38]
rtn.SpecialProcessingType = (*foundRow)[40]
rtn.ManufacturerID = (*foundRow)[41]

hspproc, err := strconv.ParseBool((*foundRow)[42])
if err == nil {
rtn.ID = id
rtn.Cost = cost
rtn.DateEntered = eTime
rtn.DateUpdated = uTime
rtn.Depth = depth
rtn.DistributorID = did
rtn.Dropship = dship
rtn.FreeShipping = sFree
rtn.Height = height
rtn.Map = mapPrice
rtn.Msrp = msrp
rtn.MultiBox = mbox
rtn.ParentProductID = ppid
rtn.Price = price
rtn.Promoted = promoted
rtn.SalePrice = salePrice
rtn.Searchable = searchable
rtn.ShipSeparately = sSep
rtn.ShippingMarkup = sMarkup
rtn.SpecialProcessing = sproc
rtn.Stock = stock
rtn.StockAlert = stockAlert
rtn.StoreID = sid
rtn.Visible = visible
rtn.Weight = weight
rtn.Width = width
rtn.HasSubSkus = hspproc
rtn.Sku = (*foundRow)[1]
rtn.Gtin = (*foundRow)[2]
rtn.Name = (*foundRow)[3]
rtn.ShortDesc = (*foundRow)[4]
rtn.Desc = (*foundRow)[5]
rtn.Currency = (*foundRow)[11]
rtn.Manufacturer = (*foundRow)[12]
rtn.Size = (*foundRow)[30]
rtn.Color = (*foundRow)[31]
rtn.Thumbnail = (*foundRow)[34]
rtn.Image1 = (*foundRow)[35]
rtn.Image2 = (*foundRow)[36]
rtn.Image3 = (*foundRow)[37]
rtn.Image4 = (*foundRow)[38]
rtn.SpecialProcessingType = (*foundRow)[40]
rtn.ManufacturerID = (*foundRow)[41]
}
}
}
}
Expand Down
10 changes: 9 additions & 1 deletion product_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func TestSix910Mysql_AddProduct(t *testing.T) {
prod.Width = 22.42
prod.ParentProductID = 0
prod.Image4 = "/test/test"
prod.HasSubSkus = true

dbi.Close()
usuc := si.UpdateProduct(&prod)
Expand All @@ -189,7 +190,7 @@ func TestSix910Mysql_AddProduct(t *testing.T) {
dbi.Close()
fprod := si.GetProductByID(pid)
fmt.Println("fprod", fprod)
if fprod.ID != pid || fprod.Stock != 400 {
if fprod.ID != pid || fprod.Stock != 400 || !fprod.HasSubSkus {
t.Fail()
}
if fprod.DistributorID != did {
Expand Down Expand Up @@ -284,6 +285,13 @@ func TestSix910Mysql_AddProduct(t *testing.T) {
t.Fail()
}

dbi.Close()
prodssStr := si.GetProductSubSkuList(pid)
fmt.Println("prodssStr", prodssStr)
if len(*prodssStr) != 1 {
t.Fail()
}

dbi.Close()
prodIDLst := si.GetProductIDList(sid)
fmt.Println("prodIDLst", prodIDLst)
Expand Down
Loading

0 comments on commit 0bb75df

Please sign in to comment.