Explorar el Código

fix bug:查现货商品详情失败

zou.yingbin hace 4 años
padre
commit
dc7c724aaf
Se han modificado 1 ficheros con 6 adiciones y 3 borrados
  1. 6 3
      models/ermcpWrstandard.go

+ 6 - 3
models/ermcpWrstandard.go

@@ -49,11 +49,14 @@ func (r *ErmcpWrstandard) buildSql() string {
 		"       REMARK," +
 		"       AREAUSERID" +
 		"  from wrstandard t" +
-		" where t.AREAUSERID=%v and t.ISVALID=%v"
-	sqlId := fmt.Sprintf(str, r.AREAUSERID, r.ISVALID)
+		" where t.AREAUSERID=%v"
+	sqlId := fmt.Sprintf(str, r.AREAUSERID)
 	if r.WRSTANDARDID > 0 {
 		sqlId = sqlId + fmt.Sprintf(" and WRSTANDARDID=%v", r.WRSTANDARDID)
 	}
+	if r.ISVALID >= 0{
+		sqlId = sqlId + fmt.Sprintf(" and t.ISVALID=%v", r.ISVALID)
+	}
 	return sqlId
 }
 
@@ -205,7 +208,7 @@ type ErmcpWrstandDetail struct {
 // 查询现货商品详细
 func (r *ErmcpWrstandDetail) GetData() (ErmcpWrstandDetail, error) {
 	// 获取基本信息
-	m := ErmcpWrstandard{AREAUSERID: r.Wrd.AREAUSERID, WRSTANDARDID: r.Wrd.WRSTANDARDID}
+	m := ErmcpWrstandard{AREAUSERID: r.Wrd.AREAUSERID, WRSTANDARDID: r.Wrd.WRSTANDARDID, ISVALID: -1}
 	d, err := m.GetData()
 	if err != nil {
 		return ErmcpWrstandDetail{}, err