refactor: reorganize modules and add Linux build tooling
This commit is contained in:
33
module/ec/order/internal/logic/common/get.go
Normal file
33
module/ec/order/internal/logic/common/get.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"bsm/full/module/ec/order/internal/models"
|
||||
pb "bsm/full/module/ec/order/pb"
|
||||
)
|
||||
|
||||
// GetOrderSummaryByIdentity 根据订单号获取订单详情
|
||||
func GetOrderSummaryByIdentity(identity string) (*pb.OrderSummaryItem, error) {
|
||||
var (
|
||||
err error
|
||||
summary = new(models.OrderSummary)
|
||||
)
|
||||
err = models.DBService.Preload("OrderDetails").Where("identity = ?", identity).First(&summary).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return ReflectProtoOrderSummary(summary), nil
|
||||
}
|
||||
|
||||
func GetOrderSummaryByNo(no string) (*pb.OrderSummaryItem, error) {
|
||||
var (
|
||||
err error
|
||||
summary = new(models.OrderSummary)
|
||||
)
|
||||
err = models.DBService.Preload("OrderDetails").Where("order_no = ?", no).First(&summary).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return ReflectProtoOrderSummary(summary), nil
|
||||
}
|
||||
Reference in New Issue
Block a user