dever 6 years ago
parent
commit
0f398745a8
2 changed files with 7 additions and 3 deletions
  1. 6 2
      code/lib/Core.php
  2. 1 1
      main/src/Journal_v1.php

+ 6 - 2
code/lib/Core.php

@@ -60,8 +60,12 @@ class Core
                 }
             } else {
                 # 订阅
-                Dever::load('act/lib/subscribe')->submit($order['uid'], $order['product_id'], 1);
-                $code = $this->createCode($order['cate_id'] . ',' . $order['product_id'], $order['cate_id'], $order['product_id'], $order['seller_id'], $product_num, $order['uid'], $order['order_id'], 0, 3);
+                $state = Dever::load('act/lib/subscribe')->submit($order['uid'], $order['product_id'], 1);
+                if ($state) {
+                    $code = $this->createCode($order['cate_id'] . ',' . $order['product_id'], $order['cate_id'], $order['product_id'], $order['seller_id'], $product_num, $order['uid'], $order['order_id'], 0, 3);
+                } else {
+                    $code = $this->createCode($order['cate_id'] . ',' . $order['product_id'], $order['cate_id'], $order['product_id'], $order['seller_id'], $product_num, $order['uid'], $order['order_id'], 0, 1);
+                }
             }
         }
 

+ 1 - 1
main/src/Journal_v1.php

@@ -93,7 +93,7 @@ class Journal_v1 extends Core
         # 已开始
         $data['ytype'] = 1;
         if (isset($data['pdate']) && $data['pdate'] > 0) {
-            if ($data['pdate'] <= time()) {
+            if ($data['pdate'] >= time()) {
                 # 未到时间
                 $data['ytype'] = 2;
             }