订单列表返回城市与区名
This commit is contained in:
@@ -247,7 +247,8 @@ func (c *OrderManager) getOrders(ctx *jxcontext.Context, isIncludeSku, isInclude
|
|||||||
SELECT SQL_CALC_FOUND_ROWS t1.*,
|
SELECT SQL_CALC_FOUND_ROWS t1.*,
|
||||||
CAST(IF(t1.earning_price <> 0, t1.earning_price, IF(t1.shop_price <> 0 && t1.shop_price < t1.sale_price, t1.shop_price, t1.sale_price) * IF(t5.pay_percentage > 0, t5.pay_percentage, %d) / 100) AS SIGNED) earning_price,
|
CAST(IF(t1.earning_price <> 0, t1.earning_price, IF(t1.shop_price <> 0 && t1.shop_price < t1.sale_price, t1.shop_price, t1.sale_price) * IF(t5.pay_percentage > 0, t5.pay_percentage, %d) / 100) AS SIGNED) earning_price,
|
||||||
t2.status waybill_status, t2.courier_name, t2.courier_mobile,
|
t2.status waybill_status, t2.courier_name, t2.courier_mobile,
|
||||||
t2.actual_fee, t2.desired_fee, t2.waybill_created_at, t2.waybill_finished_at`, model.DefaultEarningPricePercentage)
|
t2.actual_fee, t2.desired_fee, t2.waybill_created_at, t2.waybill_finished_at,
|
||||||
|
city.name city_name, district.name district_name`, model.DefaultEarningPricePercentage)
|
||||||
if isIncludeSku {
|
if isIncludeSku {
|
||||||
sql += `,
|
sql += `,
|
||||||
IF(t3.jx_sku_id > 0, t3.jx_sku_id, t3.sku_id) sku_id,
|
IF(t3.jx_sku_id > 0, t3.jx_sku_id, t3.sku_id) sku_id,
|
||||||
@@ -259,7 +260,9 @@ func (c *OrderManager) getOrders(ctx *jxcontext.Context, isIncludeSku, isInclude
|
|||||||
sql += `
|
sql += `
|
||||||
FROM goods_order t1
|
FROM goods_order t1
|
||||||
LEFT JOIN waybill t2 ON t1.vendor_waybill_id = t2.vendor_waybill_id AND t1.waybill_vendor_id = t2.waybill_vendor_id
|
LEFT JOIN waybill t2 ON t1.vendor_waybill_id = t2.vendor_waybill_id AND t1.waybill_vendor_id = t2.waybill_vendor_id
|
||||||
LEFT JOIN store t5 ON t5.id = IF(t1.jx_store_id <> 0, t1.jx_store_id, t1.store_id)`
|
LEFT JOIN store t5 ON t5.id = IF(t1.jx_store_id <> 0, t1.jx_store_id, t1.store_id)
|
||||||
|
LEFT JOIN place city ON city.code = t5.city_code
|
||||||
|
LEFT JOIN place district ON district.code = t5.district_code`
|
||||||
if isIncludeSku {
|
if isIncludeSku {
|
||||||
sql += `
|
sql += `
|
||||||
JOIN order_sku t3 ON t3.vendor_order_id = t1.vendor_order_id AND t3.vendor_id = t1.vendor_id`
|
JOIN order_sku t3 ON t3.vendor_order_id = t1.vendor_order_id AND t3.vendor_id = t1.vendor_id`
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ type GoodsOrderExt struct {
|
|||||||
WaybillCreatedAt time.Time `orm:"type(datetime);index" json:"waybillCreatedAt"`
|
WaybillCreatedAt time.Time `orm:"type(datetime);index" json:"waybillCreatedAt"`
|
||||||
WaybillFinishedAt time.Time `orm:"type(datetime)" json:"waybillFinishedAt"`
|
WaybillFinishedAt time.Time `orm:"type(datetime)" json:"waybillFinishedAt"`
|
||||||
|
|
||||||
|
DistrictName string `json:"districtName"`
|
||||||
|
CityName string `json:"cityName"`
|
||||||
|
|
||||||
SkuID int `orm:"column(sku_id)" json:"skuID,omitempty"`
|
SkuID int `orm:"column(sku_id)" json:"skuID,omitempty"`
|
||||||
SkuShopPrice int `json:"skuShopPrice,omitempty"`
|
SkuShopPrice int `json:"skuShopPrice,omitempty"`
|
||||||
SkuSalePrice int `json:"skuSalePrice,omitempty"`
|
SkuSalePrice int `json:"skuSalePrice,omitempty"`
|
||||||
|
|||||||
Reference in New Issue
Block a user