From 58b4ea58564bf5654d088a85adcb3035831756ff Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Fri, 4 Jun 2021 14:59:37 +0800 Subject: [PATCH] aa --- business/model/api.go | 1 + business/model/dao/dao_order.go | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/business/model/api.go b/business/model/api.go index d892f992c..811540cec 100644 --- a/business/model/api.go +++ b/business/model/api.go @@ -49,6 +49,7 @@ type GoodsOrderExt struct { ShopSumPrice int64 `json:"shopSumPrice"` AvgPrice int64 `json:"avgPrice"` BadCommentCount int `json:"badCommentCount"` + JxIncome int `json:"jxIncome"` //预计收益 FloatLng float64 `json:"floatLng"` FloatLat float64 `json:"floatLat"` diff --git a/business/model/dao/dao_order.go b/business/model/dao/dao_order.go index d78de685d..dd92afd88 100644 --- a/business/model/dao/dao_order.go +++ b/business/model/dao/dao_order.go @@ -777,8 +777,9 @@ func GetOrders(db *DaoDB, ids []int64, isIncludeSku, isIncludeFake bool, fromDat t2.status waybill_status, t2.courier_name, t2.courier_mobile, t2.actual_fee, t2.desired_fee, t2.waybill_created_at, t2.waybill_finished_at, t5.pay_percentage, t5.old_pay_percentage, t5.market_man_phone, tu.name market_man_name, - t6.vendor_pay_percentage, - city.name city_name, district.name district_name`, model.DefaultEarningPricePercentage) + t6.vendor_pay_percentage, + city.name city_name, district.name district_name, + IF(t1.earning_type = 1, t1.total_shop_money-t1.earning_price-t2.desired_fee, t1.total_shop_money *(100- t1.order_pay_percentage/2)) jx_income`, model.DefaultEarningPricePercentage) if isIncludeSku { sql += `, IF(t3.jx_sku_id > 0, t3.jx_sku_id, t3.sku_id) sku_id, @@ -929,6 +930,18 @@ func GetOrders(db *DaoDB, ids []int64, isIncludeSku, isIncludeFake bool, fromDat // sqlParams = append(sqlParams, params["deliveryType"].(string)) // } // } + if params["jxIncomeBegin"] != nil { + if utils.MustInterface2Int64(params["jxIncomeBegin"]) != 0 { + sqlWhere += " AND jx_income >= ?" + sqlParams = append(sqlParams, utils.MustInterface2Int64(params["jxIncomeBegin"])) + } + } + if params["jxIncomeEnd"] != nil { + if utils.MustInterface2Int64(params["jxIncomeEnd"]) != 0 { + sqlWhere += " AND jx_income <= ?" + sqlParams = append(sqlParams, utils.MustInterface2Int64(params["jxIncomeEnd"])) + } + } if params["cities"] != nil { var cities []int if err = utils.UnmarshalUseNumber([]byte(params["cities"].(string)), &cities); err != nil {