<?php

require __DIR__ . '/../common.php';
use Ministra\Lib\bd5c9022e9a9029209e5fd05775ea272\U7b1423316998af8498523ab49b7053e6\Z0123335d0e9312494791d8030b626dff;
use Ministra\Lib\bd5c9022e9a9029209e5fd05775ea272\B4291b8d8fa2d898727b1f446db1e661e;
use Ministra\Lib\SysEvent;
use Ministra\Lib\System;
$all_channels = \Ministra\Lib\bd5c9022e9a9029209e5fd05775ea272\B4291b8d8fa2d898727b1f446db1e661e::getInstance()->from('itv')->where(['status' => 1])->get()->all('id');
$all_channels = \Ministra\Lib\System::base64_encode(\Ministra\Lib\bd5c9022e9a9029209e5fd05775ea272\U7b1423316998af8498523ab49b7053e6\Z0123335d0e9312494791d8030b626dff::y08f4e0044959ef2ebbd1e3b0db7ed4ee($all_channels));
$result = \Ministra\Lib\bd5c9022e9a9029209e5fd05775ea272\B4291b8d8fa2d898727b1f446db1e661e::getInstance()->query("insert into itv_subscription (uid, sub_ch, addtime) (select id, '" . $all_channels . "' as sub_ch, now() from users) on duplicate key update sub_ch=VALUES(sub_ch)")->result();
if ($result) {
    $event = new \Ministra\Lib\SysEvent();
    $event->setUserListByMac('all');
    $event->sendUpdateSubscription();
}
