Loading src/functions.php +21 −4 Original line number Diff line number Diff line Loading @@ -495,6 +495,13 @@ if (!function_exists('get_collection_values')) { $values[] = $value; } } else { if (is_array($value) || is_countable($collection[$t])) { foreach ($value as $vv) { if (isset($vv[$ik])) { $values[] = $vv[$ik]; } } } break; } } Loading Loading @@ -524,9 +531,13 @@ if (!function_exists('put_collection_values')) { } $valueList = $valueList->keyBy($valueKey); } if (isset($collection[0])) { foreach ($collection as $index => $value) { $collection[$index] = private_put_collection_values($value, $itemKeys, $valueList, $collectionNewKey); } } else { private_put_collection_values($collection, $itemKeys, $valueList, $collectionNewKey); } } return $collection; } Loading @@ -548,7 +559,13 @@ if (!function_exists('private_put_collection_values')) { $t = $itemKeys[0]; unset($itemKeys[0]); $itemKeys = array_values($itemKeys); if (is_array($collection[$t]) || is_countable($collection[$t])) { foreach ($collection[$t] as $k => $v) { $collection[$t][$k] = private_put_collection_values($v, $itemKeys, $valueList, $collectionNewKey); } } else { $collection[$t] = private_put_collection_values($collection[$t], $itemKeys, $valueList, $collectionNewKey); } } else { if (isset($valueList[$collection[$itemKeys[0]]])) { $collection[$collectionNewKey] = $valueList[$collection[$itemKeys[0]]]; Loading @@ -568,7 +585,7 @@ if (!function_exists('human_time')) { */ function human_time($time) { if (is_numeric($time)) { if (!is_numeric($time)) { $time = strtotime($time); } $time = abs($time); Loading Loading
src/functions.php +21 −4 Original line number Diff line number Diff line Loading @@ -495,6 +495,13 @@ if (!function_exists('get_collection_values')) { $values[] = $value; } } else { if (is_array($value) || is_countable($collection[$t])) { foreach ($value as $vv) { if (isset($vv[$ik])) { $values[] = $vv[$ik]; } } } break; } } Loading Loading @@ -524,9 +531,13 @@ if (!function_exists('put_collection_values')) { } $valueList = $valueList->keyBy($valueKey); } if (isset($collection[0])) { foreach ($collection as $index => $value) { $collection[$index] = private_put_collection_values($value, $itemKeys, $valueList, $collectionNewKey); } } else { private_put_collection_values($collection, $itemKeys, $valueList, $collectionNewKey); } } return $collection; } Loading @@ -548,7 +559,13 @@ if (!function_exists('private_put_collection_values')) { $t = $itemKeys[0]; unset($itemKeys[0]); $itemKeys = array_values($itemKeys); if (is_array($collection[$t]) || is_countable($collection[$t])) { foreach ($collection[$t] as $k => $v) { $collection[$t][$k] = private_put_collection_values($v, $itemKeys, $valueList, $collectionNewKey); } } else { $collection[$t] = private_put_collection_values($collection[$t], $itemKeys, $valueList, $collectionNewKey); } } else { if (isset($valueList[$collection[$itemKeys[0]]])) { $collection[$collectionNewKey] = $valueList[$collection[$itemKeys[0]]]; Loading @@ -568,7 +585,7 @@ if (!function_exists('human_time')) { */ function human_time($time) { if (is_numeric($time)) { if (!is_numeric($time)) { $time = strtotime($time); } $time = abs($time); Loading