这个程序也是目前相对比较完整的一个项目,支持电脑版,和手机版,手机版是响应式的,网站采用了php+mysql开发实现的,也是目前比较主流的开发模式。
申明:这个项目代码,只是提供学习使用,不得用于其他用途,谢谢配合
前端时间帮朋友做了一个这样的程序,是湛江和海南那边的下单投注卖码的程序系统,经过差不多一个多月的时间,终于把这个项目完整的开发出来,接下来我给大家介绍一下,这些算法是怎么实现的和原理,希望可以帮到大家的学习,不要用来做其他事就可以。
手机版:
这个是快选
class fastchoocontroller extends homebacontroller {
protected $ur_model;
public function __construct() {
parent::__c女性尿道感染的症状onstruct();
$this->check_login();
$this->ur_model = m(“ur”);//打款凭证
}
public function index() {
$this->display();
}
public function tfastbeatitem(){
header(“content-type: application/json”);
if($this->ur[‘lock’]==1){
m(“ur”)->where(array(“id”=>$this->ur[“id”]))->save(array(‘lock’=>0));
$this->ejson(“操作太快,稍等下再来下注吧”);
}
if($this->ur[‘ur_status’]==2){
$this->ejson(‘禁止下注’);
}
m(“ur”)->where(array(“id”=>$this->ur[“id”]))->save(array(‘lock’=>1));
/* $_post[‘amount’]=1;
$_post[‘amountcount’]=4000;
$_post[‘bzxx’]=’三字定’;
$_post[‘data’]='{“b2″:[],”b3″:[],”b4″:[],”b5″:[],”b6″:[],”b7″:[],”b9”:[“111x”],”b10″:[],”b11″:[],”b12″:[],”b13″:[],”b14″:[],”b15″:[],”b16″:[],”b17″:[],”b18″:[]}’;*/
$zmmtime=time();
ob_start();
@t_time_limit(0);
@ini_t(“memory_limit”, “512m”);
$type=m(‘type’)->where(array(‘id’=>’1’))->find();
$now=getnow(‘1’,1);
$data[‘drawdt’]=$now[‘drawdt’];
$data[‘opendt’]=$now[‘opendt’];
if(time()<=strtotime($data[‘opendt’])){
$this->ejson(“下注失败”);
}
//获取上级帐户分批管理
for($i=$this->ur[“parent”];$i>0;$i){
$agent=m(‘agent’)->find($i);
$agentlist[$i]=$agent;
$agentts[$i]=json_decode($agent[“commission”],true);
$ff[]=$i;
$caopan[$i]=json_decode($agent[“caopantting”],true);
$i=$agent[“parent”];
}
$commissionodds=json_decode($agent[‘commissionodds’],true);
$periodsnumber=$now[“hm”];
$commission=json_decode($this->ur[“commission”],true);
$sjcommission=json_decode($this->ur[“sjcommission”],true);
$betnumber=json_decode($_post[“data”],true);
$ky_money=$this->ur[‘money’]-$this->ur[‘yymoney’];
if($ky_money<$_post[“amountcount”]){
$this->ejson(“信用额度不足”);
}
$money=0;
$data=array();
$bet=array();
$betxx=array();
$betlist=array();
$bet2=array();
$bet2xx=array();
$bet2list=array();
$betinfoid=time();
if($this->ur[“periodsnumber”]==$periodsnumber){
$xxx=file_get_contents(“storexx/”.md5($this->ur[“id”]).”text”);
$storexx=json_decode($xxx,true);
}
el{
$storexx=array();
}
$playlist=array();
$count=0;
$bet[“backcomm”]=0;
$bet[“count”]=0;
//查询数据库本期该类型已经下了多少钱的
$bet666[‘periodsnumber’] = $periodsnumber;
$bet666[‘betnumber’]=$value;
$bet666[‘sftm’]=0;
$sum666=m(‘urbet’.$this->ur[‘id’])->where($bet666)->sum(‘betamount’);
if($maxcount<($typemoney[$value]+$sum666+0) || $maxbet<$_post[“amount”]+$storexx[$result[‘number’]]+0){
$typemoney[$played[“id”]]=$typemoney[$played[“id”]]-$_post[“amount”];
$bet2[“betnumber”]=$value;
$bet2list[]=$bet2;
$isstopnum=55;
if(count($bet2list)==20){
m(“bet2”)->addall($bet2list);
$bet2list=array();
}
}
el{
unt($xiatiao);
//start
$bet4[‘betnumber’]=$bet3[‘betnumber’]=$value;
$bet4[‘bettypeid’]=$bet3[‘bettypeid’]=$i;
if(empty($bet3s[$value])){
$bet3[‘betamount’]=$_post[“amount”];
$save1[‘betamount’]=’0′;
$max_money=$_post[“amount”];
}el{
$bet3[‘betamount’]=$max_money=$save1[‘betamount’]=$bet3s[$value][‘betamount’]+$_post[“amount”];
}
//判断当前金额在哪个级别
foreach ($commissionodds[$bet3[‘bettypeid’]] as $kco => $vco) {
if(ist($vco)){
if($vco[‘is_u’]==1&&$vco[‘startamount’]<=$max_money&&$max_money<$vco[‘amountup’]){
$odds1=getodds2($vco[‘maxlimitsiglebet’],$bet4[‘betnumber’]);
$xiatiao=getodds1($played,$bet4[‘betnumber’])-$odds1;
}
}
}
$xiatiao=ist($xiatiao)?$xiatiao:0;
$odds=getodds($played,$this->ur,$value);
$odds=$odds-$xiatiao;
if($bet3[‘bettypeid’]!=16&&$bet3[‘bettypeid’]!=15&&$bet3[‘bettypeid’]!=14){
if(ist($bet3s[$value])){
$odds=$odds-$bet3s[$value][‘xiatiao’];
}
$bet3[odds]=$xiatiao;
$bet3[‘id’]爱心巧克力蛋糕=ist($bet3s[$value])?$bet3s[$value][‘id’]:0;
$bet5[]=$bet3;
}
//end
$bet[“backcomm”]=$bet[“backcomm”]+$backcomm;
$money=$money+$_post[“amount”];
$storexx[$value]=$storexx[$value]+$_post[“amount”]+0;
$add=array();
$add[“odds”]=$odds;
$add[“betnumber”]=$value;
$add[“playedid”]=$bet[“playedid”];
$add[“betinfoid”]=$bet[“betinfoid”];
$add[“betamount”]=$_p日本岛屿ost[“amount”];
$add[“backcomm”]=$backcomm;
$add[“profitandloss”]=$bet[“profitandloss”];
$add[“peri教师节写给老师的信odsnumber”]=$periodsnumber;
$add[“betdt”]=$bet[“betdt”];
$tongji[$played[“bettypeid”]][“betamount”]+=$_post[“amount”];
$tongji[$played[“bettypeid”]][“zjiang”]=0;
//$tongji[$played[“bettypeid”]][“backcomm”]+=$add[“backcomm”];
$tongji[$played[“bettypeid”]][“profitandloss”]=0;
$tongji[$played[“bettypeid”]][“count”]+=1;
//计算反水 占成
$pratio=$this->ur[‘ratio’];;
$pratios=100;
$mfsxx=array();
$mlhxx=array();
$ymoney=0;
$is_fs=0;
$agent[‘parent’]=$this->ur[‘parent’];
$commission1=json_decode($this->ur[‘commission’],true);
for($ii=$agent[‘parent’];$ii>0;$ii){
$agent=$agentlist[$ii];
$sjcommission1=$commission1;
$commission1=json_decode($agent[“commission”],true);
$fszc=$sjcommission1[$i][‘commission’]-$commission1[$i][‘commission’];
$fsmoney=$fszc*($add[‘betamount’]-$ymoney);
if($commission1[$i][‘maxlimitstore’]==0&&$agent[‘agent组织部挂职工作总结level’]!==1){
$pratio=0;
}
$lhmoney=$pratio*$add[‘betamount’]/100;
if($lhmoney<=0){
$lhmoney=0;
}
if($lhmoney+$ymoney>$add[‘betamount’]){
$lhmoney=$add[‘betamount’]-$ymoney;
}
//拦货 占成金额大于拦货金额的情况下拦货 $zlhmoney[$ii][$add[‘playedid’]]
if(($add[‘betamount’]*$pratio/100)>$commission1[$i][‘maxlimitstore’]){
if($zlhmoney[$ii][$add[‘betnumber’]]+$lhmoney>$commission1[$i][‘maxlimitstore’]){
$lhmoney=$commission1[$i][‘maxlimitstore’]-$zlhmoney[$ii][$add[‘betnumber’]];
}
}
//判断是谁回收 1代表大股东 0代表公司
if($agent[‘agentlevel’]==2&&$agent[‘is_fs’]==1){
$is_fs=1;
}
if($is_fs==0){
if($agent[‘agentlevel’]==1){
$lhmoney=$add[“betamount”]-$ymoney;
}
}el{
//还要去掉公司占成
if($agent[‘agentlevel’]==2){
$lhmoney=$add[“betamount”]-$ymoney-($agent[‘pratio’]*$add[‘betamount’]/100);
}
}
$ymoney+=$lhmoney;
//$agentmoney[$i]+=$lhmoney;
$mlhxx[$ii][‘money’]=$lhmoney;
$mlhxx[$ii][‘win’]=0;
$lhxx[$ii][‘money’]+=$lhmoney;
$lhxx[$ii][‘win’]=0;
$tongji[$played[“bettypeid”]][‘lhxx’][$ii][‘money’]=0;
$tongji[$played[“bettypeid”]][‘lhxx’][$ii][‘win’]=0;
$zlhmoney[$ii][$add[‘betnumber’]]+=$lhmoney;
if($fsmoney>0){
$mfsxx[$ii]=$fsmoney;
$fsxx[$ii]+=$fsmoney;
$tongji[$played[“bettypeid”]][‘fsxx’][$ii]=0;
//$agentmoney[$ii]+=$fsmoney;
}
$bet4[‘agentid’]=$ii;
if(empty($bet9s[$ii][$value])){
$bet4[‘lhmoney’]=$lhmoney;
$bet4[‘betamount’]=$add[‘betamount’];
}el{
$bet4[‘id’]=$bet9s[$ii][$value][‘id’];
$bet4[‘lhmoney’]=$lhmoney+$bet9s[$ii][$value][‘lhmoney’];
$bet4[‘betamount’]=$add[‘betamount’]+$bet9s[$ii][$value][‘betamount’];
}
$bet6[]=$bet4;
if($bet4[‘lhmoney’]>$caopan[$ii][$bet3[‘bettypeid’]]&&ist($caopan[$ii][$bet3[‘bettypeid’]])){
$bet991[‘money’]=$bet4[‘lhmoney’]-$caopan[$ii][$bet3[‘bettypeid’]];
$bet991[‘bettypeid’]=$bet4[‘bettypeid’];
$bet991[‘betnumber’]=$bet4[‘betnumber’];
$bet991[‘agentid’]=$bet4[‘agentid’];
$bet991[‘periodsnumber’]=$bet4[‘periodsnumber’];
if(!empty($bet99s[$ii][$value])){
$bet991[‘id’]=$bet99s[$ii][$value][‘id’];
}
$bet7[]=$bet991;
}
$ii=$agent[“parent”];
$pratio=$agent[‘pratio’];
$pratios=$pratios-$pratio;
if($agent[‘agentlevel’]==1){
$agent[“parent”]=0;
}
if($ymoney==$add[‘betamount’]){
$ii=0;
}
}
$add[‘lhxx’]=json_encode($mlhxx);
$add[‘fsxx’]=json_encode($mfsxx);
以上是这个快选这样的功能内容,下一章我这边讲都是,快驿功能,后面还有……
有什么不明白的,关于这个算法了解的,可以交流,我扣3053723033
本文发布于:2023-04-08 09:00:37,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/455d69838a2135d9ff79c401a4d7662a.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:七星彩网站源码.doc
本文 PDF 下载地址:七星彩网站源码.pdf
留言与评论(共有 0 条评论) |