This commit is contained in:
mkm 2024-07-02 17:49:51 +08:00
commit c93c7806c5
2 changed files with 19 additions and 4 deletions

View File

@ -106,7 +106,7 @@ class PayNotifyLogic extends BaseLogic
];
self::dealGoodsLeft($checkArr, $order['uid'], $order['id']);
}
if ($extra && $extra['store_id']) {
if ($extra && $extra['store_id'] && $order['reservation'] !=1) {
$params = [
'verify_code' => $order['verify_code'],
'store_id' => $extra['store_id'],
@ -208,7 +208,7 @@ class PayNotifyLogic extends BaseLogic
// }
// self::addUserSing($order);
self::afterPay($order);
if ($extra && $extra['store_id']) {
if ($extra && $extra['store_id'] && $order['reservation'] !=1) {
$params = [
'verify_code' => $order['verify_code'],
'store_id' => $extra['store_id'],
@ -617,7 +617,7 @@ class PayNotifyLogic extends BaseLogic
/**
* 现金支付
*/
public static function cash_pay($orderSn)
public static function cash_pay($orderSn,$extra =[])
{
$order = StoreOrder::where('order_id', $orderSn)->findOrEmpty();
@ -627,6 +627,9 @@ class PayNotifyLogic extends BaseLogic
$order->paid = 1;
$order->pay_time = time();
$order->status = 2;
if ($order['reservation'] ==1) {
$order->status = 1;
}
if (!$order->save()) {
throw new \Exception('订单保存出错');
}
@ -642,6 +645,15 @@ class PayNotifyLogic extends BaseLogic
self::descStock($order['id']);
}
if ($extra && $extra['store_id'] && $order['reservation'] !=1) {
$params = [
'verify_code' => $order['verify_code'],
'store_id' => $extra['store_id'],
'staff_id' => $extra['staff_id']
];
OrderLogic::writeOff($params);
}
// Redis::send('push-platform-print', ['id' => $order['id']]);
return true;

View File

@ -228,7 +228,10 @@ class StoreOrderController extends BaseAdminController
return $this->success('礼品券支付成功', ['id' => $order['id']]);
case PayEnum::CASH_PAY:
//现金支付
PayNotifyLogic::handle('cash_pay', $order['order_id']);
PayNotifyLogic::handle('cash_pay', $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::WECHAT_PAY_BARCODE: