namespace send\sms\Cron;
use Magento\Framework\ObjectManagerInterface;
class Run /*extends send\sms\Controller\Customr*/ {
public function execute()
{
$om = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $om->get('Magento\Customer\Model\Session');
if($customerSession->isLoggedIn()) {
$idd =$customerSession->getCustomer()->getId();
}
$this->_resources = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Framework\App\ResourceConnection');
$connection= $this->_resources->getConnection();
//$sql = "UPDATE `total_cashback` SET is_active= 100 WHERE user_id = '801' ";
$sql = "UPDATE `wallet_discounts` SET is_active = 12000 WHERE customer_id = $idd ";
$connection->query($sql);
}
}
Cannot get customer Id in the above snippet.