21,886
社区成员
发帖
与我相关
我的任务
分享
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);
}