|
|
|
@ -37,6 +37,7 @@ class WithdrawController extends BaseController
|
|
|
|
|
|
|
|
|
|
$map["promote.id"] = get_pid();
|
|
|
|
|
$map['tab_company_statement_info.company_type'] = ['in',"1,2"];
|
|
|
|
|
$map['tab_company_statement_info.verify_status'] = 1;
|
|
|
|
|
|
|
|
|
|
if ($_REQUEST['pay_status'] || $_REQUEST['pay_status'] == '0') {
|
|
|
|
|
$map['pay_status'] = $_REQUEST['pay_status'];
|
|
|
|
@ -140,12 +141,18 @@ class WithdrawController extends BaseController
|
|
|
|
|
$savedata["pay_time"]=time();
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
$this->poolCount($dbres['pool_id']);
|
|
|
|
|
// $this->poolCount($dbres['pool_id']);
|
|
|
|
|
$this->ajaxReturn(["msg"=>"已经打款过","data"=>$dbres,"status"=>0]);
|
|
|
|
|
}
|
|
|
|
|
$this->poolCount($dbres['pool_id']);
|
|
|
|
|
|
|
|
|
|
M("company_statement_info","tab_")->save($savedata);
|
|
|
|
|
$this->ajaxReturn(["msg"=>"打款成功","data"=>$dbres,"status"=>1]);
|
|
|
|
|
// $this->poolCount($dbres['pool_id']);
|
|
|
|
|
|
|
|
|
|
if ($savedata["pay_status"] == -1) {
|
|
|
|
|
$this->ajaxReturn(["msg"=>"提现失败","data"=>$dbres,"status"=>0]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn(["msg"=>"提现成功","data"=>$dbres,"status"=>1]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -153,13 +160,14 @@ class WithdrawController extends BaseController
|
|
|
|
|
* 整合数据,全部成功则支付成功,否则为支付中
|
|
|
|
|
*/
|
|
|
|
|
public function poolCount($poolid){
|
|
|
|
|
$f = M("company_statement_info","tab_")->where("pool_id = {$poolid} AND pay_status <> 1")->find();
|
|
|
|
|
if(empty($f)){
|
|
|
|
|
//全部完成
|
|
|
|
|
$this->setOneVerifyStatus(4,"payment",$poolid);
|
|
|
|
|
}else{
|
|
|
|
|
$f = M("company_statement_info","tab_")->field("id")->where("pool_id = {$poolid} AND pay_status <> 1")->find();
|
|
|
|
|
|
|
|
|
|
if(isset($f['id'])){
|
|
|
|
|
//打款中
|
|
|
|
|
$this->setOneVerifyStatus(3,"payment",$poolid);
|
|
|
|
|
}else{
|
|
|
|
|
//全部完成
|
|
|
|
|
$this->setOneVerifyStatus(4,"payment",$poolid);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
protected function setOneVerifyStatus($change_status,$op_pre,$id)
|
|
|
|
|