Explorar o código

PromotionIncomeDetail: 修改返回市场错误

deng.yinping %!s(int64=3) %!d(string=hai) anos
pai
achega
9f70d6563b
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      models/ferroalloy.go

+ 4 - 2
models/ferroalloy.go

@@ -1547,12 +1547,14 @@ func (r *PromotionIncomeDetail) buildSql() string {
 		wr.WRSTANDARDID,
 		wr.WRSTANDARDCODE,
 		wr.WRSTANDARDNAME, 
-		case t.marketid when 64201 then '采购' else '供求' end MARKET,
-		case t.buyorsell when 0 then '采购' else '销售' end BUYORSELL,
+		en.enumdicname MARKET,
+		en1.enumdicname BUYORSELL,
 		case t.profitroletype when 3 then '一级' else '二级' end PROFITROLETYPE,
 		t.PROFITAMOUNT
 	from THJ_Reckon_ProfitRecode t
 	left join wrstandard wr on t.wrstandardid = wr.wrstandardid
+	left join enumdicitem en on t.marketid = en.enumitemname and en.enumdiccode='THJMarket'
+	left join enumdicitem en1 on t.buyorsell = en1.enumitemname and en1.enumdiccode='buyOrSell'
 	where substr(t.tradedate,0,6) = '%v' and t.userid = %v and t.profitroletype in (3,4)
 	order by t.tradetime desc
 `