From d2b0b6ceaa6878b5e2c0c716760fc421d4e07f04 Mon Sep 17 00:00:00 2001 From: Weltolk <40228052+Weltolk@users.noreply.github.com> Date: Mon, 24 Oct 2022 12:13:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=A1=E5=88=92=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1bug,=E6=B7=BB=E5=8A=A0=E8=AE=A1=E5=88=92=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cron_weltolk_sign_qq.php | 35 +- weltolk_sign_qq_show.php | 1424 +++++++++++++++++++------------------- 2 files changed, 740 insertions(+), 719 deletions(-) diff --git a/cron_weltolk_sign_qq.php b/cron_weltolk_sign_qq.php index f611aa7..993ff68 100644 --- a/cron_weltolk_sign_qq.php +++ b/cron_weltolk_sign_qq.php @@ -14,9 +14,10 @@ function cron_weltolk_sign_qq() } $s = unserialize(option::get('plugin_weltolk_sign_qq')); $date = date("Y-m-j", strtotime("-1 day")); - $now = strtotime(date('Y-m-d')); + $now = time(); $hour = date('h'); $y = $m->query("SELECT * FROM `" . DB_PREFIX . "weltolk_sign_qq_target` WHERE `nextdo` <= '{$now}' LIMIT {$s['limit']}"); + $log = ""; while ($x = $m->fetch_array($y)) { $is_open = option::uget('weltolk_sign_qq_enable', $x['uid']); if (!$is_open) { @@ -159,8 +160,15 @@ function cron_weltolk_sign_qq() && $result_json["retcode"] == 0 && $result_json["status"] == "ok") { $send_status = true; + $log .= date('Y-m-d') . " 成功 " . $x2["client"] . " 客户端通过 " . $x2["connect_type"] . " 方式给 " + . $x2["address"] . " 地址推送access_token为 " . $x2["access_token"] + . " 的消息: " . $x["type"] . " " . $x["type_id"] . " " . $send["params"]["message"] + . "\n"; } else { - + $log .= date('Y-m-d') . " 失败 " . $x2["client"] . " 客户端通过 " . $x2["connect_type"] . " 方式给 " + . $x2["address"] . " 地址推送access_token为 " . $x2["access_token"] + . " 的消息: " . $x["type"] . " " . $x["type_id"] . " " . $send["params"]["message"] + . "\n"; } } catch (\Exception $e) { echo "错误: "; @@ -169,7 +177,7 @@ function cron_weltolk_sign_qq() usleep(250000); } if ($send_status) { - $next = strtotime(date('Y-m-d', time())) + 86400 + $x['hour'] * 3600; + $next = strtotime(date('Y-m-d')) + 86400 + $x['hour'] * 3600; $m->query("UPDATE `" . DB_PREFIX . "weltolk_sign_qq_target` SET `nextdo` = '{$next}' WHERE `id` = '{$x['id']}'"); } } else if ($x2['connect_type'] == 'HTTP API') { @@ -221,14 +229,21 @@ function cron_weltolk_sign_qq() // && $res['echo'] == $sign ) { $send_status = true; + $log .= date('Y-m-d') . " 成功 " . $x2["client"] . " 客户端通过 " . $x2["connect_type"] . " 方式给 " + . $x2["address"] . " 地址推送access_token为 " . $x2["access_token"] + . " 的消息: " . $x["type"] . " " . $x["type_id"] . " " . $send["params"]["message"] + . "\n"; } else { - + $log .= date('Y-m-d') . " 失败 " . $x2["client"] . " 客户端通过 " . $x2["connect_type"] . " 方式给 " + . $x2["address"] . " 地址推送access_token为 " . $x2["access_token"] + . " 的消息: " . $x["type"] . " " . $x["type_id"] . " " . $send["params"]["message"] + . "\n"; } usleep(250000); } if ($send_status) { - $next = strtotime(date('Y-m-d', time())) + 86400 + $x['hour'] * 3600; + $next = strtotime(date('Y-m-d')) + 86400 + $x['hour'] * 3600; $m->query("UPDATE `" . DB_PREFIX . "weltolk_sign_qq_target` SET `nextdo` = '{$next}' WHERE `id` = '{$x['id']}'"); } @@ -240,12 +255,18 @@ function cron_weltolk_sign_qq() } } else { - $next = strtotime(date('Y-m-d', time())) + $x['hour'] * 3600; + $next = strtotime(date('Y-m-d')) + $x['hour'] * 3600; $m->query("UPDATE `" . DB_PREFIX . "weltolk_sign_qq_target` SET `nextdo` = '{$next}' WHERE `id` = '{$x['id']}'"); } } else { - $next = strtotime(date('Y-m-d', time())) + $x['hour'] * 3600; + $next = strtotime(date('Y-m-d')) + $x['hour'] * 3600; $m->query("UPDATE `" . DB_PREFIX . "weltolk_sign_qq_target` SET `nextdo` = '{$next}' WHERE `id` = '{$x['id']}'"); } } + $log = trim($log); + if (empty($log)) { + + } else { + return $log; + } } diff --git a/weltolk_sign_qq_show.php b/weltolk_sign_qq_show.php index 55dcdc9..364ed6c 100644 --- a/weltolk_sign_qq_show.php +++ b/weltolk_sign_qq_show.php @@ -560,790 +560,790 @@ } ?> - - -

每日签到qq推送

+ + +

每日签到qq推送

+ +
+ + + + + + + + +
是否开启每日签到qq推送 + >开启
+ >关闭 + +
+ + 保存设定 + +
+ + + + + + +
+
- - - - - +
+ + + +
是否开启每日签到qq推送 - >开启
- >关闭 - -
+ - + + + + + + + + + + + + + query("SELECT * FROM `" . DB_PREFIX . "weltolk_sign_qq_target` WHERE `uid` = " . UID); + while ($v = $m->fetch_array($x)) { + ?> + + + + + + + + + + + + + +
- - 保存设定 - - ID使用的推送地址每日推送时间类型下次推送日期修改删除
+ + 测试推送 + 返回顶部
+
- - - - - -
- - -
-
- - - - - - - - - - - - - - - - - - - - query("SELECT * FROM `" . DB_PREFIX . "weltolk_sign_qq_target` WHERE `uid` = " . UID); - while ($v = $m->fetch_array($x)) { - ?> - - - - - - - - - - - - - - -
ID使用的推送地址每日推送时间类型下次推送日期修改删除
- - 测试推送 - 返回顶部
-
- - - - - - - - -