|
|
@ -698,11 +698,56 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function pool_splice() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ids = $_REQUEST['ids'];
|
|
|
|
|
|
|
|
$arr_ids = explode(",",$ids);
|
|
|
|
|
|
|
|
$dbres = $this->DBModel->field("id,company_id")->where("id in ({$ids}) and withdraw_type=3")->select();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$upset_ids = array_column($dbres,"id");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$handle_data = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$hkey = 0;
|
|
|
|
|
|
|
|
//拆分特殊补点单相同公司的
|
|
|
|
|
|
|
|
foreach ($dbres as $key => $value) {
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
|
|
|
|
if (!$handle_data[$hkey][$value["company_id"]]) {
|
|
|
|
|
|
|
|
$handle_data[$hkey][$value["company_id"]]= $value['id'];
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$hkey++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($hkey>=50) break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//特殊补点结算单发起汇总
|
|
|
|
|
|
|
|
foreach ($handle_data as $key => $value) {
|
|
|
|
|
|
|
|
$pool_ids = implode(",",array_values($value));
|
|
|
|
|
|
|
|
if ($pool_ids) {
|
|
|
|
|
|
|
|
$this->pool($pool_ids);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//普通结算单发起汇总
|
|
|
|
|
|
|
|
$arr_ids = implode(",",array_diff($arr_ids,$upset_ids));
|
|
|
|
|
|
|
|
if ($arr_ids) {
|
|
|
|
|
|
|
|
$this->pool($arr_ids);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn(array(
|
|
|
|
|
|
|
|
'status' => 1,
|
|
|
|
|
|
|
|
"info"=>"汇总成功"
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//汇总
|
|
|
|
//汇总
|
|
|
|
public function pool()
|
|
|
|
public function pool($pool_ids = "")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
|
|
|
|
if(!isset($pool_ids)) $this->error("参数错误");
|
|
|
|
$ids = $_REQUEST['ids'];
|
|
|
|
$ids = $pool_ids;
|
|
|
|
$dbres = $this->DBModel->field("*")->where("id in ({$ids})")->select();
|
|
|
|
$dbres = $this->DBModel->field("*")->where("id in ({$ids})")->select();
|
|
|
|
|
|
|
|
|
|
|
|
$check = [];
|
|
|
|
$check = [];
|
|
|
@ -828,10 +873,7 @@ class CompanyStatementController extends ThinkController
|
|
|
|
//修改结算单规则
|
|
|
|
//修改结算单规则
|
|
|
|
$this->updatePoolVerifyStatus($v['statement_ids'],2,"pool",$v['statement_num']);
|
|
|
|
$this->updatePoolVerifyStatus($v['statement_ids'],2,"pool",$v['statement_num']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->ajaxReturn(array(
|
|
|
|
|
|
|
|
'status' => 1,
|
|
|
|
|
|
|
|
"info"=>"汇总成功"
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//结算单规则
|
|
|
|
//结算单规则
|
|
|
|
protected function updatePoolVerifyStatus($ids,$change_status,$op_pre,$num){
|
|
|
|
protected function updatePoolVerifyStatus($ids,$change_status,$op_pre,$num){
|
|
|
|