Ver Fonte

查定投价接口修改

zou.yingbin há 4 anos atrás
pai
commit
a4247d54b4
1 ficheiros alterados com 6 adições e 1 exclusões
  1. 6 1
      models/qhj.go

+ 6 - 1
models/qhj.go

@@ -1036,8 +1036,13 @@ func (r *QhjReckonPriceLog) buildSql() string {
 		"  LEFT JOIN GOODS g on t.goodsid=g.goodsid" +
 		"  INNER JOIN MARKET m on g.marketid=g.marketid" +
 		" WHERE 1 = 1 and m.marketid=69201"
-	sqlId.AndEx("t.TRADEDATE", r.TRADEDATE, len(r.TRADEDATE) > 0)
 	sqlId.AndEx("t.GOODSID", r.GOODSID, r.GOODSID > 0)
+	if r.TRADEDATE != "" {
+		sqlId.AndEx("t.TRADEDATE", r.TRADEDATE, len(r.TRADEDATE) > 0)
+	} else {
+		sqlId.JoinFormat(" and t.TRADEDATE = (select max(TRADEDATE) from RECKON_PRICELOG)")
+	}
+
 	return sqlId.String()
 }