Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-micro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-micro
Commits
ae8b3c68
Commit
ae8b3c68
authored
Jun 19, 2020
by
梁俊杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复函数bug
parent
1ecb889a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
functions.php
src/functions.php
+21
-4
No files found.
src/functions.php
View file @
ae8b3c68
...
@@ -495,6 +495,13 @@ if (!function_exists('get_collection_values')) {
...
@@ -495,6 +495,13 @@ if (!function_exists('get_collection_values')) {
$values
[]
=
$value
;
$values
[]
=
$value
;
}
}
}
else
{
}
else
{
if
(
is_array
(
$value
)
||
is_countable
(
$collection
[
$t
]))
{
foreach
(
$value
as
$vv
)
{
if
(
isset
(
$vv
[
$ik
]))
{
$values
[]
=
$vv
[
$ik
];
}
}
}
break
;
break
;
}
}
}
}
...
@@ -524,9 +531,13 @@ if (!function_exists('put_collection_values')) {
...
@@ -524,9 +531,13 @@ if (!function_exists('put_collection_values')) {
}
}
$valueList
=
$valueList
->
keyBy
(
$valueKey
);
$valueList
=
$valueList
->
keyBy
(
$valueKey
);
}
}
if
(
isset
(
$collection
[
0
]))
{
foreach
(
$collection
as
$index
=>
$value
)
{
foreach
(
$collection
as
$index
=>
$value
)
{
$collection
[
$index
]
=
private_put_collection_values
(
$value
,
$itemKeys
,
$valueList
,
$collectionNewKey
);
$collection
[
$index
]
=
private_put_collection_values
(
$value
,
$itemKeys
,
$valueList
,
$collectionNewKey
);
}
}
}
else
{
private_put_collection_values
(
$collection
,
$itemKeys
,
$valueList
,
$collectionNewKey
);
}
}
}
return
$collection
;
return
$collection
;
}
}
...
@@ -548,7 +559,13 @@ if (!function_exists('private_put_collection_values')) {
...
@@ -548,7 +559,13 @@ if (!function_exists('private_put_collection_values')) {
$t
=
$itemKeys
[
0
];
$t
=
$itemKeys
[
0
];
unset
(
$itemKeys
[
0
]);
unset
(
$itemKeys
[
0
]);
$itemKeys
=
array_values
(
$itemKeys
);
$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
);
$collection
[
$t
]
=
private_put_collection_values
(
$collection
[
$t
],
$itemKeys
,
$valueList
,
$collectionNewKey
);
}
}
else
{
}
else
{
if
(
isset
(
$valueList
[
$collection
[
$itemKeys
[
0
]]]))
{
if
(
isset
(
$valueList
[
$collection
[
$itemKeys
[
0
]]]))
{
$collection
[
$collectionNewKey
]
=
$valueList
[
$collection
[
$itemKeys
[
0
]]];
$collection
[
$collectionNewKey
]
=
$valueList
[
$collection
[
$itemKeys
[
0
]]];
...
@@ -568,7 +585,7 @@ if (!function_exists('human_time')) {
...
@@ -568,7 +585,7 @@ if (!function_exists('human_time')) {
*/
*/
function
human_time
(
$time
)
function
human_time
(
$time
)
{
{
if
(
is_numeric
(
$time
))
{
if
(
!
is_numeric
(
$time
))
{
$time
=
strtotime
(
$time
);
$time
=
strtotime
(
$time
);
}
}
$time
=
abs
(
$time
);
$time
=
abs
(
$time
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment