$mainId, 'shopId' => $shopId, 'hdId' => $hdId, 'customId' => $customId]; $data['orderSn'] = orderSn::getScanPaySn($snData); return self::add($data, true); } public static function thirdPay($payWay, $orderSn, $totalFee, $attach, $transactionId) { $order = self::getByCondition(['orderSn' => $orderSn], true); if (empty($order)) { noticeUtil::push('扫码付款成功,支付回调,单号:' . $orderSn . ' 金额:' . $totalFee . ' 回调id:' . $transactionId . ' 附件:' . $attach . ',没有找到单号', '15280215347'); $msg = "没有找到零售订单 orderSn:{$orderSn}"; Yii::info($msg); util::fail($msg); } if ($order->actPrice != $totalFee) { noticeUtil::push("扫码付款成功,支付回调错误,订单金额与回调通知金额不一致 orderSn:{$orderSn} {$order->actPrice} {$totalFee} 附件:{$attach}", '15280215347'); $msg = "零售订单金额与回调通知金额不一致 orderSn:{$orderSn} {$order->actPrice} {$totalFee}"; Yii::info($msg); util::fail($msg); } $id = $order->id; $order = self::getLockById($id); $date = date("Y-m-d H:i:s"); $order->payStatus = 1; $order->status = 2; $order->payTime = $date; $order->returnCode = $transactionId; $order->save(); self::payAfter($order); } public static function payAfter($order) { $capitalType = dict::getDict('capitalType', 'scanPay', 'id'); $mainId = $order->mainId; $shopId = $order->shopId; $amount = $order->actPrice ?? 0; $main = MainClass::getById($mainId, true); $shop = ShopClass::getLockById($shopId); ShopClass::customScanPayAddBalance($main, $shop, $amount, $order, $capitalType); } }