fix(api): 修正userId字段JSON键名
- 修改JSON_CONTAINS中字段键名由'user_id'为'userId' - 保证用户ID匹配逻辑正确执行 - 防止因键名错误导致的查询失败
This commit is contained in:
parent
962d1c0ae3
commit
8868051767
|
|
@ -36,7 +36,7 @@ func (a *YMTMerchantsAPI) list(w http.ResponseWriter, r *http.Request) {
|
|||
args := []interface{}{}
|
||||
if userIDStr != "" {
|
||||
// user_id 匹配 或者 operation_user JSON 中包含该 user_id
|
||||
sql1 += " AND (user_id = ? OR JSON_CONTAINS(operation_user, JSON_OBJECT('user_id', CAST(? AS SIGNED))))"
|
||||
sql1 += " AND (user_id = ? OR JSON_CONTAINS(operation_user, JSON_OBJECT('userId', CAST(? AS SIGNED))))"
|
||||
args = append(args, userIDStr, userIDStr)
|
||||
}
|
||||
if like != "" {
|
||||
|
|
|
|||
Loading…
Reference in New Issue