panda 1 ano atrás
pai
commit
ee7644c7de

+ 11 - 0
application/api/controller/HuiPay.php

@@ -294,6 +294,11 @@ class HuiPay extends Api
             return self::response201('签名校验失败');
         }
 
+        if ($resp_data['resp_code'] != '00000000'){
+            LogUtil::info('订单交易失败', self::LOG_MODULE, __FUNCTION__,$resp_data['resp_desc'] ?? '交易失败');
+            return self::response201('支付信息有误');
+        }
+
         // 开始处理业务逻辑
         $pay_no = $resp_data['req_seq_id'];
         LogUtil::info('订单号', self::LOG_MODULE, __FUNCTION__, $pay_no);
@@ -303,6 +308,12 @@ class HuiPay extends Api
             LogUtil::info('订单信息不存在', self::LOG_MODULE, __FUNCTION__);
             return self::response201('订单信息不存在');
         }
+        if ($order_info['status'] == 3){
+            LogUtil::info('订单信息_已删除', self::LOG_MODULE, __FUNCTION__, [
+                'status' => $order_info['status']
+            ]);
+            return self::response201('充值入账失败');
+        }
         if ($order_info['status'] == 1 || $order_info['status'] == 2) {
             LogUtil::info('充值入账更新余额失败_status已更新过', self::LOG_MODULE, __FUNCTION__, [
                 'status' => $order_info['status']

+ 16 - 0
application/index/controller/Index.php

@@ -13,6 +13,22 @@ class Index extends Frontend
     protected $noNeedRight = '*';
     protected $layout = '';
 
+    public function aaaa(){
+        $query = Db::name('pay_order')
+            ->whereBetween('createtime',[1706716800,1706803199])
+            ->where('status',1)
+            ->whereNotIn('user_id',[1556])
+            ->where('payment_class','wechat');
+
+        dd($query->sum('money'));
+
+        $list = $query->select();
+
+        foreach ($list as $key=>$item){
+            $list[$key]['createtime'] = date('Y-m-d H:i:s',$item['createtime']);
+        }
+        dd($list);
+    }
 
     /**
      * 测试 汇付 支付