|
|
@@ -323,21 +323,33 @@ func LoginQuery(c *gin.Context) {
|
|
|
}
|
|
|
rsp.Goodsgroups = goodsgroups
|
|
|
}
|
|
|
+
|
|
|
// 外部交易所
|
|
|
rsp.ExternalExchanges = make([]models.Externalexchange, 0)
|
|
|
if len(rsp.Goodsgroups) > 0 {
|
|
|
exchangeIDs := make([]int, 0)
|
|
|
+
|
|
|
+ // 过滤掉没有关联商品的交易所
|
|
|
+ id := models.GetAvalidExchangeId(rsp.UserAccount.Rootuserid)
|
|
|
+
|
|
|
for _, v := range rsp.Goodsgroups {
|
|
|
- exchangeIDs = append(exchangeIDs, int(v.Exexchangeid))
|
|
|
+ for i := range id {
|
|
|
+ if id[i] == v.Exexchangeid {
|
|
|
+ exchangeIDs = append(exchangeIDs, int(v.Exexchangeid))
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- exExchanges, err := models.GetExExchangeByIDs(exchangeIDs)
|
|
|
- if err != nil {
|
|
|
- // 查询失败
|
|
|
- logger.GetLogger().Errorf("LoginQuery failed: %s", err.Error())
|
|
|
- appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
|
|
|
- return
|
|
|
+
|
|
|
+ if len(exchangeIDs) > 0 {
|
|
|
+ exExchanges, err := models.GetExExchangeByIDs(exchangeIDs)
|
|
|
+ if err != nil {
|
|
|
+ // 查询失败
|
|
|
+ logger.GetLogger().Errorf("LoginQuery failed: %s", err.Error())
|
|
|
+ appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ rsp.ExternalExchanges = exExchanges
|
|
|
}
|
|
|
- rsp.ExternalExchanges = exExchanges
|
|
|
}
|
|
|
// 系统参数
|
|
|
systemParams, err := models.GetSystemParams()
|