Craft 3: get enabled sites of an entry
Totally untested but this should work

$enabledSiteIds = (new Query())
    -&gt;select('siteId')
    -&gt;from('{{%elements_sites}}')
    -&gt;where([
        'enabled' =&gt; true,
        'elementId' =&gt; $elementId
    ])
    -&gt;column();


You might want to join the elements and entries table in order to gain only elements where elements.enabled is true too (and check the expiry date), otherwise you'll receive disabled entries