init: 从宝塔同步到 Gitea

This commit is contained in:
root
2026-02-25 01:50:31 +08:00
commit e633c8e27d
2444 changed files with 399341 additions and 0 deletions
+177
View File
@@ -0,0 +1,177 @@
<?php
namespace Waybill;
class WaybillDice{
/**
* 露珠生成
* @param $ns
* @return array
*/
public static function createWaybill($ns){
/**************************** 计算 showRoad start ***************************/
$showRoadLocation = array();
foreach($ns as $v){
$strArray = explode(",", $v['dice_result']);
$intArray = array();
foreach ($strArray as $value){
$intArray[] = intval($value);
}
$showRoadLocation[] = $intArray;
}
/**************************** 计算 showRoad end ***************************/
/**************************** 计算 bigRoadBS start ***************************/
//列
$yKey = 0;
//行
$xKey = 0;
$bigRoadBS = array();
foreach($ns AS $key => $value) {
$value['result'] = self::resultParseBS($value['dice_result']);
$ns[$key] = $value;
}
foreach($ns AS $key => $value){
$bigRoadBS[$yKey][$xKey] = array('result' => $value['result']);
if(isset($ns[$key+1]) && $ns[$key+1]['result'] != $bigRoadBS[$yKey][$xKey]['result']){
$yKey++;
$xKey = 0;
}else{
$xKey++;
}
}
//重新计算坐标
$bigRoadBSLocation = array();
$occupy = array();
foreach($bigRoadBS AS $key => $value){
$swerve = false;
$swerveY = $key;
foreach($value AS $k => $v){
$show_y = $key;
$show_x = $k;
if($show_x > 5 && $swerve === false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = 5;
$occupy[] = $show_y . '-' . $show_x;
}elseif(in_array($show_y.'-'.$show_x,$occupy)){
if($swerve === false){
$swerve = $show_x - 1;
}
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}elseif($swerve !== false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}
$pushArray = array('show_x' => $show_y+1, 'show_y' => $show_x+1, 'result' => $v['result']);
$bigRoadBSLocation[] = $pushArray;
}
}
/**************************** 计算 bigRoadBS end ***************************/
/**************************** 计算 bigRoadSP start ***************************/
//列
$yKey = 0;
//行
$xKey = 0;
$bigRoadSP = array();
foreach($ns AS $key => $value) {
$value['result'] = self::resultParseSP($value['dice_result']);
$ns[$key] = $value;
}
foreach($ns AS $key => $value){
$bigRoadSP[$yKey][$xKey] = array('result' => $value['result']);
if(isset($ns[$key+1]) && $ns[$key+1]['result'] != $bigRoadSP[$yKey][$xKey]['result']){
$yKey++;
$xKey = 0;
}else{
$xKey++;
}
}
//重新计算坐标
$bigRoadSPLocation = array();
$occupy = array();
foreach($bigRoadSP AS $key => $value){
$swerve = false;
$swerveY = $key;
foreach($value AS $k => $v){
$show_y = $key;
$show_x = $k;
if($show_x > 5 && $swerve === false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = 5;
$occupy[] = $show_y . '-' . $show_x;
}elseif(in_array($show_y.'-'.$show_x,$occupy)){
if($swerve === false){
$swerve = $show_x - 1;
}
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}elseif($swerve !== false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}
$pushArray = array('show_x' => $show_y+1, 'show_y' => $show_x+1, 'result' => $v['result']);
$bigRoadSPLocation[] = $pushArray;
}
}
/**************************** 计算 bigRoadSP end ***************************/
$data = array();
$data['showRoad'] = $showRoadLocation;
$data['bigRoadBS'] = $bigRoadBSLocation;
$data['bigRoadSP'] = $bigRoadSPLocation;
return (['status'=>true, 'msg'=>'数据存在', 'waybill'=>$data]);
}
// 结果分析(大小)
public static function resultParseBS($resultString){
$resultArray = explode(",", $resultString);
$intResultArray = [];
foreach ($resultArray as $v){
$intResultArray[] = intval($v);
}
$total = array_sum($intResultArray);
// 判断是不是全部值都是一样的
$uniqueArray = array_unique($intResultArray);
if (count($uniqueArray) == 1) {
return 3;
} else {
if ($total >= 4 && $total <= 10) {
return 2;
} else {
return 1;
}
}
}
// 结果分析(单双)
public static function resultParseSP($resultString){
$resultArray = explode(",", $resultString);
$intResultArray = [];
foreach ($resultArray as $v){
$intResultArray[] = intval($v);
}
$total = array_sum($intResultArray);
// 判断是不是全部值都是一样的
$uniqueArray = array_unique($intResultArray);
if (count($uniqueArray) == 1) {
return 3;
} else {
if ($total % 2 == 0) {
return 1;
} else {
return 2;
}
}
}
}
+226
View File
@@ -0,0 +1,226 @@
<?php
namespace Waybill;
class WaybillRoulette{
/**
* 色碟露珠生成
* @param $ns
* @return array
*/
public static function createWaybill($ns){
/**************************** 计算 showRoad start ***************************/
$showRoad = array_chunk($ns,6);
$showRoadLocation = array();
foreach($showRoad as $k => $v){
foreach($v as $key => $val){
$pushData = array('show_x' => $k + 1, 'show_y' =>$key + 1, 'result' => $val['roulette_result']);
$showRoadLocation[] = $pushData;
}
}
/**************************** 计算 showRoad end ***************************/
/**************************** 计算 bigRoadBS start ***************************/
//列
$yKey = 0;
//行
$xKey = 0;
$bigRoadBS = array();
foreach($ns AS $key => $value) {
$value['result'] = self::resultParseBS($value['roulette_result']);
$ns[$key] = $value;
}
foreach($ns AS $key => $value){
$bigRoadBS[$yKey][$xKey] = array('result' => $value['result']);
if(isset($ns[$key+1]) && $ns[$key+1]['result'] != $bigRoadBS[$yKey][$xKey]['result']){
$yKey++;
$xKey = 0;
}else{
$xKey++;
}
}
//重新计算坐标
$bigRoadBSLocation = array();
$occupy = array();
foreach($bigRoadBS AS $key => $value){
$swerve = false;
$swerveY = $key;
foreach($value AS $k => $v){
$show_y = $key;
$show_x = $k;
if($show_x > 5 && $swerve === false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = 5;
$occupy[] = $show_y . '-' . $show_x;
}elseif(in_array($show_y.'-'.$show_x,$occupy)){
if($swerve === false){
$swerve = $show_x - 1;
}
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}elseif($swerve !== false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}
$pushArray = array('show_x' => $show_y+1, 'show_y' => $show_x+1, 'result' => $v['result']);
$bigRoadBSLocation[] = $pushArray;
}
}
/**************************** 计算 bigRoadBS end ***************************/
/**************************** 计算 bigRoadSP start ***************************/
//列
$yKey = 0;
//行
$xKey = 0;
$bigRoadSP = array();
foreach($ns AS $key => $value) {
$value['result'] = self::resultParseSP($value['roulette_result']);
$ns[$key] = $value;
}
foreach($ns AS $key => $value){
$bigRoadSP[$yKey][$xKey] = array('result' => $value['result']);
if(isset($ns[$key+1]) && $ns[$key+1]['result'] != $bigRoadSP[$yKey][$xKey]['result']){
$yKey++;
$xKey = 0;
}else{
$xKey++;
}
}
//重新计算坐标
$bigRoadSPLocation = array();
$occupy = array();
foreach($bigRoadSP AS $key => $value){
$swerve = false;
$swerveY = $key;
foreach($value AS $k => $v){
$show_y = $key;
$show_x = $k;
if($show_x > 5 && $swerve === false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = 5;
$occupy[] = $show_y . '-' . $show_x;
}elseif(in_array($show_y.'-'.$show_x,$occupy)){
if($swerve === false){
$swerve = $show_x - 1;
}
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}elseif($swerve !== false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}
$pushArray = array('show_x' => $show_y+1, 'show_y' => $show_x+1, 'result' => $v['result']);
$bigRoadSPLocation[] = $pushArray;
}
}
/**************************** 计算 bigRoadSP end ***************************/
/**************************** 计算 bigRoadRB start ***************************/
//列
$yKey = 0;
//行
$xKey = 0;
$bigRoadRB = array();
foreach($ns AS $key => $value) {
$value['result'] = self::resultParseRB($value['roulette_result']);
$ns[$key] = $value;
}
foreach($ns AS $key => $value){
$bigRoadRB[$yKey][$xKey] = array('result' => $value['result']);
if(isset($ns[$key+1]) && $ns[$key+1]['result'] != $bigRoadRB[$yKey][$xKey]['result']){
$yKey++;
$xKey = 0;
}else{
$xKey++;
}
}
//重新计算坐标
$bigRoadRBLocation = array();
$occupy = array();
foreach($bigRoadRB AS $key => $value){
$swerve = false;
$swerveY = $key;
foreach($value AS $k => $v){
$show_y = $key;
$show_x = $k;
if($show_x > 5 && $swerve === false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = 5;
$occupy[] = $show_y . '-' . $show_x;
}elseif(in_array($show_y.'-'.$show_x,$occupy)){
if($swerve === false){
$swerve = $show_x - 1;
}
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}elseif($swerve !== false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}
$pushArray = array('show_x' => $show_y+1, 'show_y' => $show_x+1, 'result' => $v['result']);
$bigRoadRBLocation[] = $pushArray;
}
}
/**************************** 计算 bigRoadRB end ***************************/
$data = array();
$data['showRoad'] = $showRoadLocation;
$data['bigRoadBS'] = $bigRoadBSLocation;
$data['bigRoadSP'] = $bigRoadSPLocation;
$data['bigRoadRB'] = $bigRoadRBLocation;
return (['status'=>true, 'msg'=>'数据存在', 'waybill'=>$data]);
}
// 结果分析(大小)
public static function resultParseBS($result){
if($result == 0) {
return 3;
} else {
if($result >= 1 && $result <= 18) {
return 2;
} else {
return 1;
}
}
}
// 结果分析(单双)
public static function resultParseSP($result){
if($result == 0) {
return 3;
} else {
if ($result % 2 == 0) {
return 1;
} else {
return 2;
}
}
}
// 结果分析(红黑)
public static function resultParseRB($result){
if($result == 0) {
return 3;
} else {
if(in_array($result,[1,3,5,7,9,12,14,16,18,19,21,23,25,27,30,32,34,36])){
return 1;
} else {
return 2;
}
}
}
}
+219
View File
@@ -0,0 +1,219 @@
<?php
namespace Waybill;
class WaybillToning{
/**
* 色碟露珠生成
* @param $ns
* @return array
*/
public static function createWaybill($ns){
/**************************** 计算 showRoad start ***************************/
$showRoad = array_chunk($ns,6);
$showRoadLocation = array();
foreach($showRoad as $k => $v){
foreach($v as $key => $val){
$pushData = array('show_x' => $k + 1, 'show_y' =>$key + 1, 'result' => $val['toning_result']);
$showRoadLocation[] = $pushData;
}
}
/**************************** 计算 showRoad end ***************************/
/**************************** 计算 bigRoad start ***************************/
//列
$yKey = 0;
//行
$xKey = 0;
$bigRoad = array();
foreach($ns AS $key => $value){
$bigRoad[$yKey][$xKey] = array('result' => $value['toning_result']);
if(isset($ns[$key+1]) && $ns[$key+1]['toning_result'] != $bigRoad[$yKey][$xKey]['result']){
$yKey++;
$xKey = 0;
}else{
$xKey++;
}
}
//重新计算坐标
$bigRoadLocation = array();
$occupy = array();
foreach($bigRoad AS $key => $value){
$swerve = false;
$swerveY = $key;
foreach($value AS $k => $v){
$show_y = $key;
$show_x = $k;
if($show_x > 5 && $swerve === false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = 5;
$occupy[] = $show_y . '-' . $show_x;
}elseif(in_array($show_y.'-'.$show_x,$occupy)){
if($swerve === false){
$swerve = $show_x - 1;
}
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}elseif($swerve !== false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}
$pushArray = array('show_x' => $show_y+1, 'show_y' => $show_x+1, 'result' => $v['result']);
$bigRoadLocation[] = $pushArray;
}
}
/**************************** 计算 bigRoad end ***************************/
/**************************** 计算 bigRoadBS start ***************************/
//列
$yKey = 0;
//行
$xKey = 0;
$last = array();
$bigRoadBS = array();
foreach($ns AS $key => $value) {
if ($value['toning_result'] < 2) {
$value['result'] = 2;
} elseif ($value['toning_result'] > 2) {
$value['result'] = 1;
} else {
$value['result'] = 3;
}
$ns[$key] = $value;
}
foreach($ns AS $key => $value){
if($key == 0 && $value['result'] == 3){
$bigRoadBS[$yKey][$xKey] = array('result' => 3, 'tie_num' => 1);
$last = array('yKey' => $yKey, 'xKey' => $xKey);
}elseif($yKey == 0 && $xKey == 0 && !empty($last) && $value['result'] != 3){
$bigRoadBS[$last['yKey']][$last['xKey']]['result'] = $value['result'];
if(isset($ns[$key+1]) && $ns[$key+1]['result'] != $bigRoadBS[$last['yKey']][$last['xKey']]['result'] && $ns[$key+1]['result'] != 3){
$yKey++;
$xKey = 0;
}elseif(isset($ns[$key+1]) && $ns[$key+1]['result'] == $bigRoadBS[$last['yKey']][$last['xKey']]['result'] && $ns[$key+1]['result'] != 3){
$xKey++;
}
$last = array('yKey' => $yKey, 'xKey' => $xKey);
}elseif($key > 0 && $value['result'] == 3){
$bigRoadBS[$last['yKey']][$last['xKey']]['tie_num'] = $bigRoadBS[$last['yKey']][$last['xKey']]['tie_num'] + 1;
if(isset($ns[$key+1]) && $ns[$key+1]['result'] != $bigRoadBS[$last['yKey']][$last['xKey']]['result'] && $ns[$key+1]['result'] != 3 && $bigRoadBS[$last['yKey']][$last['xKey']]['result'] != 3){
$yKey++;
$xKey = 0;
}elseif(isset($ns[$key+1]) && $ns[$key+1]['result'] == $bigRoadBS[$last['yKey']][$last['xKey']]['result'] && $ns[$key+1]['result'] != 3 && $bigRoadBS[$last['yKey']][$last['xKey']]['result'] != 3){
$xKey++;
}
$last = array('yKey' => $last['yKey'], 'xKey' => $last['xKey']);
}else{
$bigRoadBS[$yKey][$xKey] = array('result' => $value['result'], 'tie_num' => 0);
if(isset($ns[$key+1]) && $ns[$key+1]['result'] != $bigRoadBS[$yKey][$xKey]['result'] && $ns[$key+1]['result'] != 3){
$yKey++;
$xKey = 0;
}elseif(isset($ns[$key+1]) && $ns[$key+1]['result'] == $bigRoadBS[$yKey][$xKey]['result'] && $ns[$key+1]['result'] != 3){
$xKey++;
}
$last = array('yKey' => $yKey, 'xKey' => $xKey);
}
}
//重新计算坐标
$bigRoadBSLocation = array();
$occupy = array();
foreach($bigRoadBS AS $key => $value){
$swerve = false;
$swerveY = $key;
foreach($value AS $k => $v){
$show_y = $key;
$show_x = $k;
if($show_x > 5 && $swerve === false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = 5;
$occupy[] = $show_y . '-' . $show_x;
}elseif(in_array($show_y.'-'.$show_x,$occupy)){
if($swerve === false){
$swerve = $show_x - 1;
}
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}elseif($swerve !== false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}
$pushArray = array('show_x' => $show_y+1, 'show_y' => $show_x+1, 'result' => $v['result'], 'tie_num' => $v['tie_num']);
$bigRoadBSLocation[] = $pushArray;
}
}
/**************************** 计算 bigRoadBS end ***************************/
/**************************** 计算 bigRoadSP start ***************************/
//列
$yKey = 0;
//行
$xKey = 0;
$bigRoadSP = array();
foreach($ns AS $key => $value) {
if ($value['toning_result'] == 1 || $value['toning_result'] == 3) {
$value['result'] = 2;
} else {
$value['result'] = 1;
}
$ns[$key] = $value;
}
foreach($ns AS $key => $value){
$bigRoadSP[$yKey][$xKey] = array('result' => $value['result']);
if(isset($ns[$key+1]) && $ns[$key+1]['result'] != $bigRoadSP[$yKey][$xKey]['result']){
$yKey++;
$xKey = 0;
}else{
$xKey++;
}
}
//重新计算坐标
$bigRoadSPLocation = array();
$occupy = array();
foreach($bigRoadSP AS $key => $value){
$swerve = false;
$swerveY = $key;
foreach($value AS $k => $v){
$show_y = $key;
$show_x = $k;
if($show_x > 5 && $swerve === false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = 5;
$occupy[] = $show_y . '-' . $show_x;
}elseif(in_array($show_y.'-'.$show_x,$occupy)){
if($swerve === false){
$swerve = $show_x - 1;
}
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}elseif($swerve !== false){
$swerveY = $swerveY + 1;
$show_y = $swerveY;
$show_x = $swerve;
$occupy[] = $show_y . '-' . $show_x;
}
$pushArray = array('show_x' => $show_y+1, 'show_y' => $show_x+1, 'result' => $v['result']);
$bigRoadSPLocation[] = $pushArray;
}
}
/**************************** 计算 bigRoadSP end ***************************/
$data = array();
$data['showRoad'] = $showRoadLocation;
$data['bigRoad'] = $bigRoadLocation;
$data['bigRoadBS'] = $bigRoadBSLocation;
$data['bigRoadSP'] = $bigRoadSPLocation;
return (['status'=>true, 'msg'=>'数据存在', 'waybill'=>$data]);
}
}