|
|
|
@ -1761,4 +1761,60 @@ class CompanyStatementPoolController extends ThinkController
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function splitForPayStatementInfo() {
|
|
|
|
|
$ids = $_REQUEST['ids'];
|
|
|
|
|
$dbres = $this->DBModel->field("id")->where("id in ({$ids})")->select();
|
|
|
|
|
foreach($dbres as $key=>$value){
|
|
|
|
|
|
|
|
|
|
$statement_data_info = M("company_statement_info","tab_")
|
|
|
|
|
->where(['pool_id'=>$value['id']])
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
//循环info汇总详单
|
|
|
|
|
foreach ($statement_data_info as $skey => $svalue) {
|
|
|
|
|
|
|
|
|
|
$statement_info = json_decode($svalue['statement_info'],true);
|
|
|
|
|
$handle_data = [];
|
|
|
|
|
|
|
|
|
|
foreach ($statement_info as $k => $v) {
|
|
|
|
|
$game_list = $v['game_list'];
|
|
|
|
|
foreach ($game_list as $gk => $gv ) {
|
|
|
|
|
//同一结算时间的汇总成一个数组
|
|
|
|
|
$handle_data[$gv['statement_begin_time'].'-'.$gv['statement_end_time']][] = ['account'=>$v['account'],'game_list'=>$gv];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// dump($handle_data);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$save = [];
|
|
|
|
|
$handle_statement = [];
|
|
|
|
|
//将同一时间的汇总详单记录起来
|
|
|
|
|
foreach ($handle_data as $hk => $hv) {
|
|
|
|
|
$statement_time = explode('-',$hk);
|
|
|
|
|
|
|
|
|
|
$save['statement_begin_time'] = $statement_time[0];
|
|
|
|
|
$save['statement_end_time'] = $statement_time[1];
|
|
|
|
|
|
|
|
|
|
$handle_statement = $hv;
|
|
|
|
|
|
|
|
|
|
// $save['statement_info'] = json_encode($handle_statement);
|
|
|
|
|
$save['company_id'] = $svalue['company_id'];
|
|
|
|
|
$save['company_name'] = $svalue['company_name'];
|
|
|
|
|
$save['company_type'] = $svalue['company_type'];
|
|
|
|
|
$save['company_info'] = $svalue['company_info'];
|
|
|
|
|
|
|
|
|
|
$save['statement_money'] = $svalue['statement_money'];
|
|
|
|
|
$save['statement_info_id'] = $svalue['id'];
|
|
|
|
|
|
|
|
|
|
dump($handle_statement);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|