Explorar o código

add promotion

abiao %!s(int64=5) %!d(string=hai) anos
pai
achega
34bee22c08

+ 11 - 0
go/gopath/src/fohow.com/apps/models/order_model/order_detail.go

@@ -139,3 +139,14 @@ func GetStaticOrderDetails(bDate, eDate time.Time, state string, isSend bool) (d
 	}
 	return details
 }
+
+//根据订单Id,获取所有订单项
+func GetDetailsByOrderIdAndPid(oId string, pId int64) (orderDetail *OrderDetail) {
+	orderDetail = &OrderDetail{}
+	if err := orm.NewOrm().QueryTable(orderDetail).Filter("order_id", oId).Filter("product_id", pId).Limit(1).
+		One(orderDetail); err != nil {
+		beego.BeeLogger.Error("get order detail item by id=%s err=%s", oId, err)
+		orderDetail = nil
+	}
+	return orderDetail
+}