|
@@ -789,6 +789,89 @@ class IssueService extends BaseService
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ return $result;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 获取最新的开奖数据
|
|
|
|
|
+ public static function getLatestIssue2()
|
|
|
|
|
+ {
|
|
|
|
|
+ $url = "https://ydpc28.co/api/pc28/list";
|
|
|
|
|
+ $result = file_get_contents($url);
|
|
|
|
|
+ $result = json_decode($result, true);
|
|
|
|
|
+ if ($result['errorCode'] != 0) {
|
|
|
|
|
+ return ['code' => self::NOT, 'msg' => '获取最新期号失败'];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ $nextDrawInfo = $result['data']['nextDrawInfo'];
|
|
|
|
|
+ $startTime = $nextDrawInfo['currentBJTime'];
|
|
|
|
|
+ // if($nextDrawInfo['nextDrawTime'] >= date('H:i:s')) {
|
|
|
|
|
+ // $endTime = date('Y-m-d').' '.$nextDrawInfo['nextDrawTime']; // 下一期的截止时间
|
|
|
|
|
+ // }else{
|
|
|
|
|
+ // $endTime = date('Y-m-d',strtotime('+1 day')).' '.$nextDrawInfo['nextDrawTime']; // 下一期的截止时间
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ $endTime = date('Y-m-d H:i:s', strtotime($startTime) + 210);
|
|
|
|
|
+
|
|
|
|
|
+ $new = true;
|
|
|
|
|
+
|
|
|
|
|
+ $list = $result['data']['list'];
|
|
|
|
|
+ $listKey = [];
|
|
|
|
|
+ foreach ($list as $k => $v) {
|
|
|
|
|
+ $listKey[$v['lotNumber']] = $v;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $oldList = self::findAll(['status' => self::model()::STATUS_CLOSE]); // 获取所有封盘的期号
|
|
|
|
|
+ foreach ($oldList as $k => $v) {
|
|
|
|
|
+ if (isset($listKey[$v->issue_no])) {
|
|
|
|
|
+ $issue = $listKey[$v->issue_no];
|
|
|
|
|
+ $winning_numbers = implode(',', str_split((string)$issue['openCode']));
|
|
|
|
|
+
|
|
|
|
|
+ $winArr = array_map('intval', explode(',', $winning_numbers));
|
|
|
|
|
+
|
|
|
|
|
+ // 组合
|
|
|
|
|
+ $sum = array_sum($winArr);
|
|
|
|
|
+
|
|
|
|
|
+ $combo = [];
|
|
|
|
|
+
|
|
|
|
|
+ $sumOddEven = self::calculateOddEven($sum); // 总和单双
|
|
|
|
|
+ $combo[] = $sumOddEven;
|
|
|
|
|
+
|
|
|
|
|
+ $sumSize = self::calculateSumSize($sum); // 总和大小
|
|
|
|
|
+ $combo[] = $sumSize;
|
|
|
|
|
+
|
|
|
|
|
+ $sumExtremeSize = self::calculateSumExtremeSize($sum); // 总和极值
|
|
|
|
|
+ if ($sumExtremeSize) {
|
|
|
|
|
+ $combo[] = $sumExtremeSize;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ $sumBaoZi = self::isBaoZi($winArr[0], $winArr[1], $winArr[2]); // 豹子
|
|
|
|
|
+ if ($sumBaoZi) {
|
|
|
|
|
+ $combo[] = $sumBaoZi;
|
|
|
|
|
+ }
|
|
|
|
|
+ $sumPair = self::isPair($winArr[0], $winArr[1], $winArr[2]); // 对子
|
|
|
|
|
+ if ($sumPair) {
|
|
|
|
|
+ $combo[] = $sumPair;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $sumStraight = self::isStraight($winArr[0], $winArr[1], $winArr[2]); // 顺子
|
|
|
|
|
+ if ($sumStraight) {
|
|
|
|
|
+ $combo[] = $sumStraight;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $tail = self::getLastDigit($sum); // 总和尾数
|
|
|
|
|
+ if ($tail == 0 || $tail == 9) {
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $combo[] = '尾' . $tail; // 尾数
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $combo = implode(' ', $combo);
|
|
|
|
|
+ self::lotteryDraw($v->id, $winning_numbers, $combo, '');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
return $result;
|
|
return $result;
|
|
|
}
|
|
}
|
|
|
|
|
|