|
@@ -19,6 +19,8 @@ class PcIssueService extends BaseService
|
|
|
|
|
|
|
|
public static function index(): void
|
|
public static function index(): void
|
|
|
{
|
|
{
|
|
|
|
|
+ //封盘倒数
|
|
|
|
|
+ PcIssueService::syncCountdownIssue();
|
|
|
//创建新的期号
|
|
//创建新的期号
|
|
|
PcIssueService::createIssueNo();
|
|
PcIssueService::createIssueNo();
|
|
|
//对该封盘的进行封盘
|
|
//对该封盘的进行封盘
|
|
@@ -29,6 +31,36 @@ class PcIssueService extends BaseService
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //封盘倒数
|
|
|
|
|
+ public static function syncCountdownIssue()
|
|
|
|
|
+ {
|
|
|
|
|
+ $info = PcIssue::where('status', PcIssue::STATUS_BETTING)->orderBy('end_time')->first();
|
|
|
|
|
+ if ($info) {
|
|
|
|
|
+ $now_date = date('Y-m-d H:i:s', time() + 60); // 提前60秒
|
|
|
|
|
+ if ($info['end_time'] < $now_date) {
|
|
|
|
|
+ $replyInfo = KeyboardService::findOne(['button' => '封盘倒数']);
|
|
|
|
|
+ if ($replyInfo) {
|
|
|
|
|
+ $text = $replyInfo->reply;
|
|
|
|
|
+ $buttons = json_decode($replyInfo->buttons, true);
|
|
|
|
|
+ $image = $replyInfo->image;
|
|
|
|
|
+ if ($image) {
|
|
|
|
|
+ $image = url($image);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Cache::has('issue_countdown_' . $info->issue_no)) {
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
|
|
|
|
|
+ if ($pc28Switch == 1) {
|
|
|
|
|
+ self::asyncBettingGroupNotice($text, $buttons, $image);
|
|
|
|
|
+ Cache::put('issue_countdown_' . $info->issue_no, true, 60); // 缓存50秒,防止多次发送
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private static function fengPan()
|
|
private static function fengPan()
|
|
|
{
|
|
{
|
|
|
$list = PcIssue::where('status', PcIssue::STATUS_BETTING)
|
|
$list = PcIssue::where('status', PcIssue::STATUS_BETTING)
|
|
@@ -256,7 +288,7 @@ class PcIssueService extends BaseService
|
|
|
$new_str = "P" . $number;
|
|
$new_str = "P" . $number;
|
|
|
$end_time = strtotime($issue->end_time) + 210;
|
|
$end_time = strtotime($issue->end_time) + 210;
|
|
|
$status = $end_time - 30 > $now ? PcIssue::STATUS_BETTING : PcIssue::STATUS_CLOSE;
|
|
$status = $end_time - 30 > $now ? PcIssue::STATUS_BETTING : PcIssue::STATUS_CLOSE;
|
|
|
- $issue = PcIssue::create([
|
|
|
|
|
|
|
+ $issue1 = PcIssue::create([
|
|
|
'issue_no' => $new_str,
|
|
'issue_no' => $new_str,
|
|
|
'status' => $status,
|
|
'status' => $status,
|
|
|
'start_time' => $issue->end_time,
|
|
'start_time' => $issue->end_time,
|
|
@@ -264,7 +296,7 @@ class PcIssueService extends BaseService
|
|
|
]);
|
|
]);
|
|
|
//预测
|
|
//预测
|
|
|
PcPrediction::prediction($new_str);
|
|
PcPrediction::prediction($new_str);
|
|
|
- if (strtotime($issue->end_time) <= $now) {
|
|
|
|
|
|
|
+ if (strtotime($issue1->end_time) <= $now) {
|
|
|
static::createIssueNo();
|
|
static::createIssueNo();
|
|
|
} else {
|
|
} else {
|
|
|
// 群通知,发送玩法规则和开始下注的通知
|
|
// 群通知,发送玩法规则和开始下注的通知
|