mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
Collection类改进
This commit is contained in:
@@ -16,20 +16,6 @@ use think\Model;
|
|||||||
|
|
||||||
class Collection extends BaseCollection
|
class Collection extends BaseCollection
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* 返回数组中指定的一列
|
|
||||||
* @param string $column_key
|
|
||||||
* @param string|null $index_key
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function column($column_key, $index_key = null)
|
|
||||||
{
|
|
||||||
if (function_exists('array_column')) {
|
|
||||||
return array_column($this->toArray(), $column_key, $index_key);
|
|
||||||
}
|
|
||||||
return parent::column($column_key, $index_key);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 延迟预载入关联查询
|
* 延迟预载入关联查询
|
||||||
* @access public
|
* @access public
|
||||||
|
|||||||
Reference in New Issue
Block a user