Skip to content

[Bug] 使用left join,查询的结果,右表的ID会覆盖主表的ID #506

Open
@guankai

Description

@guankai

APIJSON Version/APIJSON 版本号

6.0.0

Database Type & Version/数据库类型及版本号

5.7.26

Environment/环境信息

- JDK/基础库:1.8.0_301
- OS/系统: macOS Big Sur

APIAuto Screenshots/APIAuto 请求与结果完整截屏

在APIAuto上结果是正常的,但是在本地测试异常

Current Behavior/问题描述

测试的请求数据

{
    "[]": {
      "join":"</User/id@",
      "Moment":{
          "@column":"id,date,userId",
          "id":12
        },
      "User":{
        "id@":"/Moment/userId",
        "@column":"id,name"
      }
    }
  }

测试的返回结果是

{
    "[]": [
        {
            "Moment": {
                "id": 70793,
                "date": "2017-02-08 16:06:11.0",
                "userId": 70793,
                "name": "Strong"
            },
            "User": {
                "id": 70793,
                "name": "Strong"
            }
        }
    ]
}

在APIAuto上,User的查询结果不会在Moment中出现,但是在本地测试的时候,因为User里面也会查询出ID,在构建返回数据的时候会出现User中的id将Moment中id覆盖的情况,这个是不是需要在哪里进行设置?



### Expected Behavior/期望结果

_No response_

### Any additional comments?/其它补充说明?

_No response_

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions