- create entity one by one in saveJdOrderList
This commit is contained in:
@@ -145,10 +145,16 @@ func saveJdOrderList(existJdIDMap map[string]int, jdOrderList []interface{}, jdS
|
|||||||
if len(orderDetailList) > 0 || len(storeOrderList) > 0 {
|
if len(orderDetailList) > 0 || len(storeOrderList) > 0 {
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
if len(orderDetailList) > 0 {
|
if len(orderDetailList) > 0 {
|
||||||
err = dao.CreateMultiEntities(db, orderDetailList)
|
// err = dao.CreateMultiEntities(db, orderDetailList)
|
||||||
|
for _, v := range orderDetailList {
|
||||||
|
dao.CreateEntity(db, v)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if len(storeOrderList) > 0 {
|
if len(storeOrderList) > 0 {
|
||||||
err = dao.CreateMultiEntities(db, storeOrderList)
|
// err = dao.CreateMultiEntities(db, storeOrderList)
|
||||||
|
for _, v := range storeOrderList {
|
||||||
|
dao.CreateEntity(db, v)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -11,3 +11,9 @@ type TempGoodsOrderMobile struct {
|
|||||||
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"createdAt"`
|
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"createdAt"`
|
||||||
Mobile string `orm:"size(32);index" json:"mobile"`
|
Mobile string `orm:"size(32);index" json:"mobile"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (o *TempGoodsOrderMobile) TableUnique() [][]string {
|
||||||
|
return [][]string{
|
||||||
|
[]string{"VendorOrderID", "VendorID"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user