rabin 3 years ago
parent
commit
82be7ccf08
3 changed files with 37 additions and 3 deletions
  1. 16 2
      service/agent/database/order.php
  2. 6 1
      service/agent/src/My.php
  3. 15 0
      service/option/database/member.php

+ 16 - 2
service/agent/database/order.php

@@ -628,7 +628,7 @@ return array
 
     'request' => array
     (
-        'getOld' => array
+        'getNew' => array
         (
             # 匹配的正则或函数 选填项
             'option' => array
@@ -637,11 +637,25 @@ return array
                 'status' => array('yes', 'in'),
                 'state' => 1,
             ),
-            'order' => array('id' => 'asc'),
+            'order' => array('id' => 'desc'),
             'type' => 'one',
             'col' => '*',
         ),
 
+        'getTotal' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'mid' => 'yes',
+                'status' => array('yes', 'in'),
+                'state' => 1,
+            ),
+            'order' => array('id' => 'desc'),
+            'type' => 'count',
+            'col' => '*',
+        ),
+
         'getData' => array
         (
             # 匹配的正则或函数 选填项

+ 6 - 1
service/agent/src/My.php

@@ -46,8 +46,13 @@ class My extends Core
         $this->data['num'] = Dever::load('invite/api')->getChildNum($this->uid, 1);
 
         # 获取当前正在申请的订单
-        $order = Dever::db('agent/order')->getOld(array('mid' => $this->uid));
+        $order = Dever::db('agent/order')->getNew(array('mid' => $this->uid));
         if ($order) {
+            $total = Dever::db('agent/order')->getTotal(array('mid' => $this->uid));
+            $this->data['user']['up'] = 2;
+            if ($total > 1) {
+                $this->data['user']['up'] = 1;
+            }
             $this->data['user']['order_id'] = $order['id'];
             $this->data['user']['audit'] = $order['status'];
             if ($order['status'] != 5) {

+ 15 - 0
service/option/database/member.php

@@ -265,5 +265,20 @@ return array
             'type' => 'one',
             'col' => '*',
         ),
+
+        'getDataByKeys' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'main' => 'yes',
+                'start' => array('yes-key', '>='),
+                'end' => array('yes-key', '<='),
+                'state' => 1,
+            ),
+            'order' => array('main' => 'asc','id' => 'desc'),
+            'type' => 'all',
+            'col' => '*',
+        ),
     ),
 );