Skip to content

未定义数组下标: 1 #90

@geniushuix

Description

@geniushuix

查询坐标的时候报错

in Builder.php line 202 at Error::appError(8, 'Undefined offset: 1', 'D:\xxx\xxx\simple...', 202, ['field' => 'coordinates', 'val' => ['$near' => ['$geometry' => ['type' => 'Point', 'coordinates' => [114.413696, 30.492449]], '$maxDistance' => 200]], 'key' => 'coordinates']) in Builder.php line 202 at Builder->parseWhereItem('coordinates', ['$near' => ['$geometry' => ['type' => 'Point', 'coordinates' => [114.413696, 30.492449]], '$maxDistance' => 200]]) in Builder.php line 173 at Builder->parseWhere(['$and' => ['coordinates' => ['$near' => ['$geometry' => ['type' => 'Point', 'coordinates' => [114.413696, 30.492449]], '$maxDistance' => 200]]]], ['projection' => ['_id' => 1, 'coordinates' => 1], 'where' => ['$and' => ['coordinates' => ['$near' => ['$geometry' => ['type' => 'Point', 'coordinates' => [114.413696, 30.492449]], '$maxDistance' => 200]]]], 'table' => 'SignPlace', ...]) in Builder.php line 440 at Builder->count(['projection' => ['_id' => 1, 'coordinates' => 1], 'where' => ['$and' => ['coordinates' => ['$near' => ['$geometry' => ['type' => 'Point', 'coordinates' => [114.413696, 30.492449]], '$maxDistance' => 200]]]], 'table' => 'SignPlace', ...], null) in Query.php line 450

比如下面的查询条件:
`Array
(
[coordinates] => Array
(
[$near] => Array
(
[$geometry] => Array
(
[type] => Point
[coordinates] => Array
(
[0] => 114.413696
[1] => 30.492449
)
)
[$maxDistance] => 200
)

            )

    )`

是这一行报错:
list($exp, $value) = $val;
$val传过来是个多维数组,这应该是个bug吧,像这种地理坐标的查询一般就是多维数组啊!

请问下这咋解决呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions