feat(cash_flow): 增加资金流水插入逻辑
- 在 CashFlowLogic 类的 insert 方法中添加 source_mark 参数,用于记录资金来源标记 - 在 PayNotifyLogic 类中,订单支付成功后调用 CashFlowLogic 的 insert 方法,传入订单编号作为 source_mark - 这些修改增加了资金流水记录的详细信息,有助于后续的财务对账和分析
This commit is contained in:
parent
8f7d02222b
commit
9ed74f26cf
@ -8,7 +8,7 @@ use app\common\model\store_cash_finance_flow\StoreCashFinanceFlow;
|
||||
class CashFlowLogic extends BaseLogic
|
||||
{
|
||||
|
||||
public function insert($storeId, $amount)
|
||||
public function insert($storeId, $amount,$source_mark='')
|
||||
{
|
||||
$model = new StoreCashFinanceFlow();
|
||||
$find = $model->where(['store_id' => $storeId])->whereDay('create_time')->where('status', 0)->find();
|
||||
@ -21,6 +21,7 @@ class CashFlowLogic extends BaseLogic
|
||||
$model->cash_price = $amount;
|
||||
$model->receivable = $amount;
|
||||
$model->remark = '银行转账请备注:'.mt_rand(1000, 9999);
|
||||
$model->source_mark = $source_mark;
|
||||
$model->status = YesNoEnum::NO; //收银台收了默认算完成了
|
||||
$model->save();
|
||||
}
|
||||
|
@ -495,6 +495,8 @@ class PayNotifyLogic extends BaseLogic
|
||||
if ($order['other_uid'] > 0) {
|
||||
$uid = $order['other_uid'];
|
||||
}
|
||||
$cashFlowLogic = new CashFlowLogic();
|
||||
$cashFlowLogic->insert($order['store_id'], $order['price'],$orderSn);
|
||||
|
||||
PushService::push('wechat_mmp_' . $uid, $uid, ['type' => 'INDUSTRYMEMBERS', 'msg' => '订单支付成功', 'data' => ['id' => $order['id'], 'paid' => 1]]);
|
||||
PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'INDUSTRYMEMBERS', 'msg' => '订单支付成功', 'data' => ['id' => $order['id'], 'paid' => 1]]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user