dever 5 years ago
parent
commit
6d46c32b27
4 changed files with 16 additions and 24 deletions
  1. 5 3
      database/info.php
  2. 1 0
      database/search.php
  3. 1 0
      database/value.php
  4. 9 21
      src/Api.php

+ 5 - 3
database/info.php

@@ -146,6 +146,7 @@ return array
 			'option'	=> $is_must,
 			'search'	=> 'select',
 			'list'		=> true,
+			'edit'		=> true,
 		),
 
 		'is_sell'	  => array
@@ -159,6 +160,7 @@ return array
 			'option'	=> $is_sell,
 			'search'	=> 'select',
 			'list'		=> true,
+			'edit'		=> true,
 		),
 
 		'type'	  => array
@@ -229,7 +231,7 @@ return array
 		(
 			'type' 		=> 'int-11',
 			'name' 		=> '列表页排序-设置该属性在列表页中的排序,数字越大越靠前,如果为负数或者0,则不加入到列表页中。',
-			'default' 	=> '-1',
+			'default' 	=> '1',
 			'desc' 		=> '是否作为搜索条件',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'text',
@@ -244,7 +246,7 @@ return array
 		(
 			'type' 		=> 'int-11',
 			'name' 		=> '搜索条件排序-设置搜索条件中的排序,数字越大越靠前,如果为负数或者0,则不加入到搜索条件中。',
-			'default' 	=> '-1',
+			'default' 	=> '1',
 			'desc' 		=> '是否作为搜索条件',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'text',
@@ -259,7 +261,7 @@ return array
 		(
 			'type' 		=> 'int-11',
 			'name' 		=> '详情页排序-设置该属性在详情页中的排序,数字越大越靠前,如果为负数或者0,则不加入到详情页中。',
-			'default' 	=> '-1',
+			'default' 	=> '1',
 			'desc' 		=> '详情页排序',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'text',

+ 1 - 0
database/search.php

@@ -110,6 +110,7 @@ return array
             'option' => array
             (
                 'info_id' => 'yes',
+                'ids' => array('yes-id', 'in'),
                 'state' => 1,
             ),
             'type' => 'all',

+ 1 - 0
database/value.php

@@ -121,6 +121,7 @@ return array
             'option' => array
             (
                 'info_id' => 'yes',
+                'ids' => array('yes-id', 'in'),
                 'state' => 1,
             ),
             'type' => 'all',

+ 9 - 21
src/Api.php

@@ -277,38 +277,26 @@ class Api
 		# 地区
 		if ($info['type'] == 7) {
 			$info['value'] = Dever::load("area/api.string", $info['value']);
+			/*
 			$info['value'] = explode(',', $info['value']);
 			$temp = end($info['value']);
 			$info['value'] = $temp;
+			*/
 		} elseif ($info['type'] == 9 && $info['value']) {
 			$info['value'] = explode(',', $info['value']);
-			$info['value'] = $info['value'][0];
+			$info['value'] = $info['value'][0] . $info['unit'];
 		} elseif ($info['type'] > 9 && $info['value']) {
-			$value = Dever::db('attr/value')->getData(array('info_id' => $info['id']));
+			$value = Dever::db('attr/value')->getData(array('ids' => $info['value']));
 			if ($value) {
-				if (isset($value[$info['value']])) {
-					$info['value'] = $value[$info['value']]['name'];
-				}
-			}
-			/*
-			$temp = explode("\n", $info['type_option']);
-			if ($temp) {
-				$info['value'] = $info['value'] - 1;
-				if (isset($temp[$info['value']])) {
-					$info['value'] = $temp[$info['value']];
-					if (strstr($info['value'], ',')) {
-						$temp = explode(',', $info['value']);
-						$info['value'] = $temp[0];
-					}
+				$name = array();
+				foreach ($value as $k => $v) {
+					$name[] = $v['name'] . $info['unit'];
 				}
+				$info['value'] = implode(',', $name);
 			}
-			*/
-		}
-
-		if ($info['unit']) {
+		} elseif ($info['unit']) {
 			$info['value'] = $info['value'] . $info['unit'];
 		}
-
 		return $info['value'];
 	}