订单亏损规则,查询审核信息带门店等级

This commit is contained in:
苏尹岚
2020-06-12 17:13:27 +08:00
parent 290d2f4693
commit bb0d49efd4
2 changed files with 3 additions and 2 deletions

View File

@@ -1443,7 +1443,7 @@ func OrderProfitWarning(order *model.GoodsOrder) {
if storeDetail != nil && err == nil {
payPercentage := storeDetail.PayPercentage
if payPercentage >= 50 {
profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney-order.EarningPrice)) / 100
profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney-order.ShopPrice)) / 100
} else {
profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney*int64(payPercentage)/200)) / 100
}

View File

@@ -1558,6 +1558,7 @@ type tStoreSkuAudit struct {
MidUnitPrice int `json:"midUnitPrice"`
CityName string `json:"cityName"`
PayPercentage int `json:"payPercentage"`
StoreLevel string `json:"StoreLevel"`
}
func GetStoreSkuAudit(db *DaoDB, storeIDs, nameIDs, skuIDs, statuss, types []int, name, remark, keyword, marketManPhone, cityName string, applyTimeStart, applyTimeEnd, auditTimeStart, auditTimeEnd time.Time, pageSize, offset int) (pagedInfo *model.PagedInfo, err error) {
@@ -1565,7 +1566,7 @@ func GetStoreSkuAudit(db *DaoDB, storeIDs, nameIDs, skuIDs, statuss, types []int
sql := `
SELECT SQL_CALC_FOUND_ROWS DISTINCT a.*,
c.name sku_name, c.prefix, c.unit, c.spec_quality, c.spec_unit, c.img,
d.name store_name, b.name, e.mid_unit_price, f.name city_name, d.pay_percentage
d.name store_name, b.name, e.mid_unit_price, f.name city_name, d.pay_percentage, d.store_level
FROM store_sku_audit a
LEFT JOIN user b ON a.user_id = b.user_id
LEFT JOIN sku_name c ON c.id = a.name_id AND c.deleted_at = ?