Commit ad673ef1 authored by hujun's avatar hujun

可调金额 驳回退款 剩余金额统计

parent b6759d5d
......@@ -159,7 +159,7 @@ class OrderLogService
private function verifyMoney($pay_id, $money)
{
$payLogService = new PayLogService();
$residue_money = $payLogService->adjustment($pay_id);
$residue_money = $payLogService->adjustment($pay_id, 0);
if ($residue_money < $money) {
return -2;
}
......
......@@ -36,9 +36,10 @@ class PayLogService
/**
* 计算可以分佣的金额
* @param $pay_id
* @param $is_reject
* @return int
*/
public function adjustment($pay_id)
public function adjustment($pay_id, $is_reject = 1)
{
//todo 1.计算剩余金额 查询调整表 2.减去退款 3.减去转账
$filed = "id,money";
......@@ -55,7 +56,9 @@ class PayLogService
//减去退款
$refund_params["pay_log_id"] = $pay_id;
//驳回退款 不会改变入账的状态,驳回退款是为了让店长重新编辑上传的东西。
// $refund_params["status"] = array("neq", 4);
if ($is_reject) {
$refund_params["status"] = array("neq", 4);
}
$refund_sum = $this->oRefundModel->getRefundSum("refund_money", $refund_params);
$residue_money = $pay_log_arr["money"] - $adjustment_sum - $refund_sum;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment