dever 5 سال پیش
والد
کامیت
558a29995d
2فایلهای تغییر یافته به همراه64 افزوده شده و 0 حذف شده
  1. 13 0
      journal/database/order.php
  2. 51 0
      main/lib/Cron.php

+ 13 - 0
journal/database/order.php

@@ -551,5 +551,18 @@ return array
             'order' => array('id' => 'desc'),
             'col' => '*',
         ),
+
+        'getNew' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('cdate' => 'desc'),
+            'limit' => '0,186',
+            'col' => '*',
+        ),
     ),
 );

+ 51 - 0
main/lib/Cron.php

@@ -6,6 +6,57 @@ use Dever;
 
 class Cron
 {
+    public function dao_order_api()
+    {
+        # 根据订单的buy_id来确定生成的本数
+        $order = Dever::db('journal/order')->getNew();
+        $test = Dever::input('test');
+        if ($test == 1) {
+            print_r($order);die;
+        }
+        if ($order) {
+            foreach ($order as $k => $v) {
+                $info = Dever::db('act/order')->one(array('order_id' => $v['order_id']));
+                if (!$info) {
+                    unset($v['id']);
+                    $v['status'] = 7;
+                    Dever::db('act/order')->insert($v);
+                }
+            }
+        }
+
+        return 'ok';
+    }
+
+    public function dao_orders_api()
+    {
+        # 根据订单的buy_id来确定生成的本数
+        $id = Dever::input('product_id', 26);
+        $where['product_id'] = $id;
+        $where['status'] = 7;
+        //$where['score_status'] = 1;
+        $order_id = Dever::input('order_id');
+        if ($order_id) {
+            $where['order_id'] = $order_id;
+        }
+        $uid = Dever::input('uid');
+        if ($uid) {
+            $where['uid'] = $uid;
+        }
+        $order = Dever::db('act/order')->state($where);
+        $test = Dever::input('test');
+        if ($test == 1) {
+            print_r($order);die;
+        }
+        if ($order) {
+            foreach ($order as $k => $v) {
+                $this->getpays($v['order_id']);
+            }
+        }
+
+        return 'ok';
+    }
+
     public function buy_code_api()
     {
         # 根据订单的buy_id来确定生成的本数