function getSameProperties($lang, $returnFieldList, $conditionStr, $propertyData, $currentPage) { $conditionParamStr = ilandCommonUtils::genBDSLQConditionParam($conditionStr, $propertyData); //$orderBy = U_ReConfig::getValueByKey( 'PROPERTY', 'bdslq_order' ); /*if ( empty( $orderBy ) ) { $data = U_ReModelProperties::getListProperties( $returnFieldList, $conditionParamStr, $currentPage ); } else {*/ $orderBy = 'ABS(phuong_xa_id-' . $propertyData['phuong_xa_id'] . '), ABS(huong_id-' . $propertyData['huong_id'] . '), ABS(loai_bds_id-' . $propertyData['loai_bds_id'] . ') '; $data = U_ReModelProperties::getListProperties($returnFieldList, $conditionParamStr, $currentPage, $orderBy); //} return $data; }
function compareProperty($ids) { $maxIndex = count($ids) - 1; $where = ' id IN ('; for ($i = 0; $i < $maxIndex; $i++) { $where .= $ids[$maxIndex] . ','; } $where .= $ids[$maxIndex]; $where .= ')'; global $u_reGlobalConfig; $returnField = $u_reGlobalConfig['PROPERTY']['du_lieu_so_sanh_bat_dong_san']; $listData = U_ReModelProperties::getListProperties($returnField, $where, 1, '', $maxIndex + 1); // load template $templateName = JFactory::getApplication()->getTemplate(); $templatePath = JPATH_THEMES . DS . $templateName . DS . "html" . DS . "com_u_re" . DS . "properties"; $this->addTemplatePath($templatePath); $this->setLayout($u_reGlobalConfig['PROPERTY']['compare_template']); $this->assignRef('data', $listData); parent::display(); }
} // tinh lai offet & limit cua tin thuong if ($currentPage == 1) { $newCurrentPage = 1; $newLimit = $limit - count($dataEs); } else { if ($currentPage > 1) { $soTinThuong = $currentPage * $limit - $countEs; $newCurrentPage = floor($soTinThuong / $limit) + 1; $newLimit = $soTinThuong - ($newCurrentPage - 1) * $limit; if ($newLimit == 0) { $newLimit = $limit; } } } $dataFull = U_ReModelProperties::getListProperties($returnField, $conditionParam . $pr1, $newCurrentPage, $ordering, $newLimit); } else { $dataFull = $dataEs; } if (!empty($dataEs)) { if (count($dataEs) >= $limit) { $data = $dataEs; } else { $data = array_merge($dataEs, $dataFull[3]); } } else { $data = $dataFull[3]; } // khong su dung cach count total page nay nua // $count = count( $data ); $currentTemplate = JFactory::getApplication()->getTemplate();