|
|
@@ -31,12 +31,28 @@ class PcIssueService extends BaseService
|
|
|
|
|
|
private static function fengPan()
|
|
|
{
|
|
|
- $list = PcIssue::where('status', PcIssue::STATUS_BETTING)->get();
|
|
|
+ $list = PcIssue::where('status', PcIssue::STATUS_BETTING)
|
|
|
+ ->orderByDesc('id')
|
|
|
+ ->get();
|
|
|
$now = time();
|
|
|
- foreach ($list as $item) {
|
|
|
+ $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
|
|
|
+ $replyInfo = KeyboardService::findOne(['button' => '停止下注']);
|
|
|
+ if ($replyInfo) {
|
|
|
+ $text = $replyInfo->reply;
|
|
|
+ $buttons = json_decode($replyInfo->buttons, true);
|
|
|
+ $image = $replyInfo->image;
|
|
|
+ if ($image) {
|
|
|
+ $image = url($image);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach ($list as $index => $item) {
|
|
|
if (strtotime($item->end_time) - 30 <= $now) {
|
|
|
$item->status = PcIssue::STATUS_CLOSE;
|
|
|
$item->save();
|
|
|
+ if ($replyInfo && $pc28Switch == 1 && $index == 0) self::asyncBettingGroupNotice($text, $buttons, $image);
|
|
|
+ // 投注情况通知
|
|
|
+ if ($pc28Switch == 1 && $index == 0) BetService::statNotice($item->issue_no);
|
|
|
}
|
|
|
}
|
|
|
}
|