Commit 5f0626d1 authored by clone's avatar clone

1

parent f19c8e3a
......@@ -36,9 +36,10 @@ class PayLogService
/**
* 计算可以分佣的金额
* @param $pay_id
* @param $type
* @return int
*/
public function adjustment($pay_id)
public function adjustment($pay_id,$type = 1)
{
//todo 1.计算剩余金额 查询调整表 2.减去退款 3.减去转账
$filed = "id,money";
......@@ -54,6 +55,11 @@ class PayLogService
$adjustment_sum = $this->payLogAdjustmentModel->getAdjustmentSum("money", $where_);
//减去退款
$refund_params["pay_log_id"] = $pay_id;
if($type == 2){
//驳回退款 不会改变入账的状态,驳回退款是为了让店长重新编辑上传的东西。
$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;
......@@ -176,7 +182,7 @@ class PayLogService
//验证金额是否合法
$payLogService = new PayLogService();
$residue_money = $payLogService->adjustment($pay_log_id);
$residue_money = $payLogService->adjustment($pay_log_id,2);
if ($residue_money < $refund_money) {
return -2;
}
......
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