package II207dd2bf17235ba82f00f7c3d2eb3c70; use strict 'vars'; use base qw/IIce24d42d7cf6543dfaf1105ddb482120/; use II4212c07ddfb1652c969722f1a6817994; use II1b7f5cd35f00c93f234e8e1273dbac2a; use II0c124bc2b4053fbe458810f5aab24564; use II386dc06955fcb922a774bf9333f6be72; use IIc006e1d88f66a3969ffd0192be9acb1b; BEGIN{*II207dd2bf17235ba82f00f7c3d2eb3c70::IlIllIlllIlIIIlI=\%{pack('H6','7f0404')^':JR'};*II207dd2bf17235ba82f00f7c3d2eb3c70::llIIlIlIIIlIIIII=\&{pack('H24','242c572f7d6a36777d323705')^'IM>AGPEOJPO1'};$II207dd2bf17235ba82f00f7c3d2eb3c70::IIlIIllllIlIIIII=pack('H18','78110669150d06676f')^'0ER9JEI4;';$II207dd2bf17235ba82f00f7c3d2eb3c70::IllIIlIIllIlllII=pack('H12','030a7f151806')^'IC1YQE'};sub cfg   { II0c124bc2b4053fbe458810f5aab24564::lllIlIllIllIIIlI($II386dc06955fcb922a774bf9333f6be72::IllIIIIlIIlIlIII{$II4212c07ddfb1652c969722f1a6817994::llIllIIIlIIIIIlI},887,$II386dc06955fcb922a774bf9333f6be72::IllIIIIlIIlIlIII{$II1b7f5cd35f00c93f234e8e1273dbac2a::IlllIlIlIIlIllIl})->cfg } BEGIN{*II207dd2bf17235ba82f00f7c3d2eb3c70::IIIIlIIllIlIlllI=\%{pack('H6','1c7f69')^'Y1?'};*II207dd2bf17235ba82f00f7c3d2eb3c70::lIIIlIIlIIlIIIIl=\&{pack('H24','34543a277c013a6f773a3065')^'Y5SIF;IW@XHQ'};$II207dd2bf17235ba82f00f7c3d2eb3c70::llIIIIIllllIIIIl=pack('H18','1962661f6b01736612')^'Q62O4I<5F';$II207dd2bf17235ba82f00f7c3d2eb3c70::IIIlIIIlIllIlllI=pack('H12','007806190515')^'J1HULV'};sub cache { II207dd2bf17235ba82f00f7c3d2eb3c70::llIIlIlIIIlIIIII($II207dd2bf17235ba82f00f7c3d2eb3c70::lllllllllllllIlI{$II0c124bc2b4053fbe458810f5aab24564::lIIIIIIIIIIIIIIl},887,$II207dd2bf17235ba82f00f7c3d2eb3c70::lllllllllllllIlI{$II0c124bc2b4053fbe458810f5aab24564::IlllIIIIlIIlllIl})->cache } BEGIN{*II207dd2bf17235ba82f00f7c3d2eb3c70::lllllllllllllIlI=\%{pack('H6','7c746f')^'9:9'};*II207dd2bf17235ba82f00f7c3d2eb3c70::IlIIIlIllIllllII=\&{pack('H24','395b205875692b6e0f3b4c0f')^'T:I6OSXV8Y4;'};$II207dd2bf17235ba82f00f7c3d2eb3c70::llllIlllIIIIlIlI=pack('H18','721263101a11016e0d')^':F7@EYN=Y';$II207dd2bf17235ba82f00f7c3d2eb3c70::IIIIIIlIIlIIIlll=pack('H12','1e1f0d700e03')^'TVC<G@'};sub cron { my $class = shift; my $message = ''; return $message unless II386dc06955fcb922a774bf9333f6be72::IlIllIlIIIlIllIl($II207dd2bf17235ba82f00f7c3d2eb3c70::lllllllllllllIlI{$II4212c07ddfb1652c969722f1a6817994::IIIIllIIllllllII},1032,$II207dd2bf17235ba82f00f7c3d2eb3c70::lllllllllllllIlI{$IIc006e1d88f66a3969ffd0192be9acb1b::llIIIIllIllIIlII})->hasFeature('followupman'); my $iter = $class->iterator(confirmed => 1, optout => 0, WHERE => 'message_id!=0 and stime<now()'); my $us; while ($iter->hasNext) { $us = $iter->next; $us->send; } my $dbc = $class->dbc; $iter = $dbc->getRecordsIterator(<<END1);
select r.user_series_id, r.message_id from jin_followupman_user_recur as r
left join jin_followupman_user_series as us on us.id=r.user_series_id
left join jin_followupman_series_message as msg on msg.id=r.message_id
where (r.num < msg.recur_num or msg.recur_num=0) and r.stime <= now() and us.message_id!=0 and us.optout=0
END1
while ($iter->hasNext) { my $record = $iter->next; my $msg = II207dd2bf17235ba82f00f7c3d2eb3c70::llIIIllIllIIlIIl($II0c124bc2b4053fbe458810f5aab24564::IlIIIlllllIlIIlI{$IIce24d42d7cf6543dfaf1105ddb482120::lIlIlIIIIllIIlll},172,$II0c124bc2b4053fbe458810f5aab24564::IlIIIlllllIlIIlI{$IIc006e1d88f66a3969ffd0192be9acb1b::llIIIIllIllIIlII})->get($record->{message_id}); $us = $class->get($record->{user_series_id}); $us->sendMsg($msg); $us->sendCoMsg($msg); $dbc->do(<<END2);
update jin_followupman_user_recur set num=num+1, stime=date_add(now(), interval $msg->{recur_delay} hour)
where user_series_id=$us->{id} and message_id=$msg->{id}
END2
} $message; } BEGIN{*II207dd2bf17235ba82f00f7c3d2eb3c70::IllIIlIIllIlIIII=\%{pack('H6','0e0515')^'KKC'};*II207dd2bf17235ba82f00f7c3d2eb3c70::llIIIllIllIIlIIl=\&{pack('H24','5e245925706f337777554379')^'3E0KJU@O@7;M'};$II207dd2bf17235ba82f00f7c3d2eb3c70::IllllIllIlllIlIl=pack('H18','780667011d001b6e03')^'0R3QBHT=W';$II207dd2bf17235ba82f00f7c3d2eb3c70::lIlIIlIlIlIllIlI=pack('H12','7c7b1878107f')^'62V4Y<'};sub initiateForSale { my ($class, $sale) = @_; return unless II386dc06955fcb922a774bf9333f6be72::IlIllIlIIIlIllIl($IIce24d42d7cf6543dfaf1105ddb482120::IllllIIlIlIIIlII{$IIce24d42d7cf6543dfaf1105ddb482120::IlIIllIlllIIlIll},1032,$IIce24d42d7cf6543dfaf1105ddb482120::IllllIIlIlIIIlII{$IIc006e1d88f66a3969ffd0192be9acb1b::lllllIIIlIIIllll})->hasFeature('followupman'); my $prod_id = $sale->{prod_id}; my $user_id = $sale->{user_id}; for my $series (II386dc06955fcb922a774bf9333f6be72::IllllllllllIlIII($II207dd2bf17235ba82f00f7c3d2eb3c70::IllIIlIIllIlIIII{$II4212c07ddfb1652c969722f1a6817994::lIIlIlIIIIllIllI},21,$II207dd2bf17235ba82f00f7c3d2eb3c70::IllIIlIIllIlIIII{$II4212c07ddfb1652c969722f1a6817994::llIllIlIIlIllIll})->search(WHERE => "find_in_set('$prod_id', prods)")) { for my $del_series_id (split ',', $series->{del_series}) { $_->delete for $class->search(user_id => $user_id, series_id => $del_series_id); } next if $class->search(user_id => $user_id, series_id => $series->{id}, NUM => 1)->[0]; my $message = IIc006e1d88f66a3969ffd0192be9acb1b::llIlIIlIIlIlIlII($II0c124bc2b4053fbe458810f5aab24564::IllIlIIlllIIIlII{$II386dc06955fcb922a774bf9333f6be72::lIlIIlIIlllIllII},172,$II0c124bc2b4053fbe458810f5aab24564::IllIlIIlllIIIlII{$II4212c07ddfb1652c969722f1a6817994::IIIIIllIIIIlIIll})->search(series_id => $series->{id}, ORDER => 'seq', NUM => 1)->[0] or next; $class->get->set( user_id => $user_id, message_id => $message->{id}, series_id => $series->{id}, sale_id => $sale->id, )->save; } return; } 1; 