添加现金支付记录
This commit is contained in:
parent
4f0f91b61a
commit
98fb4d087c
@ -53,7 +53,7 @@ class StoreRefundOrderLists extends BaseAdminDataLists implements ListsSearchInt
|
|||||||
}
|
}
|
||||||
$query->whereTime('refund_reason_time', '<=', $this->params['end_time']);
|
$query->whereTime('refund_reason_time', '<=', $this->params['end_time']);
|
||||||
})
|
})
|
||||||
->field(['id', 'store_id', 'staff_id', 'order_id', 'pay_price', 'pay_time', 'pay_type', 'status', 'uid', 'refund_status', 'refund_type', 'refund_reason_wap', 'refund_reason_time', 'refund_reason_wap_explain', 'refund_reason_wap_img'])
|
->field(['id', 'store_id', 'staff_id', 'order_id', 'pay_price', 'pay_time', 'pay_type', 'status', 'uid', 'refund_status', 'refund_type', 'refund_reason_wap', 'refund_reason_time', 'refund_reason_wap_explain', 'refund_reason_wap_img', 'refund_reason'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()->each(function ($item) {
|
->select()->each(function ($item) {
|
||||||
|
19
app/common/logic/CashFlowLogic.php
Normal file
19
app/common/logic/CashFlowLogic.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\common\logic;
|
||||||
|
|
||||||
|
use app\common\model\store_cash_finance_flow\StoreCashFinanceFlow;
|
||||||
|
|
||||||
|
class CashFlowLogic extends BaseLogic
|
||||||
|
{
|
||||||
|
|
||||||
|
public function insert($storeId, $amount)
|
||||||
|
{
|
||||||
|
$model = new StoreCashFinanceFlow();
|
||||||
|
$model->store_id = $storeId;
|
||||||
|
$model->cash_price = $amount;
|
||||||
|
$model->receivable = $amount;
|
||||||
|
$model->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -158,6 +158,8 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
if (!$order->save()) {
|
if (!$order->save()) {
|
||||||
throw new \Exception('订单保存出错');
|
throw new \Exception('订单保存出错');
|
||||||
}
|
}
|
||||||
|
$cashFlowLogic = new CashFlowLogic();
|
||||||
|
$cashFlowLogic->insert($order['store_id'], $order['pay_price']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user