Commit 8d792053 by 冷斌

update

parent c1a8bcac
...@@ -816,13 +816,15 @@ class Model_Live extends PhalApi_Model_NotORM { ...@@ -816,13 +816,15 @@ class Model_Live extends PhalApi_Model_NotORM {
/* 有中奖配置 才处理 */ /* 有中奖配置 才处理 */
if($list){ if($list){
$rateinfo=[]; $rateinfo=[];
$rateArray = [];
foreach($list as $k=>$v){ foreach($list as $k=>$v){
// if($v['giftid']==$giftid && $v['nums']==$giftcount){ // if($v['giftid']==$giftid && $v['nums']==$giftcount){
// $rateinfo[]=$v; // $rateinfo[]=$v;
// } // }
if($v['giftid']==$giftid){ if($v['giftid']==$giftid){
$rr = floor($v['rate']*1000); $rr = floor($v['rate']*1000);
$rateinfo[$rr]=$v; $rateinfo[$v['id']]=$v;
$rateArray[$v['id']]=$rr;
} }
} }
/* 有该礼物、该数量 中奖配置 才处理 */ /* 有该礼物、该数量 中奖配置 才处理 */
...@@ -842,10 +844,11 @@ class Model_Live extends PhalApi_Model_NotORM { ...@@ -842,10 +844,11 @@ class Model_Live extends PhalApi_Model_NotORM {
$luckcoin='0'; $luckcoin='0';
$lucktimes='0'; $lucktimes='0';
if($ifluck ==1 ){ if($ifluck ==1 ){
var_dump($rateArray, $rateinfo);
die;
$luckrate=rand(1,100000); $luckrate=rand(1,100000);
//file_put_contents('./zhifu.txt',date('Y-m-d H:i:s').' 提交参数信息 luckrate:'.json_encode($luckrate)."\r\n",FILE_APPEND); //file_put_contents('./zhifu.txt',date('Y-m-d H:i:s').' 提交参数信息 luckrate:'.json_encode($luckrate)."\r\n",FILE_APPEND);
// $rate=0; // $rate=0;
ksort($rateinfo);
foreach($rateinfo as $k=>$v){ foreach($rateinfo as $k=>$v){
$rate=floor($v['rate']*1000); $rate=floor($v['rate']*1000);
//file_put_contents('./zhifu.txt',date('Y-m-d H:i:s').' 提交参数信息 rate:'.json_encode($rate)."\r\n",FILE_APPEND); //file_put_contents('./zhifu.txt',date('Y-m-d H:i:s').' 提交参数信息 rate:'.json_encode($rate)."\r\n",FILE_APPEND);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment