|
|
|
@ -146,6 +146,65 @@ class AggregateFinanceSetController extends Controller {
|
|
|
|
|
echo "----补点统计ok".PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public function updateAggregateFinanceData($id)
|
|
|
|
|
{
|
|
|
|
|
//获取基础信息
|
|
|
|
|
$Aggregate = M("aggregate_statement","tab_");
|
|
|
|
|
$info = $Aggregate->where("id='{$id}'")->find();
|
|
|
|
|
$sign = md5($info['begintime'].$info['endtime'].$info['withdraw_type'].$this->token);
|
|
|
|
|
$arr = [
|
|
|
|
|
"begintime"=>$info['begintime'],
|
|
|
|
|
"endtime"=>$info['endtime'],
|
|
|
|
|
"type"=>$info['withdraw_type'],
|
|
|
|
|
"sign"=>$sign,
|
|
|
|
|
"channel_id"=>$info['channel_id']
|
|
|
|
|
];
|
|
|
|
|
$dataurl .= $this->apihost."&".http_build_query($arr);
|
|
|
|
|
$html = file_get_contents($dataurl);
|
|
|
|
|
$rsp = json_decode($html,true);
|
|
|
|
|
if($rsp['code'] != 1){
|
|
|
|
|
echo $rsp['error'].PHP_EOL;die;
|
|
|
|
|
}
|
|
|
|
|
//更新信息
|
|
|
|
|
$begintimestr = date("Y-m-d",$info['begintime']);
|
|
|
|
|
$endtimestr = date("Y-m-d",$info['endtime']);
|
|
|
|
|
var_dump($rsp);
|
|
|
|
|
if($rsp['count'] > 0){
|
|
|
|
|
//插入数据
|
|
|
|
|
foreach ($rsp['data'] as $k => $v) {
|
|
|
|
|
foreach ($v["game_list"] as $ke => &$va) {
|
|
|
|
|
$va['begintime'] = $begintimestr;
|
|
|
|
|
$va['endtime'] = $endtimestr;
|
|
|
|
|
$va['fax_ratio'] = 0;
|
|
|
|
|
}
|
|
|
|
|
$v["statement_info"] = json_encode($v["game_list"],JSON_UNESCAPED_UNICODE);
|
|
|
|
|
unset($v["game_list"]);
|
|
|
|
|
$v['create_time'] = time();
|
|
|
|
|
$v['admin_name'] = $_SESSION['onethink_admin']['user_auth']['username'];
|
|
|
|
|
$v['admin_id'] = $_SESSION['onethink_admin']['user_auth']['uid'];
|
|
|
|
|
$v['verify_status'] = 0;
|
|
|
|
|
$res = $Aggregate->where("id='{$id}'")->save($v);
|
|
|
|
|
if(empty($res)){
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
$savedata = [
|
|
|
|
|
"create_time"=>time(),
|
|
|
|
|
"admin_name"=>$_SESSION['onethink_admin']['user_auth']['username'],
|
|
|
|
|
"admin_id"=>$_SESSION['onethink_admin']['user_auth']['uid'],
|
|
|
|
|
"verify_status"=>0,
|
|
|
|
|
"statement_info"=>json_encode([],JSON_UNESCAPED_UNICODE),
|
|
|
|
|
"ratio_money"=>0,
|
|
|
|
|
"pay_money"=>0
|
|
|
|
|
];
|
|
|
|
|
$res = $Aggregate->where("id='{$id}'")->save($savedata);
|
|
|
|
|
if(empty($res)){
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|