dever 3 years ago
parent
commit
faff39ad7d
4 changed files with 24 additions and 3 deletions
  1. 3 1
      app/card/database/order.php
  2. 1 1
      app/card/database/type.php
  3. 1 1
      app/card/lib/Buy.php
  4. 19 0
      app/card/lib/Manage.php

+ 3 - 1
app/card/database/order.php

@@ -48,7 +48,7 @@ return array
                 'col' => 'username',
                 'result' => 'id',
             ),
-            'list'      => 'Dever::load("shop/lib/manage.user", {id})',
+            'list'      => 'Dever::load("card/lib/manage.user", {id})',
         ),
 
         'mobile'        => array
@@ -211,6 +211,7 @@ return array
             # 匹配的正则或函数 选填项
             'option' => array
             (
+                'uid' => 'yes',
                 'name' => array('yes', 'like'),
                 'order_num' => array('yes', 'like'),
                 'start' => array('yes-cdate', '>='),
@@ -229,6 +230,7 @@ return array
             # 匹配的正则或函数 选填项
             'option' => array
             (
+                'uid' => 'yes',
                 'name' => array('yes', 'like'),
                 'order_num' => array('yes', 'like'),
                 'start' => array('yes-cdate', '>='),

+ 1 - 1
app/card/database/type.php

@@ -145,7 +145,7 @@ return array
             'match'     => 'option',
             'update'    => 'image',
             'key'       => '1',
-            'place'     => '672*386',
+            'place'     => '686*160',
         ),
 
         'content'       => array

+ 1 - 1
app/card/lib/Buy.php

@@ -199,7 +199,7 @@ class Buy
         # 计算总价格
         foreach ($card_id as $k => $v) {
             $c = isset($city[$k]) ? $city[$k] : -1;
-            $n = isset($num[$k]) ? $num[$k] : 1;
+            $n = isset($num[$k]) && $num[$k] >= 0 ? $num[$k] : 1;
             $info = Dever::db('card/info')->find($v);
             if (!$info) {
                 continue;

+ 19 - 0
app/card/lib/Manage.php

@@ -6,6 +6,25 @@ use Dever;
 
 class Manage
 {
+    # 获取用户信息
+    public function user($id)
+    {
+        $info = Dever::db('card/order')->one($id);
+
+        if ($info['uid'] && $info['uid'] > 0) {
+            $user = Dever::db('passport/user')->one($info['uid']);
+
+            $result = $user['username'];
+            if ($info['mobile']) {
+                $result .= '('.$info['mobile'].')';
+            }
+        } else {
+            $result = $info['mobile'];
+        }
+        
+        return $result;
+    }
+
     /**
      * 获取礼品卡数量
      *