- GetOrderEvents

- idcard and licence for store
This commit is contained in:
gazebo
2018-11-12 12:00:09 +08:00
parent 86b50e5c66
commit 920e6ba35a
9 changed files with 81 additions and 38 deletions

View File

@@ -489,3 +489,28 @@ func (c *OrderManager) GetWaybills(ctx *jxcontext.Context, fromDateStr, toDateSt
dao.Commit(db)
return pagedInfo, err
}
func (c *OrderManager) GetOrderEvents(ctx *jxcontext.Context, vendorOrderID string, vendorID int, orderType int) (statusList []*model.OrderStatus, err error) {
sql := `
SELECT *
FROM order_status t1
WHERE 1 = 1
`
sqlParams := []interface{}{
vendorOrderID,
vendorID,
}
if orderType == -1 {
sql += " AND t1.ref_vendor_order_id = ? AND t1.ref_vendor_id = ?"
} else {
sql += " AND t1.vendor_order_id = ? AND t1.vendor_id = ? AND t1.order_type = ?"
sqlParams = append(sqlParams, orderType)
}
sql += " ORDER BY t1.status_time"
db := dao.GetDB()
if err = dao.GetRows(db, &statusList, sql, sqlParams...); err != nil {
return nil, err
}
return statusList, nil
}