dever 3 years ago
parent
commit
87d3db4a73
3 changed files with 19 additions and 5 deletions
  1. 1 1
      app/goods/database/info.php
  2. 9 0
      app/shop/lib/Info.php
  3. 9 4
      app/shop/lib/Manage.php

+ 1 - 1
app/goods/database/info.php

@@ -177,7 +177,7 @@ $config = array
             'name'      => '标签',
             'default'   => '',
             'desc'      => '标签',
-            'match'     => 'is_string',
+            'match'     => 'option',
             'update'    => 'checkbox',
             'option'    => $tag,
             //'list'      => true,

+ 9 - 0
app/shop/lib/Info.php

@@ -80,10 +80,19 @@ class Info
         
         $data = Dever::db($table)->$method($where);
 
+        $result_1 = array();
+        $result_2 = array();
         if ($data) {
             foreach ($data as $k => $v) {
                 $data[$k] = $this->getGoodsInfo($where['shop_id'], $v);
+                if ($data[$k]['total'] <= 0) {
+                    $result_2[] = $data[$k];
+                } else {
+                    $result_1[] = $data[$k];
+                }
             }
+
+            $data = array_merge($result_1, $result_2);
         }
 
         return $data;

+ 9 - 4
app/shop/lib/Manage.php

@@ -11,12 +11,17 @@ class Manage
     {
         $info = Dever::db('shop/sell_order')->one($id);
 
-        $user = Dever::db('passport/user')->one($info['uid']);
+        if ($info['uid'] && $info['uid'] > 0) {
+            $user = Dever::db('passport/user')->one($info['uid']);
 
-        $result = $user['username'];
-        if ($info['mobile']) {
-            $result .= '('.$info['mobile'].')';
+            $result = $user['username'];
+            if ($info['mobile']) {
+                $result .= '('.$info['mobile'].')';
+            }
+        } else {
+            $result = $info['mobile'];
         }
+        
         return $result;
     }