|
|
@@ -730,6 +730,31 @@ class IssueService extends BaseService
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
+ // 封盘倒数
|
|
|
+ public static function syncCountdownIssue()
|
|
|
+ {
|
|
|
+ $now_date = date('Y-m-d H:i:s',time() + 50); // 提前50秒
|
|
|
+ $info = self::model()::where('status', self::model()::STATUS_BETTING)->orderBy('end_time','asc')->first();
|
|
|
+ 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->id)){
|
|
|
+ self::bettingGroupNotice($text, $buttons, $image);
|
|
|
+ Cache::put('issue_countdown_'.$info->id, true, 50); // 缓存50秒,防止多次发送
|
|
|
+ }else{}
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
// 停止下注
|
|
|
public static function syncCloseIssue()
|
|
|
{
|