dever 2 years ago
parent
commit
b91919631c
2 changed files with 35 additions and 11 deletions
  1. 18 11
      database/info.php
  2. 17 0
      lib/Manage.php

+ 18 - 11
database/info.php

@@ -38,8 +38,8 @@ $is_must = array
 $is_sell = array
 (
 	1 => '普通属性',
-	2 => '销售属性',
-	3 => '选择属性',
+	2 => '多价属性',
+	3 => '加价属性',
 );
 
 $data_type = array
@@ -90,6 +90,11 @@ return array
 	'lang' => '属性设置',
 	# 是否显示在后台菜单
 	'order' => 10,
+	'end' => array
+    (
+        'insert' => 'attr/lib/manage.infoUpdate',
+        'update' => 'attr/lib/manage.infoUpdate',
+    ),
 
 	# 数据结构
 	'struct' => array
@@ -128,7 +133,7 @@ return array
 		'cate_id'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '属性类别-用以区分不同属性',
+			'name' 		=> '属性类别-可以通过类别将属性进行分类',
 			'default' 	=> '1',
 			'desc' 		=> '属性类别',
 			'match' 	=> 'is_numeric',
@@ -141,7 +146,7 @@ return array
 		'is_must'	  => array
 		(
 			'type' 		=> 'tinyint-1',
-			'name' 		=> '是否必填-前台在设置属性时是否必填',
+			'name' 		=> '是否必填',
 			'default' 	=> '1',
 			'desc' 		=> '是否必填',
 			'match' 	=> 'is_numeric',
@@ -155,28 +160,30 @@ return array
 		'is_sell'	  => array
 		(
 			'type' 		=> 'tinyint-1',
-			'name' 		=> '属性规则-如果设置为销售属性,将影响价格,如果设置为选择属性,则下单时需要选择该属性,普通属性仅做展示用',
+			'name' 		=> '属性类型-普通属性仅做展示用,需要在后台录入属性具体值;多价属性将会生成不同的SKU组合价格,根据不同的SKU组合生成总价和库存;加价属性将生成单独的属性价格,将影响总价,不影响库存',
 			'default' 	=> '1',
-			'desc' 		=> '属性规则',
+			'desc' 		=> '属性类型',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'radio',
 			'option'	=> $is_sell,
 			'search'	=> 'select',
 			'list'		=> true,
-			'edit'		=> true,
+			//'edit'		=> true,
+			'control'	=> 'is_sell',
 		),
 
 		'type'	  => array
 		(
 			'type' 		=> 'tinyint-11',
-			'name' 		=> '管理类型-属性作为自定义字段,在后台管理中的管理数据类型',
+			'name' 		=> '后台录入类型-配置录入类型后可以在后台商品管理中的属性设置进行设置',
 			'default' 	=> '1',
-			'desc' 		=> '管理类型',
+			'desc' 		=> '后台录入类型',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'radio',
 			'option'	=> $type,
-			'search'	=> 'select',
+			//'search'	=> 'select',
 			'list'		=> true,
+			'show'		=> 'is_sell=1',
 			'control'	=> 'type',
 		),
 
@@ -268,7 +275,7 @@ return array
 			'desc' 		=> '详情页排序',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'text',
-			'show'      => 'type=1,2,7,9,10,11,12',
+			//'show'      => 'type=1,2,7,9,10,11,12',
 			'search'	=> 'order',
 			'order'		=> 'desc',
 			'edit'		=> true,

+ 17 - 0
lib/Manage.php

@@ -30,4 +30,21 @@ class Manage
         	Dever::db($name)->update($update);
         }
     }
+
+    /**
+     * 更新属性信息
+     *
+     * @return mixed
+     */
+    public function infoUpdate($id, $name, $data)
+    {
+        $is_sell = Dever::param('is_sell', $data);
+        if ($is_sell > 1) {
+            $update['type'] = 11;
+        }
+        if (isset($update)) {
+            $update['where_id'] = $id;
+            Dever::db('attr/info')->update($update);
+        }
+    }
 }