提交 aebe6487 authored 作者: fengzy's avatar fengzy

测试付款单

上级 db131638
......@@ -60,8 +60,42 @@ class flow_oafkClassModel extends flowModel
// ["isturn"]=>
// string(1) "1"
// }
echo "<pre>";
var_dump($this->rs);
// echo "<pre>";
// var_dump($this->rs);
$data = m('c_fund_details_fk')->getall('mid='.$this->rs['id'], 'id,cbzx_code,charge_amount');
foreach ($data as $key => $vo) {
$cbzx_code=$vo['cbzx_code'];
$sql = " cost_id='$cbzx_code' and status = 1 and is_default=1";
$cost = m('c_fund_account')->getone($sql, 'id,account_balance,freeze_amount');//查询账户表成本中心id
$c_withhold = array(
'fund_account_id' => $cost['id'],
'docnum' => $this->rs['docnum'],
'cost_id' => $vo['cbzx_code'],
'amount' => $vo['charge_amount'],
'status' => 1,
'create_time' => date("Y-m-d H:i:s"),
'uid' => $this->rs['uid'],
);
m('c_withhold')->insert($c_withhold);
//修改账户余额
$account = array(
'account_balance' => $cost['account_balance'] - $vo['charge_amount'],
);
m('c_fund_account')->update($account, "`id`='$cost_id['id']'");
//修改冻结余额
$freeze = array(
'account_balance' => $cost['freeze_amount'] + $vo['charge_amount'],
);
m('c_fund_account')->update($freeze, "`id`='$cost_id['id']'");
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论