|
|
|
@ -1096,9 +1096,9 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
public function addSpecialComplementPost( ) {
|
|
|
|
|
|
|
|
|
|
$data = json_decode($_REQUEST['data'],true);
|
|
|
|
|
|
|
|
|
|
// dump($data);die();
|
|
|
|
|
$withdraw_type = 3;
|
|
|
|
|
|
|
|
|
|
M()->startTrans();
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
|
|
|
|
|
|
$company_data = M("promote_company","tab_")->where(['id'=>$value['company_id']])->find();
|
|
|
|
@ -1106,13 +1106,15 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
$company_type = M("company_relation","tab_")->where("first_company_id={$value['company_id']} or second_company_id={$value['company_id']}")->find();
|
|
|
|
|
|
|
|
|
|
$insert['is_payment'] = $company_type['is_payment'];
|
|
|
|
|
$insert['statement_begin_time'] = $value['statement_begin_time'];
|
|
|
|
|
$insert['statement_end_time'] = $value['statement_end_time'];
|
|
|
|
|
$insert['statement_begin_time'] = strtotime($value['statement_begin_time']);
|
|
|
|
|
$insert['statement_end_time'] = strtotime($value['statement_end_time']);
|
|
|
|
|
$insert['withdraw_type'] = $withdraw_type;
|
|
|
|
|
$insert['company_belong'] = $company_data['company_belong'];
|
|
|
|
|
$insert['company_name'] = $company_data['company_name'];
|
|
|
|
|
$insert['company_id'] = $value['company_id'];
|
|
|
|
|
$insert['company_type'] = $value['company_type'];
|
|
|
|
|
$insert['company_type'] = $company_data['company_type'];
|
|
|
|
|
$insert['pay_type'] = $company_type['collection'];
|
|
|
|
|
$insert['verify_log'] = '';
|
|
|
|
|
|
|
|
|
|
$proCompany_info['id'] = $company_data['id'];
|
|
|
|
|
$proCompany_info['partner'] =$company_data['company_name'];
|
|
|
|
@ -1145,7 +1147,7 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$secord_info['id'] = $weCompany['id'];
|
|
|
|
|
$secord_info['partner'] =$weCompany['company_name'];
|
|
|
|
|
$secord_info['partner'] =$weCompany['partner'];
|
|
|
|
|
$secord_info['link_man'] = $weCompany['link_man'];
|
|
|
|
|
$secord_info['link_phone'] =$weCompany['link_phone'];
|
|
|
|
|
$secord_info['address'] = $weCompany['address'];
|
|
|
|
@ -1166,27 +1168,49 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
$statement_money += $v['sum_money'];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$insert['pay_amount'] = $pay_amount;
|
|
|
|
|
$insert['platform_amount'] = $pay_amount;
|
|
|
|
|
$insert['statement_money'] = $statement_money;
|
|
|
|
|
|
|
|
|
|
$insert['op_time'] = time();
|
|
|
|
|
|
|
|
|
|
if ($company_type['first_company_id'] == $value['company_id']) {
|
|
|
|
|
$insert['first_party_info'] = json_encode($proCompany_info);
|
|
|
|
|
$insert['second_party_info'] = json_encode($secord_info);
|
|
|
|
|
} elseif ($company_type['second_company_id'] == $value['company_id']) {
|
|
|
|
|
$insert['second_party_info'] = json_encode($proCompany_info);
|
|
|
|
|
$insert['first_party_info'] = json_encode($secord_info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach($statement_info as $k => $v) {
|
|
|
|
|
|
|
|
|
|
$statement_info[$k]['statement_type'] = 0;
|
|
|
|
|
$statement_info[$k]['fax_ratio'] = $company_data['fax_ratio'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} elseif ($company_type['second_company_id'] == $value['company_id']) {
|
|
|
|
|
if ($company_data['company_type'] == 2) {
|
|
|
|
|
|
|
|
|
|
$statement_data['account'] = '';
|
|
|
|
|
$statement_data['game_list'] = $statement_info;
|
|
|
|
|
|
|
|
|
|
$insert['statement_info'] = json_encode($statement_data);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
$insert['statement_info'] = json_encode($statement_info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$is_save = M('company_statement','tab_')->add($insert);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (!$is_save) {
|
|
|
|
|
M()->rollback();
|
|
|
|
|
$this->ajaxReturn(['status'=>1001]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dump($data);
|
|
|
|
|
}
|
|
|
|
|
M()->commit();
|
|
|
|
|
$this->ajaxReturn(['status'=>1]);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|