rabin 9 months ago
parent
commit
acbe7011b5
2 changed files with 30 additions and 11 deletions
  1. 19 0
      yspay/Cash.php
  2. 11 11
      yspay/Multi.php

+ 19 - 0
yspay/Cash.php

@@ -245,6 +245,25 @@ class Cash
     	return 'ok';
     }
 
+    # 查询订单
+    public function test_query_api()
+    {
+    	$info['merchant_id'] = Dever::input('merchant_id');
+    	$orderType = Dever::input('orderType', 1);
+    	$transDate = Dever::input('transDate');
+    	$page = Dever::input('page', 1);
+		if ($info) {
+			$merchant = Dever::db('pay/yspay_merchant')->one($info['merchant_id']);
+	    	if ($merchant) {
+	    		$config = Dever::db('pay/yspay')->one(array('account_id' => $merchant['account_id']));
+	    		if ($config) {
+	    			return Dever::load('pay/yspay/multi')->query($config, $merchant, $orderType, $transDate, $page);
+	    		}
+	    	}
+		}
+    	return 'ok';
+    }
+
     # 资金划付
     public function huafu_commit_api()
     {

+ 11 - 11
yspay/Multi.php

@@ -117,23 +117,20 @@ class Multi
         return 0;
     }
 
-    # 提现
-    public function tixian($config, $merchant, $cash)
+    # 查询订单
+    public function query($config, $merchant, $orderType, $transDate, $page = 1)
     {
         $this->config = $config;
-
-        $mid = $merchant['mid'];
-
         //整理内容信息
         $content = [
             'merNo' => $merchant['merno'],
-            'payAmt' => $cash,
-            'ps' => $merchant['name'] . '划付',
+            'orderType' => $orderType,
+            'transDate' => $transDate,
+            'pageIdx' => $page
         ];
-        Dever::log($content, 'yspay_huafu_tixian');
-        $result = $this->curl('202002', $content);
-
-        return 'ok';
+        Dever::log($content, 'yspay_query');
+        $result = $this->curl('202012', $content, false);
+        return $result;
     }
 
     protected function getOrderNum($order_num)
@@ -176,6 +173,9 @@ class Multi
 			return 'error';
 		}
 		$body = Dever::json_decode($body);
+        if ($code == '202012') {
+            return $body;
+        }
 		if (isset($body['respCode'])) {
 			if ($body['respCode'] == '99999999') {
 				return $state ? 'ok' : $body;