最新版海南七星排列网站源码快选日志功能开发
这个是海南七星排列网站源码结算功能开发,我把代码直接上去吧。
有疑问的可以找我,我q:3053723033
此功能只做为学习和研究使用,不得用于其他用途,谢谢。
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);
}
}
function parentxx($id){
$parent=M('agent')->find($id);
if($parent){
return $parent['user_login'].'('.levelxx($parent['agentlevel']).')';
}
else{
return '无';
}
}
function levelxx($id){
$level=M('agent_level')->where(array('level'=>$id))->find();
return $level['title'];
}
function getqihao($id,$time=0){
$type=M('type')->where(array('id'=>'1'))->find();
$data['PeriodsStatus']=(int)$type['enable'];
$timelist=explode(',', $type[data]);
$num=1;
$day=0;
foreach ($timelist as $key => $value) {
if(time()>strtotime(date('Y-m-d '.$value,time()))-$time){
$num=$key+2;
}
}
if($num>count($timelist)){
$day=1;
$num=1;
}
$hm=$num;
if($num<100){
$hm='0'.$hm;
}
if($num<10){
$hm='0'.$hm;
}
$result['now']=$timelist[$num-1];
$result['hm']=$hm+$time;
$result['day']=$day;
return $result;
}