From ced600785c89de927b5a9d032193d8f748905f9f Mon Sep 17 00:00:00 2001 From: tang <28718949@qq.com> Date: Sat, 20 Jan 2024 14:14:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E7=BA=A6=E9=80=80=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/TongLianPay.php | 4 +- modules/admin/views/signing/index.php | 51 +++++++++++--------- modules/api/controllers/BannerController.php | 2 +- 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/components/TongLianPay.php b/components/TongLianPay.php index dd3eebc..156392d 100644 --- a/components/TongLianPay.php +++ b/components/TongLianPay.php @@ -63,6 +63,8 @@ class TongLianPay $signing->status = 1; + $signing->trxid = $data['trxid']; + $signing->pay_time = time(); return $signing->save(); @@ -79,7 +81,7 @@ class TongLianPay 'appid' => $this->appid, 'trxamt' => 1, 'reqsn' => date('YmdH') . rand(10000, 99999), - 'oldreqsn' => $signing->order_no, + 'oldtrxid' => $signing->trxid, 'randomstr' => date('YmdH') . rand(10000, 99999), 'signtype' => 'RSA', ]; diff --git a/modules/admin/views/signing/index.php b/modules/admin/views/signing/index.php index 2d1c610..b568372 100644 --- a/modules/admin/views/signing/index.php +++ b/modules/admin/views/signing/index.php @@ -42,7 +42,8 @@ $status = \Yii::$app->request->get('status'); - + + @@ -71,6 +72,8 @@ $status = \Yii::$app->request->get('status'); 已签约 {{# } else if(d.status == -1){ }} 已取消 + {{# } else if(d.status == 2){ }} + 已退款 {{# } }} @@ -157,49 +160,49 @@ $status = \Yii::$app->request->get('status'); //监听工具栏 table.on('tool(dtable)', function (obj) { var lay_event = obj.event; - if(lay_event == 'refund'){ + if (lay_event == 'refund') { confirm_tip = '确定退款?'; confirm_url = 'urlManager->createUrl(["/admin/signing/refund"])?>'; } - if(confirm_url != null){ + if (confirm_url != null) { layer.confirm(confirm_tip, { - btn: ['确定','取消'] - }, function(){ - $.ajax(confirm_url,{ - type:"POST", - dataType:"json", - data:{ - id:obj.data.id, - _csrf:_csrf + btn: ['确定', '取消'] + }, function () { + $.ajax(confirm_url, { + type: "POST", + dataType: "json", + data: { + id: obj.data.id, + _csrf: _csrf }, - success:function(res){ - if(res.code == 0){ + success: function (res) { + if (res.code == 0) { layer.msg(res.msg, { offset: '15px' - ,icon: 1 - ,time: 1000 - }, function(){ + , icon: 1 + , time: 1000 + }, function () { location.reload(); }); } else { layer.msg(res.msg, { offset: '15px' - ,icon: 2 - ,time: 1000 - }, function(){ + , icon: 2 + , time: 1000 + }, function () { }); } }, - error:function(xhr,type,err){ + error: function (xhr, type, err) { layer.msg(xhr.responseText, { offset: '15px' - ,icon: 2 - ,time: 1000 - }, function(){ + , icon: 2 + , time: 1000 + }, function () { }); } }) - }, function(){ + }, function () { }); } }) diff --git a/modules/api/controllers/BannerController.php b/modules/api/controllers/BannerController.php index d2a26ee..30a6171 100644 --- a/modules/api/controllers/BannerController.php +++ b/modules/api/controllers/BannerController.php @@ -43,7 +43,7 @@ class BannerController extends Controller foreach ($list as $key => $value) { if ($value['type'] == 1) { - $arr[] = $value; + $arr[$value['id']] = $value; unset($list[$key]); } }