作者 唐旭辉

新海鲜干货订单分红详情 完成

... ... @@ -42,7 +42,7 @@ func CreateOrderGoodRepository(options map[string]interface{}) (domain.OrderGood
return repository.NewOrderGoodRepository(transactionContext)
}
//CreateOrderGoodRepository 订单信息
//CreateOrderGoodRepository 订单货品信息
func CreateUsersRepository(options map[string]interface{}) (domain.UsersRepository, error) {
var transactionContext *transaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
... ... @@ -77,3 +77,30 @@ func CreateBusinessBonusRepository(options map[string]interface{}) (domain.Busin
}
return repository.NewBusinessBonusRepository(transactionContext)
}
//CreateOrderGoodBestshopRepository 海鲜干货订单商品信息
func CreateOrderGoodBestshopRepository(options map[string]interface{}) (domain.OrderGoodBestshopRepository, error) {
var transactionContext *transaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*transaction.TransactionContext)
}
return repository.NewOrderGoodBestshopRepository(transactionContext)
}
//CreateOrderGoodBestshopRepository 海鲜干货订单信息
func CreateOrderBestshopRepository(options map[string]interface{}) (domain.OrderBestshopRepository, error) {
var transactionContext *transaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*transaction.TransactionContext)
}
return repository.NewOrderBestshopRepository(transactionContext)
}
//CreateOrderGoodBestshopRepository 海鲜干货订单信息
func CreateOrderLogRepository(options map[string]interface{}) (domain.OrderLogRepository, error) {
var transactionContext *transaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*transaction.TransactionContext)
}
return repository.NewOrderLogRepository(transactionContext)
}
... ...
... ... @@ -789,6 +789,188 @@ func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrde
return orders, cnt, nil
}
//GetOrderBestshopInfo 获取来源于海鲜干货订单的详情以及分红数据
func (service OrderInfoService) GetOrderBestshopInfoWithBonus(orderBaseId int64, companyId int64) (interface{}, error) {
var (
transactionContext, _ = factory.CreateTransactionContext(nil)
err error
)
if err = transactionContext.StartTransaction(); err != nil {
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
defer func() {
transactionContext.RollbackTransaction()
}()
var (
orderBaseRepository domain.OrderBaseRepository
orderGoodRepository domain.OrderGoodRepository
orderBestshopRepository domain.OrderBestshopRepository
orderGoodBestshopRepository domain.OrderGoodBestshopRepository
orderLogRepository domain.OrderLogRepository
partnerRepository domain.PartnerInfoRepository
)
if orderBaseRepository, err = factory.CreateOrderBaseRepository(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
if orderGoodRepository, err = factory.CreateOrderGoodRepository(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
if orderBestshopRepository, err = factory.CreateOrderBestshopRepository(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
if orderGoodBestshopRepository, err = factory.CreateOrderGoodBestshopRepository(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
if orderLogRepository, err = factory.CreateOrderLogRepository(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
if partnerRepository, err = factory.CreatePartnerInfoRepository(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
var (
orderData *domain.OrderBase
orderGoods []domain.OrderGood
orderBestshopData *domain.OrderBestShop
orderGoodBestshop []domain.OrderGoodBestShop
orderLogs []domain.OrderLog
partnerInfo *domain.PartnerInfo
)
orderData, err = orderBaseRepository.FindOne(domain.OrderBaseFindOneQuery{
OrderId: orderBaseId,
CompanyId: companyId,
})
if err != nil {
e := fmt.Sprintf("获取订单(order_base)数据失败,id=%d,company_id=%d,err=%s", orderBaseId, companyId, err)
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
}
if orderData.OrderType != domain.OrderTypeBestShop {
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, "获取的订单数据失败,OrderType err")
}
orderGoods, _, err = orderGoodRepository.Find(domain.OrderGoodFindQuery{OrderId: orderData.Id})
if err != nil {
e := fmt.Sprintf("获取订单的商品(order_good)数据失败,order_id=%d,err=%s", orderData.Id, err)
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
}
orderData.Goods = orderGoods
partnerInfo, err = partnerRepository.FindOne(domain.PartnerFindOneQuery{UserId: orderData.PartnerId})
if err != nil {
e := fmt.Sprintf("获取订单中的合伙人(partner)数据失败,id=%d,order_id=%d,err=%s", orderData.PartnerId, orderData.Id, err)
logs.Error(e)
}
orderData.PartnerInfo = partnerInfo.Partner
orderBestshopData, err = orderBestshopRepository.FindOne(domain.OrderBestshopFindOneQuery{OrderId: orderData.DataFrom.DataId})
if err != nil {
e := fmt.Sprintf("获取海鲜干货订单(order_bestshop)数据失败,id=%d,err=%s", orderData.DataFrom.DataId, err)
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
}
orderGoodBestshop, err = orderGoodBestshopRepository.Find(domain.OrderGoodBestshopFindQuery{OrderId: orderBestshopData.Id})
if err != nil {
e := fmt.Sprintf("获取海鲜干货订单货品(order_good_bestshop)数据失败,order_id=%d,err=%s", orderBestshopData.Id, err)
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
}
orderBestshopData.Goods = orderGoodBestshop
orderLogs, err = orderLogRepository.Find(domain.OrderLogFindQuery{OrderId: orderData.Id})
if err != nil {
e := fmt.Sprintf("获取订单的修改记录(order_log)失败,err=%s", err)
logs.Error(e)
}
err = transactionContext.CommitTransaction()
if err != nil {
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
result := service.buildOrderBestshopInfoData(orderData, orderBestshopData, orderLogs)
return result, nil
}
//BuildOrderBestshopInfoData 构建前端需要的数据结构
func (service OrderInfoService) buildOrderBestshopInfoData(orderBase *domain.OrderBase,
orderBestshop *domain.OrderBestShop, orderLogs []domain.OrderLog) interface{} {
orderGoodBestshopMap := map[int64]*domain.OrderGoodBestShop{}
for i := range orderBestshop.Goods {
goodid := orderBestshop.Goods[i].Id
orderGoodBestshopMap[goodid] = &orderBestshop.Goods[i]
}
//订单描述
order := map[string]interface{}{
"orderId": orderBase.Id,
"orderState": orderBestshop.OrderState,
"customers": orderBestshop.BuyerName,
"address": orderBestshop.BuyerAddress,
"remarks": orderBestshop.BuyerRemark,
"partner": orderBase.PartnerInfo.PartnerName,
"phone": orderBestshop.BuyerPhone,
"orderTime": orderBestshop.OrderTime,
"shippingStatus": orderBestshop.DeliveryState,
}
//订单中的商品
product := map[string]interface{}{
"orderNumCount": orderBase.GetCurrentOrderCount(),
"partnerDividendsCount": orderBase.GetCurrentPartnerBonus(),
"orderAmountAdjustmentCount": orderBase.GetCurrentOrderAmount(),
}
productDetail := []map[string]interface{}{}
for i := range orderBase.Goods {
detail := map[string]interface{}{
"commodityName": orderBase.Goods[i].GoodName,
"productCodes": "",
"commodityCode": "",
"univalence": orderBase.Goods[i].Price,
"orderNum": orderBase.Goods[i].GetCurrentGoodNumber(),
"commodityPrice": orderBase.Goods[i].GetCurrentAmount(),
"partnerDividends": orderBase.Goods[i].GetCurrentPartnerBonus(),
"productId": orderBase.Goods[i].Id,
"paymentStatus": orderBase.Goods[i].BonusStatus,
"partnerRatio": orderBase.Goods[i].PartnerBonusPercent,
}
goodBestshopId := orderBase.Goods[i].DataFrom.DataId
if v, ok := orderGoodBestshopMap[goodBestshopId]; ok {
detail["productCodes"] = v.Sn
detail["commodityCode"] = v.Bn
}
}
product["detail"] = productDetail
modifyLog := []map[string]interface{}{}
for i := range orderLogs {
m := map[string]interface{}{
"title": orderLogs[i].LogAction,
"time": orderLogs[i].AlterTime.Local().Format("2006-01-02 15:04:05"),
"userName": orderLogs[i].Operator,
"id": orderLogs[i].Id,
}
detail := []map[string]string{}
for ii, vv := range orderLogs[i].Descript {
d := map[string]string{
"updateTitle": vv.Title,
"id": fmt.Sprint(ii),
"content": fmt.Sprintf("%s:%s;%s", vv.Item, vv.Action, vv.Result),
}
detail = append(detail, d)
}
m["updateList"] = detail
modifyLog = append(modifyLog, m)
}
result := map[string]interface{}{
"order": order,
"product": product,
"modify": modifyLog,
}
return result
}
//UpdateBounsWithGoodNumber 分红时,因修改订单中商品的数量发生分红变动
func (service OrderInfoService) UpdateBonusByGoodNumber() error {
var (
... ...
... ... @@ -7,9 +7,9 @@ import (
)
const (
OrderReal = iota + 1 //实发订单
OrderIntention //意向订单
OrderHaiXian //来自小程序海鲜干货的订单
OrderReal = iota + 1 //实发订单
OrderIntention //意向订单
OrderTypeBestShop //来自小程序海鲜干货的订单
)
func GetOrderBaseTypeName(orderType int) string {
... ... @@ -17,7 +17,7 @@ func GetOrderBaseTypeName(orderType int) string {
switch orderType {
case OrderReal:
name = "自建订单"
case OrderHaiXian:
case OrderTypeBestShop:
name = "小程序订单"
case OrderIntention:
name = "意向订单"
... ... @@ -42,13 +42,6 @@ type Buyer struct {
Remark string `json:"remark"`
}
//OrderDataFrom 订单数据来源
type OrderDataFrom struct {
Platform string `json:"platform"` //订单数据来源平台
PlatformId string `json:"platformId"` //平台唯一标识
DataId int64 `json:"dataId"` //订单数据id标识
}
type OrderCompute struct {
//合伙人应收分红
PlanPartnerBonus float64 `json:"planPartnerBonus"`
... ... @@ -123,6 +116,30 @@ type OrderBase struct {
Remark OrderBaseRemark `json:"remark"`
}
//GetCurrentPartnerBonus 获取当前合伙人应收分红
func (order *OrderBase) GetCurrentPartnerBonus() float64 {
if order.OrderCompute.UsePartnerBonus >= 0 {
return order.OrderCompute.UsePartnerBonus
}
return order.OrderCompute.PlanPartnerBonus
}
//GetCurrentOrderCount 获取当前订单商品总数
func (order *OrderBase) GetCurrentOrderCount() int {
if order.OrderCompute.UseOrderCount >= 0 {
return order.OrderCompute.UseOrderCount
}
return order.OrderCompute.PlanOrderCount
}
// GetCurrentOrderAmount 获取当前订单的总额
func (order *OrderBase) GetCurrentOrderAmount() float64 {
if order.OrderCompute.UseOrderAmount >= 0 {
return order.OrderCompute.UseOrderAmount
}
return order.OrderCompute.PlanOrderAmount
}
//Update 更新订单数据
//orderData 订单数据
//goodsMap 货品的数据,以货品的id做键,map[id]map[string]interface{}
... ...
package domain
import "time"
//OrderBestShop 来源海鲜干货的订单
type OrderBestShop struct {
Id int64 `json:"id"`
//订单编号
OrderCode string `json:"orderCode"`
//下单时间
OrderTime string `json:"orderTime"`
//订单状态
OrderState int8 `json:"order_state"`
//发货状态
DeliveryState int8 `json:"delivery_state"`
//买家名称
BuyerName string `json:"buyerName"`
//买家电话
BuyerPhone string `json:"buyerPhone"`
//买家地址
BuyerAddress string `json:"buyerAddress"`
//买家备注
BuyerRemark string `json:"buyerRemark"`
//商品总数
OrderCount int `json:"orderCount"`
//d订单总额
OrderAmount float64 `json:"orderAmount"`
//发货时间
DeliveryTime time.Time `json:"deliveryTime"`
//创建时间
CreateTime time.Time `json:"createTime"`
Goods []OrderGoodBestShop `json:"goods"`
}
func (order OrderBestShop) CopyToOrderBase(o *OrderBase) {
o.Buyer = Buyer{
BuyerName: order.BuyerName,
ContactInfo: order.BuyerPhone,
ShippingAddress: order.BuyerAddress,
Remark: order.BuyerRemark,
}
o.DataFrom = OrderDataFrom{
Platform: OrderDataFromBestShop,
DataId: order.Id,
}
o.OrderCode = order.OrderCode
o.OrderCompute.PlanOrderAmount = order.OrderAmount
o.OrderCompute.PlanOrderCount = order.OrderCount
o.DeliveryTime = order.DeliveryTime
return
}
type OrderBestshopFindOneQuery struct {
OrderId int64
}
type OrderBestshopRepository interface {
Add(order *OrderBestShop) error
FindOne(qureyOptions OrderBestshopFindOneQuery) (*OrderBestShop, error)
}
//OrderGoodBestShop 订单明细
type OrderGoodBestShop struct {
Id int64 `json:"id"`
//订单id
OrdeId int64 `json:"orderId"`
//货品编号
Sn string `json:"sn"`
//商品编号
Bn string `json:"bn"`
//货品名称
Name string `json:"name"`
//单价
Price float64 `json:"price"`
//货品数量
Nums int `json:"nums"`
//订单总价
Amount float64 `json:"amount"`
}
func (good OrderGoodBestShop) CopyToOrderGood(g *OrderGood) {
g.DataFrom = OrderDataFrom{
Platform: OrderDataFromBestShop,
DataId: good.Id,
}
g.GoodName = good.Name
g.Price = good.Price
g.PlanGoodNumber = good.Nums
g.GoodCompute.PlanAmount = good.Amount
return
}
type OrderGoodBestshopFindQuery struct {
OrderId int64
}
type OrderGoodBestshopRepository interface {
Add(order *OrderGoodBestShop) error
Find(qureyOptions OrderGoodBestshopFindQuery) ([]OrderGoodBestShop, error)
}
... ...
package domain
const (
OrderDataFromBestShop string = "bestshop"
)
//OrderDataFrom 订单数据来源
type OrderDataFrom struct {
Platform string `json:"platform"` //订单数据来源平台
DataId int64 `json:"dataId"` //订单数据id标识
}
... ...
... ... @@ -78,6 +78,31 @@ type OrderGood struct {
CompanyId int64 `json:"companyId"`
//原因备注
RemarkReason OrderGoodRemarkReason `json:"remarkReason"`
DataFrom OrderDataFrom `json:"data_from"`
}
//GetCurrentGoodNumber 获取当前的商品数量
func (good OrderGood) GetCurrentGoodNumber() int {
if good.UseGoodNumber >= 0 {
return good.UseGoodNumber
}
return good.PlanGoodNumber
}
//GetCurrentAmount 获取当前的商品总额
func (good OrderGood) GetCurrentAmount() float64 {
if good.GoodCompute.UseAmount >= 0 {
return good.GoodCompute.UseAmount
}
return good.GoodCompute.PlanAmount
}
//GetCurrentAmount 获取当前的商品合伙人分红
func (good OrderGood) GetCurrentPartnerBonus() float64 {
if good.GoodCompute.UsePartnerBonus >= 0 {
return good.GoodCompute.UsePartnerBonus
}
return good.GoodCompute.PlanPartnerBonus
}
//Update 更新商品相关的数据
... ...
... ... @@ -34,6 +34,7 @@ type OrderLogContent struct {
//OrderLog 订单修改记录
type OrderLog struct {
Id int64
OrderId int64 `json:"order_id"` //订单id
AlterTime time.Time `json:"alter_time"` //时间
Operator string `json:"operator"` //操作人员
... ...
package models
import "time"
type OrderBestshop struct {
tableName struct{} `pg:"order_bestshop"`
Id int64
//订单编号
OrderCode string
//下单时间
OrderTime string
//订单状态
OrderState int8
//发货状态
DeliveryState int8
//买家名称
BuyerName string
//买家电话
BuyerPhone string
//买家地址
BuyerAddress string
//买家备注
BuyerRemark string
//订单总数
OrderCount int
//d订单总额
OrderAmount float64
//发货时间
DeliveryTime time.Time
//创建时间
CreateTime time.Time
}
... ...
package models
type OrderGoodBestshop struct {
tableName struct{} `pg:"order_good_bestshop"`
Id int64
//订单id
OrdeId int64
//货品编号
Sn string
//商品编号
Bn string
//货品名称
Name string
//单价
Price float64
//货品数量
Nums int
//订单总价
Amount float64
}
... ...
... ... @@ -10,7 +10,8 @@ import (
//OrderLog 订单修改记录
type OrderLog struct {
tableName struct{} `pg:"order_log"`
tableName struct{} `pg:"order_log"`
Id int64
OrderId int64 `` //订单id
AlterTime time.Time `` //时间
Operator string `` //操作人员
... ...
package repository
import (
"fmt"
"time"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction"
)
type OrderBestshopRepository struct {
transactionContext *transaction.TransactionContext
}
var (
_ domain.OrderBestshopRepository = (*OrderBestshopRepository)(nil)
)
func NewOrderBestshopRepository(transactionContext *transaction.TransactionContext) (*OrderBestshopRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
}
return &OrderBestshopRepository{transactionContext: transactionContext}, nil
}
func (respository OrderBestshopRepository) transformPgModelToDomainModel(orderModel *models.OrderBestshop) (order domain.OrderBestShop, err error) {
return domain.OrderBestShop{
Id: orderModel.Id,
OrderCode: orderModel.OrderCode,
OrderTime: orderModel.OrderTime,
OrderState: orderModel.OrderState,
DeliveryState: orderModel.DeliveryState,
BuyerName: orderModel.BuyerName,
BuyerPhone: orderModel.BuyerPhone,
BuyerAddress: orderModel.BuyerAddress,
BuyerRemark: orderModel.BuyerRemark,
OrderCount: orderModel.OrderCount,
OrderAmount: orderModel.OrderAmount,
DeliveryTime: orderModel.DeliveryTime,
CreateTime: orderModel.CreateTime,
}, nil
}
func (respository OrderBestshopRepository) Add(order *domain.OrderBestShop) error {
tx := respository.transactionContext.GetDB()
m := models.OrderBestshop{
OrderCode: order.OrderCode,
OrderTime: order.OrderTime,
OrderState: order.OrderState,
DeliveryState: order.DeliveryState,
BuyerName: order.BuyerName,
BuyerPhone: order.BuyerPhone,
BuyerAddress: order.BuyerAddress,
BuyerRemark: order.BuyerRemark,
OrderCount: order.OrderCount,
OrderAmount: order.OrderAmount,
DeliveryTime: order.DeliveryTime,
CreateTime: time.Now(),
}
_, err := tx.Model(&m).Insert()
order.Id = m.Id
return err
}
func (respository OrderBestshopRepository) FindOne(queryOption domain.OrderBestshopFindOneQuery) (*domain.OrderBestShop, error) {
tx := respository.transactionContext.GetDB()
m := models.OrderBestshop{}
err := tx.Model(&m).
Where("id=?", queryOption.OrderId).
First()
if err != nil {
return nil, err
}
var order domain.OrderBestShop
order, err = respository.transformPgModelToDomainModel(&m)
if err != nil {
return nil, fmt.Errorf("OrderBestshop domain 数据结构转换失败:%s", err)
}
return &order, nil
}
... ...
package repository
import (
"fmt"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction"
)
type OrderGoodBestshopRepository struct {
transactionContext *transaction.TransactionContext
}
var (
_ domain.OrderGoodBestshopRepository = (*OrderGoodBestshopRepository)(nil)
)
func NewOrderGoodBestshopRepository(transactionContext *transaction.TransactionContext) (*OrderGoodBestshopRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
}
return &OrderGoodBestshopRepository{transactionContext: transactionContext}, nil
}
func (respository OrderGoodBestshopRepository) transformPgModelToDomainModel(orderGoodModel *models.OrderGoodBestshop) (orderGood domain.OrderGoodBestShop, err error) {
return domain.OrderGoodBestShop{
Id: orderGoodModel.Id,
OrdeId: orderGoodModel.OrdeId,
Sn: orderGoodModel.Sn,
Bn: orderGoodModel.Bn,
Name: orderGoodModel.Name,
Price: orderGoodModel.Price,
Nums: orderGoodModel.Nums,
Amount: orderGoodModel.Amount,
}, nil
}
func (respository OrderGoodBestshopRepository) Add(good *domain.OrderGoodBestShop) error {
tx := respository.transactionContext.GetDB()
m := models.OrderGoodBestshop{
Id: good.Id,
OrdeId: good.OrdeId,
Sn: good.Sn,
Bn: good.Bn,
Name: good.Name,
Price: good.Price,
Nums: good.Nums,
Amount: good.Amount,
}
_, err := tx.Model(&m).Insert()
good.Id = m.Id
return err
}
func (respository OrderGoodBestshopRepository) Find(queryOption domain.OrderGoodBestshopFindQuery) ([]domain.OrderGoodBestShop, error) {
tx := respository.transactionContext.GetDB()
goodModels := []models.OrderGoodBestshop{}
query := tx.Model(&goodModels)
if queryOption.OrderId > 0 {
query = query.Where("order_id=?", queryOption.OrderId)
}
query = query.Limit(1000)
err := query.Select()
if err != nil {
return nil, err
}
goods := []domain.OrderGoodBestShop{}
for i := range goodModels {
g, _ := respository.transformPgModelToDomainModel(&goodModels[i])
goods = append(goods, g)
}
return goods, nil
}
... ...
... ... @@ -15,7 +15,7 @@ type OrderLogRepository struct {
var _ domain.OrderLogRepository = (*OrderLogRepository)(nil)
func NewOrderInfoRepository(transactionContext *transaction.TransactionContext) (*OrderLogRepository, error) {
func NewOrderLogRepository(transactionContext *transaction.TransactionContext) (*OrderLogRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
}
... ... @@ -24,6 +24,7 @@ func NewOrderInfoRepository(transactionContext *transaction.TransactionContext)
func (repository OrderLogRepository) transformPgModelToDomainModel(m *models.OrderLog) (data domain.OrderLog, err error) {
return domain.OrderLog{
Id: m.Id,
OrderId: m.OrderId,
Operator: m.Operator,
OperatorId: m.OperatorId,
... ...
... ... @@ -74,8 +74,8 @@ func (c *CommonController) GetOrderType() {
"name": domain.GetOrderBaseTypeName(domain.OrderReal),
},
map[string]interface{}{
"id": domain.OrderHaiXian,
"name": domain.GetOrderBaseTypeName(domain.OrderHaiXian),
"id": domain.OrderTypeBestShop,
"name": domain.GetOrderBaseTypeName(domain.OrderTypeBestShop),
},
}
c.ResponseData(resp)
... ...
... ... @@ -47,7 +47,7 @@ func (c *OrderDividendController) PageListOrderDividend() {
}
if !(param.OrderType == 0 ||
param.OrderType == domain.OrderReal ||
param.OrderType == domain.OrderHaiXian) {
param.OrderType == domain.OrderTypeBestShop) {
c.ResponseError(errors.New("参数异常"))
return
}
... ...