Authored by xuqi

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

framework @ 119c247f
1 -Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2 1 +Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
@@ -98,7 +98,8 @@ @@ -98,7 +98,8 @@
98 position: fixed; 98 position: fixed;
99 right: 1px; 99 right: 1px;
100 border-radius: 6px; 100 border-radius: 6px;
101 - background: rgba(0,0,0,.8); 101 + background: rgba(0,0,0,.8);
  102 + z-index: 2;
102 b { 103 b {
103 height: 16px; 104 height: 16px;
104 105
@@ -108,11 +108,51 @@ class ClassModel @@ -108,11 +108,51 @@ class ClassModel
108 foreach ($classesData as $val) { 108 foreach ($classesData as $val) {
109 foreach ($val['ca'] as $single) { 109 foreach ($val['ca'] as $single) {
110 $classes[$single['id']] = $single['name']; 110 $classes[$single['id']] = $single['name'];
111 - $classes += array_column($single['sub'], 'name', 'id'); 111 + $classes += self::array_column($single['sub'], 'name', 'id');
112 } 112 }
113 } 113 }
114 114
115 return $classes; 115 return $classes;
116 } 116 }
  117 +
  118 +
  119 + /**
  120 + * 自定义array_column函数
  121 + *
  122 + * @return array 返回数组中指定的一列组成的数组
  123 + */
  124 + /**
  125 + * 自定义array_column函数
  126 + * @param array $input 需要取出数组咧的多维数组
  127 + * @param string $columnKey 需要返回的列
  128 + * @param mixed $indexKey 作为返回数组的索引值
  129 + * @return array 从多维数组中返回单列数组
  130 + */
  131 + private static function array_column(array $input, $columnKey, $indexKey = null)
  132 + {
  133 + $array = array();
  134 + foreach ($input as $value) {
  135 + if ( ! isset($value[$columnKey])) {
  136 + trigger_error("Key \"$columnKey\" does not exist in array");
  137 + return false;
  138 + }
  139 + if (is_null($indexKey)) {
  140 + $array[] = $value[$columnKey];
  141 + }
  142 + else {
  143 + if ( ! isset($value[$indexKey])) {
  144 + trigger_error("Key \"$indexKey\" does not exist in array");
  145 + return false;
  146 + }
  147 + if ( ! is_scalar($value[$indexKey])) {
  148 + trigger_error("Key \"$indexKey\" does not contain scalar value");
  149 + return false;
  150 + }
  151 + $array[$value[$indexKey]] = $value[$columnKey];
  152 + }
  153 + }
  154 + return $array;
  155 +
  156 + }
117 157
118 } 158 }