2 Commits
1.0.4 ... 1.0.6

Author SHA1 Message Date
e640647709 删除无用代码 2021-08-13 13:06:01 +08:00
f49481ad29 修改字符串判断 2021-08-13 09:39:26 +08:00
2 changed files with 18 additions and 2 deletions

View File

@@ -17,7 +17,6 @@ class Sign extends Init
// $signMsg = str_replace('\\', '', $signMsg); // $signMsg = str_replace('\\', '', $signMsg);
$signMsg = str_replace(' ', '+', $signMsg); $signMsg = str_replace(' ', '+', $signMsg);
$this->sign = $signMsg; $this->sign = $signMsg;
info($this->sign);
return $this->checkSign(); return $this->checkSign();

View File

@@ -2,11 +2,13 @@
namespace XuanChen\WoUnicom; namespace XuanChen\WoUnicom;
use App\Models\ActivitySchoolOrder;
use App\Models\Payment; use App\Models\Payment;
use App\Models\Welfare; use App\Models\Welfare;
use App\Models\WelfareOrder; use App\Models\WelfareOrder;
use App\Models\WelfarePayment; use App\Models\WelfarePayment;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Support\Str;
use XuanChen\WoUnicom\Action\Init; use XuanChen\WoUnicom\Action\Init;
use XuanChen\WoUnicom\Action\Order; use XuanChen\WoUnicom\Action\Order;
use XuanChen\WoUnicom\Action\Query; use XuanChen\WoUnicom\Action\Query;
@@ -104,7 +106,7 @@ class WoUnicom
if ($res === true) { if ($res === true) {
//福利订单 //福利订单
if (str_contains($data['orderid'], 'WEAL')) { if (Str::is('WEAL*', $data['orderid'])) {
$order = WelfareOrder::where('orderid', $data['orderid'])->first(); $order = WelfareOrder::where('orderid', $data['orderid'])->first();
if ($order && $order->status == 'UNPAY') { if ($order && $order->status == 'UNPAY') {
$payment = $order->payment; $payment = $order->payment;
@@ -116,6 +118,21 @@ class WoUnicom
$order->paid(); $order->paid();
} }
} elseif (Str::is('AS*', $data['orderid'])) {
$order = ActivitySchoolOrder::where('orderid', $data['orderid'])->first();
if ($order && $order->state == 'UNPAY') {
$payment = \App\Models\Payment::where('orderable_type', get_class($order))
->where('orderable_id', $order->id)
->latest()
->first();
$payment->state = 'SUCCESS';
$payment->out_trade_no = $data['payfloodid'];
$payment->type = 'UNICOM';
$payment->paid_at = Carbon::now();
$payment->save();
$order->paid();
}
} else { } else {
$order = \App\Models\Order::where('orderid', $data['orderid'])->first(); $order = \App\Models\Order::where('orderid', $data['orderid'])->first();