Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong db connection #47

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function make_ipv4_list_file(){
\App\Http\Controllers\Admin\ActionLogController::log(0,"bgp_system","trying to make ipv4 bgp file in '".base_path('storage/download/').'ipv4.txt'."'");
$content = '';
$months = env('PIRACY_SHIELD_ITEMS_VALIDITY_MONTHS');
$ipv4s_piracy = collect(DB::connection('piracy_shield')->select("select feedbacks.item from (select distinct item from ticket_items_log where item_type = 'ipv4' and `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as feedbacks INNER JOIN (select ipv4 as item from ipv4s where `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as lastitems on feedbacks.item = lastitems.item order by item",[$months,$months]))->pluck('item');
$ipv4s_piracy = collect(DB::connection('mysql')->select("select feedbacks.item from (select distinct item from ps_ticket_items_log where item_type = 'ipv4' and `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as feedbacks INNER JOIN (select ipv4 as item from ps_ipv4s where `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as lastitems on feedbacks.item = lastitems.item order by item",[$months,$months]))->pluck('item');
$ipv4s_manual = \App\Manual\IPv4s::select('ipv4')->distinct()->pluck('ipv4')->toArray();
$done = [];
foreach ($ipv4s_piracy as $ipv4) {
Expand Down Expand Up @@ -47,7 +47,7 @@ public function make_ipv6_list_file(){
\App\Http\Controllers\Admin\ActionLogController::log(0,"bgp_system","trying to make ipv6 bgp file in '".base_path('storage/download/').'ipv6.txt'."'");
$content = '';
$months = env('PIRACY_SHIELD_ITEMS_VALIDITY_MONTHS');
$ipv6s_piracy = collect(DB::connection('piracy_shield')->select("select feedbacks.item from (select distinct item from ticket_items_log where item_type = 'ipv6' and `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as feedbacks INNER JOIN (select ipv6 as item from ipv6s where `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as lastitems on feedbacks.item = lastitems.item order by item",[$months,$months]))->pluck('item');
$ipv6s_piracy = collect(DB::connection('mysql')->select("select feedbacks.item from (select distinct item from ps_ticket_items_log where item_type = 'ipv6' and `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as feedbacks INNER JOIN (select ipv6 as item from ps_ipv6s where `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as lastitems on feedbacks.item = lastitems.item order by item",[$months,$months]))->pluck('item');
$ipv6s_manual = \App\Manual\IPv6s::select('ipv6')->distinct()->pluck('ipv6')->toArray();
$done = [];
foreach ($ipv6s_piracy as $ipv6) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private function install_zone(){
$admsmokingblacklist = \App\ADM\SmokingBlacklist::select('fqdn')->distinct()->pluck('fqdn')->toArray();
$cncpoblacklist = \App\CNCPO\Blacklist::select('fqdn')->distinct()->pluck('fqdn')->toArray();
$months = env('PIRACY_SHIELD_ITEMS_VALIDITY_MONTHS');
$piracyshield = collect(DB::connection('piracy_shield')->select("select feedbacks.item from (select distinct item from ticket_items_log where item_type = 'fqdn' and `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as feedbacks INNER JOIN (select fqdn as item from fqdns where `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as lastitems on feedbacks.item = lastitems.item order by item",[$months,$months]))->pluck('item');
$piracyshield = collect(DB::connection('mysql')->select("select feedbacks.item from (select distinct item from ps_ticket_items_log where item_type = 'fqdn' and `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as feedbacks INNER JOIN (select fqdn as item from ps_fqdns where `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as lastitems on feedbacks.item = lastitems.item order by item",[$months,$months]))->pluck('item');
$manual = \App\Manual\FQDNs::select('fqdn')->distinct()->pluck('fqdn')->toArray();
$done = [];
foreach ($admbettingblacklist as $fqdn) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function make_ipv4_list_file(){
\App\Http\Controllers\Admin\ActionLogController::log(0,"bgp_system","trying to make ipv4 bgp file in '".base_path('storage/download/').'ipv4.txt'."'");
$content = '';
$months = env('PIRACY_SHIELD_ITEMS_VALIDITY_MONTHS');
$ipv4s_piracy = collect(DB::connection('piracy_shield')->select("select feedbacks.item from (select distinct item from ticket_items_log where item_type = 'ipv4' and `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as feedbacks INNER JOIN (select ipv4 as item from ipv4s where `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as lastitems on feedbacks.item = lastitems.item order by item",[$months,$months]))->pluck('item');
$ipv4s_piracy = collect(DB::connection('mysql')->select("select feedbacks.item from (select distinct item from ps_ticket_items_log where item_type = 'ipv4' and `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as feedbacks INNER JOIN (select ipv4 as item from ps_ipv4s where `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as lastitems on feedbacks.item = lastitems.item order by item",[$months,$months]))->pluck('item');
$ipv4s_manual = \App\Manual\IPv4s::select('ipv4')->distinct()->pluck('ipv4')->toArray();
$done = [];
foreach ($ipv4s_piracy as $ipv4) {
Expand Down Expand Up @@ -47,7 +47,7 @@ public function make_ipv6_list_file(){
\App\Http\Controllers\Admin\ActionLogController::log(0,"bgp_system","trying to make ipv6 bgp file in '".base_path('storage/download/').'ipv6.txt'."'");
$content = '';
$months = env('PIRACY_SHIELD_ITEMS_VALIDITY_MONTHS');
$ipv6s_piracy = collect(DB::connection('piracy_shield')->select("select feedbacks.item from (select distinct item from ticket_items_log where item_type = 'ipv6' and `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as feedbacks INNER JOIN (select ipv6 as item from ipv6s where `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as lastitems on feedbacks.item = lastitems.item order by item",[$months,$months]))->pluck('item');
$ipv6s_piracy = collect(DB::connection('mysql')->select("select feedbacks.item from (select distinct item from ps_ticket_items_log where item_type = 'ipv6' and `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as feedbacks INNER JOIN (select ipv6 as item from ps_ipv6s where `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as lastitems on feedbacks.item = lastitems.item order by item",[$months,$months]))->pluck('item');
$ipv6s_manual = \App\Manual\IPv6s::select('ipv6')->distinct()->pluck('ipv6')->toArray();
$done = [];
foreach ($ipv6s_piracy as $ipv6) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private function install_zone(){
$admsmokingblacklist = \App\ADM\SmokingBlacklist::select('fqdn')->distinct()->pluck('fqdn')->toArray();
$cncpoblacklist = \App\CNCPO\Blacklist::select('fqdn')->distinct()->pluck('fqdn')->toArray();
$months = env('PIRACY_SHIELD_ITEMS_VALIDITY_MONTHS');
$piracyshield = collect(DB::connection('piracy_shield')->select("select feedbacks.item from (select distinct item from ticket_items_log where item_type = 'fqdn' and `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as feedbacks INNER JOIN (select fqdn as item from fqdns where `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as lastitems on feedbacks.item = lastitems.item order by item",[$months,$months]))->pluck('item');
$piracyshield = collect(DB::connection('mysql')->select("select feedbacks.item from (select distinct item from ps_ticket_items_log where item_type = 'fqdn' and `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as feedbacks INNER JOIN (select fqdn as item from ps_fqdns where `timestamp` > DATE_SUB(now(), INTERVAL ? MONTH)) as lastitems on feedbacks.item = lastitems.item order by item",[$months,$months]))->pluck('item');
$manual = \App\Manual\FQDNs::select('fqdn')->distinct()->pluck('fqdn')->toArray();
$done = [];
foreach ($admbettingblacklist as $fqdn) {
Expand Down