πŸ’ΌQBCore

For the organization panel to work properly with QBCore, you must follow these steps:

  1. Go to /config/config_s.lua and find Config.Queries

  2. Replace it with this:

Config.Queries = {
    ['identifierbyssn'] = 'SELECT citizenid FROM players WHERE ssn = @ssn',
    ['namebyidentifier'] = 'SELECT charinfo FROM players WHERE citizenid = @identifier',
    ['nameandjoindate'] = [[
        SELECT JSON_UNQUOTE(JSON_EXTRACT(p.charinfo, '$.firstname')) AS firstname,
               JSON_UNQUOTE(JSON_EXTRACT(p.charinfo, '$.lastname')) AS lastname,
               om.join_date 
        FROM organization_members om
        JOIN players p ON om.user_id = p.citizenid
        WHERE om.org_id = @org_id
    ]],
    ['members'] = [[
        SELECT om.user_id, om.permissions, om.join_date,
               JSON_UNQUOTE(JSON_EXTRACT(u.charinfo, '$.firstname')) AS firstname,
               JSON_UNQUOTE(JSON_EXTRACT(u.charinfo, '$.lastname')) AS lastname,
               om.rank,
               CASE WHEN o.owner_id = om.user_id THEN TRUE ELSE FALSE END AS isOwner
        FROM organization_members om
        INNER JOIN players u ON u.citizenid = om.user_id
        LEFT JOIN organizations o ON o.id = om.org_id
        WHERE om.org_id = @org_id
    ]],
    ['transactions'] = [[
        SELECT ot.*, 
               JSON_UNQUOTE(JSON_EXTRACT(u.charinfo, '$.firstname')) AS firstname,
               JSON_UNQUOTE(JSON_EXTRACT(u.charinfo, '$.lastname')) AS lastname
        FROM organization_transactions ot
        LEFT JOIN players u ON u.citizenid = ot.user_id
        WHERE ot.org_id = @org_id ORDER BY ot.date DESC LIMIT 30
    ]]
}
  1. Restart the script via restart pp-orgpanel

  2. Now everything should work properly