فهرست منبع

fix merchant bug

stanley-king 4 سال پیش
والد
کامیت
825518c466
3فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 1 1
      helper/refill/RefillFactory.php
  2. 2 2
      mobile/control/merchant.php
  3. 1 1
      test/TestRefill.php

+ 1 - 1
helper/refill/RefillFactory.php

@@ -428,7 +428,7 @@ class RefillFactory
         }
 
         $mchid = $refill_info['mchid'];
-        $mch_info = Model('merchant')->getMerchantInfo($mchid);
+        $mch_info = Model('merchant')->getMerchantInfo(['mchid' => $mchid]);
 
         [$params, $sign] = $this->body($state, $refill_info, $mch_info);
         $params['sign'] = $sign;

+ 2 - 2
mobile/control/merchant.php

@@ -9,7 +9,7 @@ class merchantControl
     public function __construct()
     {
         $mchid = $_POST['mchid'];
-        $mchinfo = Model('merchant')->getMerchantInfo($mchid);
+        $mchinfo = Model('merchant')->getMerchantInfo(['mchid' => $mchid]);
         if(empty($mchinfo)) {
             throw new Exception("合作方ID:{$mchid}不存在");
         }
@@ -21,7 +21,7 @@ class merchantControl
         foreach ($ips as $ip) {
             Log::record("IP:{$ip}",Log::DEBUG);
         }
-        
+
         if(!empty($ips)) {
             $addr = $_SERVER['REMOTE_ADDR'];
             Log::record("request ip:{$addr}",Log::DEBUG);

+ 1 - 1
test/TestRefill.php

@@ -389,7 +389,7 @@ class TestRefill extends TestCase
 
     public function testip(){
         $model_merchant = Model('merchant');
-        $merchant_info = $model_merchant->getMerchantInfo(array('mchid' => 1));
+        $merchant_info = $model_merchant->getMerchantInfo(['mchid' => 1]);
         $ipwhitelist = unserialize($merchant_info['ip_white_list']);
         $res = json_encode($ipwhitelist);
     }