<?php

include '../common.php';
use Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\d3507c2999d38573a0a0c91771d70af2;
use Ministra\Lib\SysEvent;
use Ministra\Lib\System;
$all_channels = \Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\d3507c2999d38573a0a0c91771d70af2::getInstance()->from('itv')->where(['status' => 1])->get()->all('id');
$all_channels = \Ministra\Lib\System::base64_encode(\Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\t17d3317196ac950e8b2dfe26f26e5a0c($all_channels));
$result = \Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\d3507c2999d38573a0a0c91771d70af2::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();
}
