修改收银台采购款支付后调用核销逻辑

This commit is contained in:
liu 2024-06-19 13:52:15 +08:00
parent efd48e0fa7
commit 8ac8d073f6
2 changed files with 15 additions and 2 deletions

View File

@ -2,6 +2,7 @@
namespace app\common\logic;
use app\api\logic\order\OrderLogic;
use app\common\enum\OrderEnum;
use app\common\enum\PayEnum;
use app\common\enum\user\UserShipEnum;
@ -124,6 +125,15 @@ class PayNotifyLogic extends BaseLogic
self::dealVipAmount($order, PayEnum::PURCHASE_FUNDS);
}
if($extra && $extra['store_id']){
$params = [
'verify_code'=>$order['verify_code'],
'store_id'=>$extra['store_id'],
'staff_id'=>$extra['staff_id']
];
OrderLogic::writeOff($params);
}
// self::afterPay($order);
// Redis::send('push-platform-print', ['id' => $order['id']], 60);
// PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
@ -252,10 +262,10 @@ class PayNotifyLogic extends BaseLogic
$order->paid = 1;
$order->pay_time = time();
$order->status = 2;
self::afterPay($order);
if (!$order->save()) {
throw new \Exception('订单保存出错');
}
self::afterPay($order);
$cashFlowLogic = new CashFlowLogic();
$cashFlowLogic->insert($order['store_id'], $order['pay_price']);
// Redis::send('push-platform-print', ['id' => $order['id']]);

View File

@ -146,7 +146,10 @@ class StoreOrderController extends BaseAdminController
switch ($pay_type) {
case PayEnum::PURCHASE_FUNDS:
//采购款支付
PayNotifyLogic::handle('purchase_funds', $order['order_id'], ['uid' => $uid]);
PayNotifyLogic::handle('purchase_funds', $order['order_id'], [
'uid' => $uid,'store_id'=>$this->request->adminInfo['store_id'],
'staff_id'=>$this->request->adminInfo['admin_id']
]);
return $this->success('采购款支付成功', ['id' => $order['id']]);
case PayEnum::CASH_PAY: