Small Swoole Db 2.3 引入左连接:
$selector = (new TableSelector('user')) ->leftJoin('post', 'messageOwner', 'message') ; $selector->where() ->firstCondition(new Condition( new ConditionElement(ConditionElementType::var, 'name', 'user'), ConditionOperator::equal, new ConditionElement(ConditionElementType::const, 'john') ))->andCondition(new Condition( new ConditionElement(ConditionElementType::var, 'subject', 'message'), ConditionOperator::like, new ConditionElement(ConditionElementType::const, '%hiring%') )) ;
packagist:https://packagist.org/packages/small/swoole-db
git : https://git.small-project.dev/lib/small-swoole-db
以上是小Swoole数据库的详细内容。更多信息请关注PHP中文网其他相关文章!