$query = $this->modx->newQuery('modResource');
$query->leftJoin('modTemplateVarResource', "price", array("modResource.id = price.contentid", "price.tmplvarid = 2"));
$query->where(array("price:>=" => 6000));
$query->prepare();
echo $query->toSql();
回报:
`modResource`.`context_key` AS `modResource_context_key`, `modResource`.`content_type` AS `modResource_content_type`, `modResource`.`uri` AS `modResource_uri`, `modResource`.`uri_override` AS `modResource_uri_override`, `modResource`.`hide_children_in_tree` AS `modResource_hide_children_in_tree`, `modResource`.`show_in_tree` AS `modResource_show_in_tree`, `modResource`.`properties` AS `modResource_properties`
FROM `modx_site_content` AS `modResource`
LEFT JOIN `modx_site_tmplvar_contentvalues` `price`
ON ( modResource.id = price.contentid
AND price.tmplvarid = 2 )
WHERE `modResource`.`price` >= '6000'
为什么要引用整数?它应该被视为一个int。