dever 5 éve
szülő
commit
2317de6711
3 módosított fájl, 40 hozzáadás és 8 törlés
  1. 33 5
      database/info.php
  2. 5 1
      lib/Info.php
  3. 2 2
      lib/Manage.php

+ 33 - 5
database/info.php

@@ -35,6 +35,12 @@ $type = array
 	11 => '其他',
 );
 
+$price_type = array
+(
+	1 => '单一价格',
+	2 => '多种价格(需进行sku设置)',
+);
+
 $mode = array
 (
 	1 => '快递',
@@ -149,6 +155,18 @@ $config = array
 			'show'		=> 'type=2,4',
 		),
 
+		'price_type'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '价格类型',
+			'default' 	=> '1',
+			'desc' 		=> '价格类型',
+			'match' 	=> 'is_numeric',
+			'update'	=> 'radio',
+			'option'	=> $price_type,
+			'control'	=> 'price_type',
+		),
+
 		'price'		=> array
 		(
 			'type' 		=> 'varchar-50',
@@ -157,7 +175,7 @@ $config = array
 			'desc' 		=> '售价',
 			'match' 	=> 'option',
 			'update'	=> 'text',
-			'show'		=> 'type=2,3,4,11',
+			'show'		=> 'price_type=1',
 		),
 
 		's_price'		=> array
@@ -168,7 +186,17 @@ $config = array
 			'desc' 		=> '原价',
 			'match' 	=> 'option',
 			'update'	=> 'text',
-			'show'		=> 'type=2,3,4,11',
+			'show'		=> 'price_type=1',
+		),
+
+		'num'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '库存',
+			'default' 	=> '',
+			'desc' 		=> '库存',
+			'match' 	=> 'option',
+			'update'	=> 'text',
 		),
 
 		'brand_id'		=> array
@@ -403,13 +431,13 @@ $config = array
 				&search_option_category={category}
 				&oper_parent=info&oper_project=goods
 				&oper_save_jump=info
-				&where_id={id}"', '{type} == 1'),
+				&where_id={id}"', '{price_type} == 2'),
 
 			'list' => array('sku设置', '"info_sku
 				&project=goods
 				&search_option_info_id={id}
 				&oper_parent=info&oper_project=goods
-				&oper_save_jump=info&page_type=1"', '{type} == 1'),
+				&oper_save_jump=info&page_type=1"', '{price_type} == 2'),
 			'br1' => array('<br />'),
 			'delete' => '删除',
 		),
@@ -501,7 +529,7 @@ $config = array
                 'id' => 'yes',
             ),
             'type' => 'one',
-            'col' => 'id,name,category,brand_id,shop_id,pic_cover,pic,sell_num+sell_add_num as sell_num,content,type,price,s_price,link,code',
+            'col' => 'id,name,category,brand_id,shop_id,pic_cover,pic,sell_num+sell_add_num as sell_num,content,type,price_type,price,s_price,num,link,code',
         ),
 	),
 );

+ 5 - 1
lib/Info.php

@@ -257,10 +257,14 @@ class Info
     # 获取基本信息
     public function info($info, $key = 'list_reorder', $is_sell = false)
     {
+        $info['freight'] = 0;
         if ($info['type'] == 1) {
             # 获取运费
             $info['freight'] = $this->freight($info);
-
+        }
+        
+        if ($info['price_type'] == 2) {
+            
             $attr = $this->setAttr($info['category'], $key);
             $attr_data = $attr->one($info['id']);
             $info['category_array'] = Dever::load('category/api')->string($info['category']);

+ 2 - 2
lib/Manage.php

@@ -248,6 +248,7 @@ class Manage
 
         $info = Info::init(-1)->info($info, 'list_reorder');
 
+        $html = '请先选择属性';
         if ($info['sell_attr']) {
             $head = '<thead><tr>';
             $body = '<tbody>';
@@ -297,10 +298,9 @@ class Manage
 
             $body .= '</tbody>';
             
+            $html = $head . $body;
         }
 
-        $html = $head . $body;
-
         return $html;
     }