viewsonic Reply #1, 3 months, 2 weeks ago
Hi I try to play with XPDO, but seem I miss something to call my result, is there someone can help me on the right direction thanks.
Got result in my phpadmin from this sql query:
Select modx_site_tmplvar_contentvalues.value
FROM modx_site_content INNER JOIN modx_site_tmplvar_contentvalues on modx_site_content.id = modx_site_tmplvar_contentvalues.contentid
WHERE modx_site_content.parent= '100' and modx_site_tmplvar_contentvalues.tmplvarid = 333
ORDER BY cast(modx_site_tmplvar_contentvalues.value AS SIGNED) DESC
try to do this, but without result.
$c = $modx->newQuery('modResource');
$c->innerJoin('modTemplateVarResource', 'TemplateVar', 'TemplateVar.contentid = modResource.id');
$c->where(array('modResource.parent' => 100, 'TemplateVar.tmplvarid' => 333));
$c->limit(5);
$c->sortby("CAST(TemplateVar.value AS SIGNED)", 'DESC');