dever 6 years ago
parent
commit
a001c05519
1 changed files with 5 additions and 7 deletions
  1. 5 7
      product/lib/Pay.php

+ 5 - 7
product/lib/Pay.php

@@ -19,14 +19,12 @@ class Pay
         $status = $param['pay_status'];
         $msg = $param['pay_msg'];
 
-		if ($status == 2) {
-            # 支付成功
-            $order_id = 'WX' . $order_id;
-            $order = Dever::db('product/order')->one(array('order_id' => $order_id, 'uid' => $uid));
+        $order = Dever::db('product/order')->one(array('order_id' => $order_id, 'uid' => $uid));
 
-            if ($order) {
-                Dever::db('product/order')->update(array('where_id' => $order['id'], 'status' => 2));
-            }
+		if ($status == 2 && $order) {
+            Dever::db('product/order')->update(array('where_id' => $order['id'], 'status' => 2));
+        } else {
+        	Dever::db('product/order')->update(array('where_id' => $order['id'], 'status' => 3));
         }
 	}
 }