zwl 5 سال پیش
والد
کامیت
18ed153c18
2فایلهای تغییر یافته به همراه4 افزوده شده و 6 حذف شده
  1. 3 3
      controllers/erms3/spotContract.go
  2. 1 3
      models/erms3.go

+ 3 - 3
controllers/erms3/spotContract.go

@@ -135,7 +135,7 @@ func AddSpotContractApply(c *gin.Context) {
 	spotcontractid := GenSpotContractID()
 
 	// 获取当前交易日
-	tradedate, err := GetMarketTradeDate(int(req.MarketID))
+	tradedate, err := GetMarketTradeDate()
 	if err != nil {
 		// 返回失败
 		logger.GetLogger().Errorf("AddSpotContractApply get market trade date failed: %s", err.Error())
@@ -216,8 +216,8 @@ func GenSpotContractID() int64 {
 }
 
 // GetMarketTradeDate 获取市场交易日
-func GetMarketTradeDate(marketid int) (string, error) {
-	marketrun, err := models.GetMarketRun(marketid)
+func GetMarketTradeDate() (string, error) {
+	marketrun, err := models.GetMarketRun(0)
 	if err != nil {
 		return "", err
 	}

+ 1 - 3
models/erms3.go

@@ -123,7 +123,6 @@ func AddSpotContractApply(spotContractApply Erms3SpotContractApply) error {
 			  DETAILJSON,
 			  APPLYSTATUS,
 			  APPLYSRC,
-			  MARKETID,
 			  CREATORID,
 			  CREATETIME)
 			VALUES(?,
@@ -144,7 +143,6 @@ func AddSpotContractApply(spotContractApply Erms3SpotContractApply) error {
 				?,
 				?,
 				?,
-				?,
 				sysdate)`
 	_, err := engine.Exec(sql,
 		spotContractApply.SpotContractID,
@@ -164,12 +162,12 @@ func AddSpotContractApply(spotContractApply Erms3SpotContractApply) error {
 		spotContractApply.DetailJSON,
 		spotContractApply.ApplyStatus,
 		spotContractApply.ApplySrc,
-		spotContractApply.MarketID,
 		spotContractApply.CreatorID)
 
 	return err
 }
 
+// QueryErms3SpotContractInfo 查询现货合同信息
 func QueryErms3SpotContractInfo(accountids []int64, contracttype, contractmode, status int32) ([]Erms3SpotContractInfo, error) {
 	datas := make([]Erms3SpotContractInfo, 0)
 	engine := db.GetEngine()