Pārlūkot izejas kodu

Merge branch 'master' of http://git.huxiukeji.com/zhangxiaobin/ggyuyin

lizhen_gitee 1 gadu atpakaļ
vecāks
revīzija
fe1b794462

+ 7 - 2
application/admin/controller/RecharOrder.php

@@ -80,6 +80,10 @@ class RecharOrder extends Backend
      */
     public function refund($ids = null)
     {
+        $result = [
+            'code' => 1,
+            'msg' => '操作成功',
+        ];
         Db::startTrans();
         try {
             $row = $this->model->get($ids);
@@ -139,10 +143,11 @@ class RecharOrder extends Backend
                 throw new Exception($refundRes['msg']);
             }
             Db::commit();
-            $this->success('操作成功');
         } catch (Exception $e) {
             Db::rollback();
-            $this->error($e->getMessage());
+            $result['code'] = 0;
+            $result['msg'] = $e->getMessage();
         }
+        return json($result);
     }
 }

+ 6 - 6
application/admin/model/RecharOrder.php

@@ -87,19 +87,19 @@ class RecharOrder extends Model
                 //
                 if ($order['pay_type'] == 1) {
                     $wxpay = new \app\common\library\Wxpay;
-                    $result = $wxpay->WxPayRefund($order_data);
+                    $wxresult = $wxpay->WxPayRefund($order_data);
                     // 微信通知回调 pay->notifyr
-                    if ($result['return_code'] == 'SUCCESS' && $result['result_code'] == 'SUCCESS') {
+                    if ($wxresult['return_code'] == 'SUCCESS' && $wxresult['result_code'] == 'SUCCESS') {
                         Db::name('order_refund_log')->where('id',$refund_log_id)->update(['status'=>1]);
                     } else {
                         throw new Exception($result['return_msg']);
                     }
                 } elseif ($order['pay_type'] == 2) {
-                    $result = Service::submitRefund($order['pay_fee'],$refund_price,$order['pay_out_trade_no'],$refund_data['out_refund_no'],'alipay',$remark,'');
-                    if($result['code'] == '10000'){
+                    $aliresult = Service::submitRefund($order['pay_fee'],$refund_price,$order['pay_out_trade_no'],$refund_data['out_refund_no'],'alipay',$remark,'');
+                    if($aliresult['code'] == '10000'){
                         Db::name('order_refund_log')->where('id',$refund_log_id)->update(['status'=>1]);
                     }else{
-                        throw new Exception($result['msg']);
+                        throw new Exception($aliresult['msg']);
                     }
 
                     /* return 'alipay wrong way';
@@ -151,7 +151,7 @@ class RecharOrder extends Model
             }
         } catch (Exception $e) {
             $result['status'] = 0;
-            $result['msg'] = '';
+            $result['msg'] = $e->getMessage();
         }
         return $result;
     }

+ 1 - 1
application/common/controller/Api.php

@@ -108,7 +108,7 @@ class Api
         //$modulename     = $this->request->module();
         //$controllername = $this->request->controller();
         $actionname     = $this->request->action();
-        if (in_array($actionname,['upload','uploads','recognizingSounds','alipaynotify','trtc_callback','callback'])) {
+        if (in_array($actionname,['upload','uploads','recognizingsounds','alipaynotify','trtc_callback','callback'])) {
             return true;
         }
 

+ 3 - 3
application/index/controller/TaskList.php

@@ -27,14 +27,14 @@ class TaskList extends Controller
             $recharOrder = model('RecharOrder')->where($where)->count();
             $recharOrderRes = 0;
             if (!empty($recharOrder)) {
-                $recharOrderRes = model('RecharOrder')->where($where)->update(['status' => -1]);
+                $recharOrderRes = model('RecharOrder')->update(['status' => -1],$where);
             }
             $result['data'] = $recharOrderRes;
         } catch (Exception $e) {
             $result['code'] = 0;
             $result['msg'] = $e->getMessage();
         }
-        echo json_encode($result);
+        dump($result);exit;
     }
 
     /**
@@ -70,6 +70,6 @@ class TaskList extends Controller
             $result['code'] = 0;
             $result['msg'] = $e->getMessage();
         }
-        echo json_encode($result);
+        dump($result);exit;
     }
 }

BIN
public/uploads/20230815/8b815fd5d04fa776002dc5f88d1b8efd.wav