From 0592226ed27da7abaa914c2e3a3533e3cb0fd0b2 Mon Sep 17 00:00:00 2001 From: zcy Date: Wed, 6 Jul 2022 15:23:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B9=8C=E5=B9=B2=E8=BE=BE?= =?UTF-8?q?=E7=9A=84=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Pay/PayController.php | 1 + app/ServicePay/TransCard/WugandaCard.php | 51 ++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 app/ServicePay/TransCard/WugandaCard.php diff --git a/app/Http/Controllers/Pay/PayController.php b/app/Http/Controllers/Pay/PayController.php index ee069bf..e1a8b31 100644 --- a/app/Http/Controllers/Pay/PayController.php +++ b/app/Http/Controllers/Pay/PayController.php @@ -69,6 +69,7 @@ class PayController extends BaseController 1 => 'FeilvbinCard', 2 => 'KshCard', 3 => 'AiJICard', + 4 => 'WugandaCard', ]; } diff --git a/app/ServicePay/TransCard/WugandaCard.php b/app/ServicePay/TransCard/WugandaCard.php new file mode 100644 index 0000000..e8b81b6 --- /dev/null +++ b/app/ServicePay/TransCard/WugandaCard.php @@ -0,0 +1,51 @@ +msg = $msg; + $pattern = '/(?<=UGX\s)\d+(?=\s)|(?<=from\s)[\w\s]+|\d{5,}(?=\s)|(?<=ID:\s)\d+(?=\.)|\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}|(?<=Reason:\s).*(?=\.)/'; + $match_num = preg_match_all($pattern, $this->msg, $matches, PREG_PATTERN_ORDER); + if ($match_num != false && $match_num > 0 && $matches[0]) { + $this->orderInfo = [ + 'pay_money' => $matches[0][0], + 'from_name' => $matches[0][1], + 'from_card' => $matches[0][2], + 'sms_date' => $matches[0][3], + 'remark' => $matches[0][4], + 'order_number' => $matches[0][5], + ]; + } + } + + public function orderInfo($requestArr) + { + $showInfo = $this->showInfo(); + $ewm_account = $showInfo['from_card']; + + $order_money = $showInfo['pay_money']; + $from_name = $showInfo['from_name']; + $remark = $showInfo['remark']; + $order_money = number_format($order_money, 2, '.', ''); + //查找未支付的订单 + $t = date('Y-m-d H:i:s'); + return Order::where('order_at', '<', $t) + ->where('order_money', $order_money) + ->where('ewm_account', $ewm_account) +// ->whereRaw('substr(ewm_account,-4,4)=?', [$ewm_account]) +// ->whereIn('status', [0, 2]) + ->orderBy('id', 'desc')->first(); + } +} \ No newline at end of file