这个是前端工夫帮敌人做的一个我的项目,海南那边的七星网站零碎 盘口开奖算法实现,当初分享进去给大家钻研钻研,心愿能够帮到一些敌人,有问题的能够加我 q:3523-657133
function bet3add($bet5){
$sql = "UPDATE jz\_bet3 SET BetAmount = CASE id";
$sql1= “Odds = CASE id “;
foreach ($bet5 as $key => $value) {
if($value[‘id’]){
$idss\[\]=$value[‘id’];
$sql.=sprintf(“WHEN %d THEN %2\\$.2f “,$value\[‘id’\],$value[‘BetAmount’]);
$sql1.=sprintf(“WHEN %d THEN %2\\$.2f “,$value\[‘id’\],$value[‘Odds’]);
$t=1;
}else{
$bet3add\[\]=$value;
}
}
$ids = implode(‘,’,$idss);
$sql .= “END,”.$sql1.”END WHERE id IN ($ids)”;
if(isset($bet3add)){
M(‘bet3’)->addAll($bet3add);
}
if($t==1){
M()->execute($sql);
}
}
function bet4add($bet6){
$sql = "UPDATE jz\_bet4 SET BetAmount = CASE id";
$sql1= “lhmoney = CASE id “;
foreach ($bet6 as $key => $value) {
if($value[‘id’]){
$idss\[\]=$value[‘id’];
$sql.=sprintf(“WHEN %d THEN %2\\$.2f “,$value\[‘id’\],$value[‘BetAmount’]);
$sql1.=sprintf(“WHEN %d THEN %2\\$.2f “,$value\[‘id’\],$value[‘lhmoney’]);
//$sql1.=sprintf(“WHEN %d THEN %2\\$.2f “,$value\[‘id’\],$value[‘Odds’]);
$t=1;
}else{
$bet4add\[\]=$value;
}
}
$ids = implode(‘,’,$idss);
$sql .= “END,”.$sql1.”END WHERE id IN ($ids)”;
if(isset($bet4add)){
M(‘bet4’)->addAll($bet4add);
}
if($t==1){
M()->execute($sql);
}
}
function bet5add($bet7){
$sql = "UPDATE jz\_bet5 SET money = CASE id";
//$sql1= “money = CASE id “;
foreach ($bet7 as $key => $value) {
if($value[‘id’]){
$idss\[\]=$value[‘id’];
$sql.=sprintf(“WHEN %d THEN %2\\$.2f “,$value\[‘id’\],$value[‘money’]);
//$sql1.=sprintf(“WHEN %d THEN %2\\$.2f “,$value\[‘id’\],$value[‘money’]);
//$sql1.=sprintf(“WHEN %d THEN %2\\$.2f “,$value\[‘id’\],$value[‘Odds’]);
$t=1;
}else{
$bet5add\[\]=$value;
}
}
$ids = implode(‘,’,$idss);
$sql .=”END WHERE id IN ($ids)”;
if(isset($bet5add)){
M(‘bet5’)->addAll($bet5add);
}
if($t==1){
M()->execute($sql);
}
}