这段代码srand

高司机 2017-07-04 05:37:17

public function getDrawboxInfo($accountId)
{
$gameInfo = $this->Player->getUserBlobInfo(array("gameinfo"),$accountId);
$ttNow = time();
$returnData = array();
$returnData['petcd'] = $gameInfo['gameinfo']['pettime'] > $ttNow ? $gameInfo['gameinfo']['pettime'] - $ttNow : 0;
$returnData['euipcd'] = $gameInfo['gameinfo']['equiptime'] > $ttNow ? $gameInfo['gameinfo']['equiptime'] - $ttNow : 0;
$returnData['animacd'] = $gameInfo['gameinfo']['animatime'] > $ttNow ? $gameInfo['gameinfo']['animatime'] - $ttNow : 0;
$DrawData = xmlConfig::LoadXmlData("draw.xml");
foreach($DrawData['draw_draws']['draw'] as $draw_sheet_key => $draw_sheet_value)
{
foreach($draw_sheet_value as $draw_sheet_value_k => $draw_sheet_value_v)
{
$cost_res = xmlConfig::getReward($draw_sheet_value_v['cost']);
$discount = 0;
if(strtoupper($draw_sheet_value_v['switch']) == "TRUE" && strtotime($draw_sheet_value_v['startTime']) <= time() && time() < strtotime($draw_sheet_value_v['endTime']))//活动期间打折
{
$discount = $draw_sheet_value_v['discount'];
foreach($cost_res as $cost_res_key => $cost_res_value )
{
$cost_res[$cost_res_key] = floor($cost_res_value * $draw_item_array['discount']);
}
}
$returnData[$draw_sheet_value_v['id']] = array(
'cost'=>$cost_res,
'number'=>$draw_sheet_value_v['number'],
'discount'=>$discount
);
}
}
return array( "ts"=> time(), "errcode" => 0, "errmsg" => "", "data"=>$returnData);
}
...全文
45 点赞 收藏 回复
写回复
回复

还没有回复,快来抢沙发~

发动态
发帖子
基础编程
创建于2007-09-28

9735

社区成员

14.0w+

社区内容

从PHP安装配置,PHP入门,PHP基础到PHP应用
社区公告
暂无公告