|
|
@@ -3,6 +3,7 @@
|
|
|
|
|
|
namespace App\Services;
|
|
|
|
|
|
+use App\Models\Prediction;
|
|
|
use App\Services\BaseService;
|
|
|
use App\Models\Issue;
|
|
|
use App\Models\Config;
|
|
|
@@ -255,6 +256,13 @@ class IssueService extends BaseService
|
|
|
$info->image = $recordImage;
|
|
|
$info->save();
|
|
|
|
|
|
+ $size = in_array("大", $awards);
|
|
|
+ $size = $size ? "大" : "小";
|
|
|
+ $oddOrEven = in_array("双", $awards);
|
|
|
+ $oddOrEven = $oddOrEven ? "双" : "单";
|
|
|
+ Prediction::result($info->issue_no, $size, $oddOrEven, $info->winning_numbers);
|
|
|
+
|
|
|
+
|
|
|
$replyInfo = KeyboardService::findOne(['button' => '本期开奖']);
|
|
|
if ($replyInfo) {
|
|
|
$text = $replyInfo->reply;
|
|
|
@@ -272,12 +280,12 @@ class IssueService extends BaseService
|
|
|
|
|
|
}
|
|
|
// self::bettingGroupNotice($text, $buttons, $image, true);
|
|
|
- SendTelegramGroupMessageJob::dispatch($text,$buttons,$image,true);
|
|
|
+ SendTelegramGroupMessageJob::dispatch($text, $buttons, $image, true);
|
|
|
}
|
|
|
$recordImage = self::lotteryImage($info->issue_no);
|
|
|
if ($recordImage) {
|
|
|
// self::bettingGroupNotice('', [], url($recordImage));
|
|
|
- SendTelegramGroupMessageJob::dispatch('',[],url($recordImage),false);
|
|
|
+ SendTelegramGroupMessageJob::dispatch('', [], url($recordImage), false);
|
|
|
}
|
|
|
|
|
|
BetService::betSettled($info->issue_no, $awards);
|
|
|
@@ -754,17 +762,17 @@ class IssueService extends BaseService
|
|
|
|
|
|
$key = 'lottery_numbers_' . $v->issue_no;
|
|
|
$combo = implode(' ', $combo);
|
|
|
- if(Cache::add($key, $winning_numbers, 100)){
|
|
|
+ if (Cache::add($key, $winning_numbers, 100)) {
|
|
|
self::lotteryDraw($v->id, $winning_numbers, $combo, '');
|
|
|
$new = false;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// sleep(5); // 等待开奖完成
|
|
|
|
|
|
- if($new){
|
|
|
+ if ($new) {
|
|
|
$latestIssue = $list[0]; // 最后开奖
|
|
|
|
|
|
$new_issue_no = $latestIssue['lotNumber'] + 1; // 新期号
|
|
|
@@ -781,6 +789,9 @@ class IssueService extends BaseService
|
|
|
'end_time' => $endTime,
|
|
|
]);
|
|
|
|
|
|
+
|
|
|
+ Prediction::prediction($new_issue_no);
|
|
|
+
|
|
|
$id = $res['key'] ?? 0;
|
|
|
if ($id) {
|
|
|
self::betting($id); // 开始下注
|
|
|
@@ -789,11 +800,10 @@ class IssueService extends BaseService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
+
|
|
|
// 获取最新的开奖数据
|
|
|
public static function getLatestIssue2()
|
|
|
{
|
|
|
@@ -870,7 +880,7 @@ class IssueService extends BaseService
|
|
|
|
|
|
$combo = implode(' ', $combo);
|
|
|
self::lotteryDraw($v->id, $winning_numbers, $combo, '');
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -970,7 +980,7 @@ class IssueService extends BaseService
|
|
|
{
|
|
|
|
|
|
$recordImage = self::lotteryImage($issueNo);
|
|
|
- self::sendMessage($chatId,'',[], url($recordImage));
|
|
|
- // dispatch(new SendTelegramMessageJob('', [], url($recordImage)));
|
|
|
+ self::sendMessage($chatId, '', [], url($recordImage));
|
|
|
+ // dispatch(new SendTelegramMessageJob('', [], url($recordImage)));
|
|
|
}
|
|
|
}
|