最近忙公司的事,今天发布者几天修复了一些bug,和增加了一些功能,还有做了一个不错的模板。
1.交易明细功能
2.修复结算功能
3.支持千万级别数据开奖
4.修复下单速度
5.新增会员,代理模板
6.升级开奖期号功能,更简单
................
申明,本代码相关程序,只作为学习和研究使用,不得用于任何商业或者其他使用,因其产生其他问题,有使用者承担!
有什么问题可以直接Q我即可:3053723033
第一篇 :blog.csdn.net/weixin_...
第二篇 :blog.csdn.net/weixin_...
第三篇 :blog.csdn.net/weixin_...
第四篇:blog.csdn.net/weixin_...
第五篇:blog.csdn.net/weixin_...
增加了一个交易明细功能
这个是视图部分
<admintpl file="header" />
</head>
<body>
<div class="wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="#">交易明细</a></li>
</ul>
<form class="well form-search" method="post">
明细类型:
<select name="liqtype" class="bankSel cpKind userInput">
<option value="0" <if condition="$get[liqtype] eq 0">selected</if>>全部摘要</option>
<option value="1" <if condition="$get[liqtype] eq 1">selected</if>>充值入款</option>
<option value="3" <if condition="$get[liqtype] eq 3">selected</if>>提现扣款</option>
<option value="4" <if condition="$get[liqtype] eq 4">selected</if>>投注扣款</option>
<option value="5" <if condition="$get[liqtype] eq 5">selected</if>>投注返点</option>
<option value="2" <if condition="$get[liqtype] eq 2">selected</if>>奖金派送</option>
<option value="6" <if condition="$get[liqtype] eq 6">selected</if>>提现退回</option>
<option value="7" <if condition="$get[liqtype] eq 7">selected</if>>活动礼金</option>
<option value="8" <if condition="$get[liqtype] eq 8">selected</if>>追号停止</option>
<option value="9" <if condition="$get[liqtype] eq 9">selected</if>>误存提出</option>
<option value="11" <if condition="$get[liqtype] eq 11">selected</if>>人工存入</option>
<option value="12" <if condition="$get[liqtype] eq 12">selected</if>>其他优惠</option>
<option value="17" <if condition="$get[liqtype] eq 17">selected</if>>投注撤单</option>
<option value="30" <if condition="$get[liqtype] eq 30">selected</if>>代理明细</option>
</select>
会员账号:
<input type="text" name="user_login" style="width: 200px;" value="{$get.user_login}" placeholder="请输入会员账号">
时间:
<input type="text" name="start_time" class="js-datetime" value="{$get.start_time|default=''}" style="width: 120px;" autocomplete="off">-
<input type="text" class="js-datetime" name="end_time" value="{$get.end_time|default=''}" style="width: 120px;" autocomplete="off">
<input type="submit" class="btn btn-primary js-ajax-submit" value="搜索" />
</form>
<table class="table table-hover table-bordered table-list">
<thead>
<tr>
<th width="50">流水号</th>
<th>会员</th>
<th>时间</th>
<th>摘要</th>
<th>金额</th>
<th>余额</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<foreach name="record" item="vo">
<tr>
<td>{$vo.id}</td>
<td>{$vo.uid|user_login}</td>
<td>{$vo.actiontime|date='Y-m-d',###}</td>
<td>{$vo.liqtype|liqtype=###}</td>
<td>{$vo.coin}</td>
<td>{$vo.usercoin}</td>
<td>{$vo.info}</td>
</tr>
</foreach>
</tbody>
</table>
<div class="pagination">{$page}</div>
</div>
<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>
升级开奖期号
function gettime($time,$endtime){
//计算出本月所有的期数
for($i=$time;$i<$endtime;$i){
$da = date("w",$i);
if($da==0||$da==2||$da==5){
$qishu=getnows($i)['hm']+1;
$res['time'][$qishu]=date('Y-m-d',$i);
$res['qishu'][]=$qishu;
}
$i=$i+86400;
}
return $res;
}
function getnows($time){
$type=M('type')->where(array('id'=>'1'))->find();
$dataxx=M('data')->where(array('type'=>'1'))->order('time desc')->find();
$data['PeriodsStatus']=(int)$type['enable'];
$timelist=explode(',',$type[data]);
$days=$timelist[2];
$chunjie=$timelist[3];
$week = date('W',$time)*3-3;
$da = date("w",$time);
if((time()-$days*24*3600)<=$chunjie){
$num=$week;
}else{
$num=$week-3;
}
if($da==0||$da>5){
$num=$num+2;
}elseif($da<=2){
$num=$num;
}elseif($da<=5){
$num=$num+1;
}
if(($da==0||$da==2||$da==5)&&time()>=strtotime(date('Y-m-d 20:30:00'))){
$num=$num;
}
$hm=$num;
if($num<100){
$hm='0'.$hm;
}
if($num<10){
$hm='0'.$hm;
}
$result['hm']=$dataxx['number']+1;
//$result['hm']=date('y').$hm;
return $result;
}
function getnow($id,$dd=0){
$type=M('type')->where(array('id'=>'1'))->find();
$dataxx=M('data')->where(array('type'=>'1'))->order('time desc')->find();
$data['PeriodsStatus']=(int)$type['enable'];
$timelist=explode(',',$type['data']);
$days=$timelist[2];
$chunjie=$timelist[3];
$time=time();//strtotime(date('2018-05-31'))
$week = date('W',$time)*3-3;
$da = date("w",$time);
if((time()-$days*24*3600)<=strtotime($chunjie)){
$num=$week;
//exit(var_dump(strtotime($chunjie)));
}else{
$num=$week-3;
//exit(var_dump(strtotime($chunjie)));
}
if($da==0||$da>5){
$num=$num+2;
}elseif($da<=2){
$num=$num;
}elseif($da<=5){
$num=$num+1;
}
if(($da==0||$da==2||$da==5)&&time()>=strtotime(date('Y-m-d 20:30:00'))){
$num=$num+1;
}
$week1=date('Y-m-d',strtotime("-".($da?$da -1 : 6).' days'));
$week0=strtotime(date('Y-m-d 20:30:00',strtotime("$week1 +6 days")));
$weeks0=strtotime(date('Y-m-d 20:30:00',strtotime("$week1 -1 days")));//上周日
$week2=strtotime(date('Y-m-d 20:30:00',strtotime("$week1 +1 days")));
$weeks2=strtotime(date('Y-m-d 20:30:00',strtotime("$week1 +8 days")));//下周二
$week5=strtotime(date('Y-m-d 20:30:00',strtotime("$week1 +4 days")));
if(time()>=strtotime(date('Y-m-d 20:30:00'))){
if($da>=5){
$result['OpenDt']=$week5+$timelist[1];
$result['DrawDt']=$week5-$timelist[0];
$result['CloseDt']=$week0-$timelist[0];
}elseif($da>=2){
$result['OpenDt']=$week2+$timelist[1];
$result['DrawDt']=$week2-$timelist[0];
$result['CloseDt']=$week5-$timelist[0];
}elseif($da==0){
$result['OpenDt']=$week0+$timelist[1];
$result['DrawDt']=$week0-$timelist[0];
$result['CloseDt']=$weeks2-$timelist[0];
}elseif($da==1){
$result['OpenDt']=$weeks0+$timelist[1];
$result['DrawDt']=$weeks0-$timelist[0];
$result['CloseDt']=$week2-$timelist[0];
}
}else{
if($da==5){
$result['OpenDt']=$week2+$timelist[1];
$result['DrawDt']=$week2-$timelist[0];
$result['CloseDt']=$week5-$timelist[0];
}elseif($da==2){
$result['OpenDt']=$weeks0+$timelist[1];
$result['DrawDt']=$weeks0-$timelist[0];
$result['CloseDt']=$week2-$timelist[0];
}elseif($da==0){
$result['OpenDt']=$week5+$timelist[1];
$result['DrawDt']=$week5-$timelist[0];
$result['CloseDt']=$week0-$timelist[0];
}elseif($da>5){
$result['OpenDt']=$week5+$timelist[1];
$result['DrawDt']=$week5-$timelist[0];
$result['CloseDt']=$week0-$timelist[0];
}elseif($da>2){
$result['OpenDt']=$week2+$timelist[1];
$result['DrawDt']=$week2-$timelist[0];
$result['CloseDt']=$week5-$timelist[0];
}else{
$result['OpenDt']=$weeks0+$timelist[1];
$result['DrawDt']=$weeks0-$timelist[0];
$result['CloseDt']=$week2-$timelist[0];
}
}
$result['OpenDt']=date('Y-m-d H:i:s',$result['OpenDt']);
$result['DrawDt']=date('Y-m-d H:i:s',$result['DrawDt']);
$result['CloseDt']=date('Y-m-d H:i:s',$result['CloseDt']);
$hm=$num+$dd-3;
if($hm<100){
$hm='0'.$hm;
}
if($hm<10){
$hm='0'.$hm;
}
$result['now']=time();
$result['hm']=$dataxx['number']+1;
//$result['hm']=date('Y').$hm;
$result['day']=0;
return $result;
}
function storexx($id,$BetNumber,$PeriodsNumber){
$map2['uid']=$id;
$map2['BetNumber']=$BetNumber;
$map2['PeriodsNumber']=$PeriodsNumber;
$store=M('bets')->where($map2)->sum('BetAmount');
return $store+0;
}
function storexx2($id,$playid,$PeriodsNumber){
$map2['uid']=$id;
$map2['playedId']=$playid;
$map2['PeriodsNumber']=$PeriodsNumber;
$store=M('bets')->where($map2)->sum('BetAmount');
return $store+0;
}
function getodds2($played,$number=0){
$list=explode('/',$played);
if(count($list)==1){
$bonusprop=$list[0];
}
else{
$number=$number;
$nlist=str_split($number);
$c=array_count_values($nlist);
$cfnum=count($nlist)-count($c);
$bonusprop=$list[$cfnum];
$cbonusprop=$clist[$cfnum];
}
return (float)($bonusprop);
}
function getodds1($played,$number=0){
$list=explode('/',$played['bonusprop']);
if(count($list)==1){
$bonusprop=$list[0];
$cbonusprop=$clist[0];
}
else{
$number=$number;
$nlist=str_split($number);
$c=array_count_values($nlist);
$cfnum=count($nlist)-count($c);
$bonusprop=$list[$cfnum];
$cbonusprop=$clist[$cfnum];
}
return (float)($bonusprop);
}
function getodds($played,$user,$number=0){
$commission=json_decode($user['commission'],true);
$sjcommission=json_decode($user['sjcommission'],true);
$list=explode('/',$played['bonusprop']);
$clist=explode('/',$played['cbonusprop']);
if(count($list)==1){
$bonusprop=$list[0];
$cbonusprop=$clist[0];
}
else{
$number=$number;
$nlist=str_split($number);
$c=array_count_values($nlist);
$cfnum=count($nlist)-count($c);
$bonusprop=$list[$cfnum];
$cbonusprop=$clist[$cfnum];
}
return (float)($bonusprop-$cbonusprop*$sjcommission[$played['bettypeid']]['Commission']);
}
function getoddsup($played,$user,$number=0){
$commission=json_decode($user['commission'],true);
$sjcommission=json_decode($user['sjcommission'],true);
$list=explode('/',$played['bonusprop']);
$clist=explode('/',$played['cbonusprop']);
if(count($list)==1){
$bonusprop=$list[0];
$cbonusprop=$clist[0];
}
else{
$number=$number;
$nlist=str_split($number);
$c=array_count_values($nlist);
$cfnum=count($nlist)-count($c);
$bonusprop=$list[$cfnum];
$cbonusprop=$clist[$cfnum];
}
return (float)($cbonusprop*$sjcommission[$played['bettypeid']]['Commission']);
}
新增会员模板
新增代理部分