优化线下打款

master
chenzhi 4 years ago
parent bd125be3dd
commit 6d4fce53eb

@ -109,8 +109,9 @@ class CompanyStatementOfflineController extends ThinkController
} }
public function doPayment() public function doPayment()
{ {
if(!isset($_REQUEST['ids'])) $this->error("参数错误"); if(!isset($_REQUEST['ids']) || !isset($_REQUEST['payment_time'])) $this->error("参数错误");
$ids = $_REQUEST['ids']; $ids = $_REQUEST['ids'];
$payment_time = $_REQUEST['payment_time'];
//获取所有的母单id //获取所有的母单id
$companyStatementInfo = M("company_statement_info","tab_"); $companyStatementInfo = M("company_statement_info","tab_");
$statementPool = $companyStatementInfo->where("id in ($ids) and pay_status <> 1")->field("pool_id,count(id) count")->group("pool_id")->select(); $statementPool = $companyStatementInfo->where("id in ($ids) and pay_status <> 1")->field("pool_id,count(id) count")->group("pool_id")->select();
@ -128,7 +129,7 @@ class CompanyStatementOfflineController extends ThinkController
$saveData = [ $saveData = [
"pay_type"=>3, "pay_type"=>3,
"pay_status"=>1, "pay_status"=>1,
"pay_info"=>json_encode(["payment_user"=>$_SESSION['onethink_admin']['user_auth']["username"],"payment_time"=>date("Y-m-d H:i:s")]) "pay_info"=>json_encode(["payment_user"=>$_SESSION['onethink_admin']['user_auth']["username"],"payment_time"=>$payment_time])
]; ];
$ires = $companyStatementInfo->where("id in ($ids)")->save($saveData); $ires = $companyStatementInfo->where("id in ($ids)")->save($saveData);

@ -291,17 +291,31 @@
} }
text = text.join(","); text = text.join(",");
var date = false;
if(confirm){ layer.open({
layer.confirm('【警告】确认打款后将不可回退,如需继续请点击确认', { title : '打款时间确认',
btn: ['确认','取消'], content : `<input type="text" readonly id="deposit_recept_time" value="" placeholder="打款时间"/>`,
title:false success : function() {
}, function(){ $('#deposit_recept_time').datetimepicker({
_doAgreeApply(); format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
}); });
}else{ $("#deposit_recept_time").datetimepicker("setDate", new Date());
},
yes : function(index, layero) {
date = $('#deposit_recept_time').val();
if (!date) {
layer.msg('请选择打款时间');
return true;
}
_doAgreeApply(); _doAgreeApply();
return true;
} }
});
function _doAgreeApply(){ function _doAgreeApply(){
//执行 //执行
@ -310,7 +324,7 @@
url: "{:U('doPayment')}", url: "{:U('doPayment')}",
dataType: 'json', dataType: 'json',
async: false, async: false,
data: {ids:text}, data: {ids:text,payment_time:date},
success:function(data){ success:function(data){
if(data.status==1){ if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>"); layer.msg("<font style='color:white'>" + data.info + "</font>");

Loading…
Cancel
Save