Parcourir la source

Merge branch 'ralbex' of 39.97.239.116:gyfl/xyzshop into ralbex

xiaoyu il y a 3 ans
Parent
commit
c046ef7d6e
3 fichiers modifiés avec 21 ajouts et 6 suppressions
  1. 6 0
      data/model/refill_order.model.php
  2. 4 6
      mobile/control/refill.php
  3. 11 0
      test/TestRefill.php

+ 6 - 0
data/model/refill_order.model.php

@@ -70,4 +70,10 @@ class refill_orderModel extends Model
     {
         return $this->table('refill_detail')->where(['mchid' => $mchid,'mch_order' => $mch_order])->update($datas);
     }
+
+    public function exist($mchid,$mch_order)
+    {
+        $item = $this->table('refill_detail')->where(['mchid' => $mchid,'mch_order' => $mch_order])->select();
+        return !empty($item);
+    }
 }

+ 4 - 6
mobile/control/refill.php

@@ -218,14 +218,12 @@ class refillControl extends merchantControl
 
     private function check_mchorder($mchid,$mch_order)
     {
-        if(empty($mch_order)) {
+        if (empty($mch_order)) {
             return false;
-        }
-        else {
+        } else {
             $refill_order = Model('refill_order');
-            $ret = $refill_order->getOrderInfo(['mchid' => $mchid,'mch_order' => $mch_order]);
-
-            return empty($ret);
+            $ret = $refill_order->exist($mchid, $mch_order);
+            return ($ret == false);
         }
     }
 

+ 11 - 0
test/TestRefill.php

@@ -2235,6 +2235,17 @@ class TestRefill extends TestCase
             return false;
         }
     }
+
+    public function testOrderExist()
+    {
+        $refill_order = Model('refill_order');
+        $ret = $refill_order->exist(10116,'Yzb20210825111251415');
+    }
+
+    public function testRGoods()
+    {
+        $goods_list = refill\RefillFactory::instance()->goods();
+    }
 }