Skip to content

find没条件查询的时候返回null吗 #806

@runphp

Description

@runphp

比如我下面的代码

$this->where('1 = 1')->field(
            [
                'SUM(CASE WHEN point > 0 THEN point ELSE 0 END) AS positive_total',
                'SUM(CASE WHEN point < 0 THEN point ELSE 0 END) AS negative_total',
            ]
        )->find();//->select()->first();

如果不加where条件就会返回null,或者需要改用select查询

版本 v4.0.50

我记得 think-orm 3 不是这样哦,请问下是不是有问题

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