withJoin 条件错误

浏览:582 发布日期:2019/02/26
5.0.0 - 普通 - 未处理
$tmplist = GlobalCommandModel::withJoin([
'userCommand' => function ($query) use ($appId) {
$query->where('app_id', $appId);
}
], 'LEFT')->where('plugin_id', $pluginId)->select();

生成的sql是:
SELECT xxx FROM `gw_global_command` `global_command` LEFT JOIN `gw_plugin_command` `userCommand` ON `global_command`.`id`=`userCommand`.`command_id` WHERE `userCommand`.`app_id` = '10000001' AND `plugin_id` = 1

期待生成sql是:
SELECT xxx FROM `gw_global_command` `global_command` LEFT JOIN `gw_plugin_command` `userCommand` ON `global_command`.`id`=`userCommand`.`command_id` AND `userCommand`.`app_id` = '10000001' WHERE `plugin_id` = 1

评论(
后面还有条评论,点击查看>>