我正在使用此页面列出页面的所有用户。我使用自定义分页列出它,现在我必须使用ajax或jquery使用无限滚动显示。 google / stackoverflowed许多解决方案nothings似乎与页面中的自定义分页一起使用
$paging_Obj = new Pagination();
$perPagerecord = 6;
$page = $this->getRequest()->getParam('page');
if($page){
$start = ($page - 1) * $perPagerecord;
}else{
$start = 0;
}
if($page == 0){
$page = 1;
}
$prev = $page - 1;
$next = $page + 1;
$limitCond = "LIMIT $start, $perPagerecord";
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
//echo $artistTotalQuery = "SELECT * FROM marketplace_userdata WHERE mageuserid IN (SELECT userid FROM marketplace_product GROUP BY userid) AND partnerstatus = 'Seller' AND wantpartner = '1' ORDER BY autoid ASC";die;
$artistTotalQuery = "SELECT mu.*,cev.value as first_name,cev1.value as last_name FROM marketplace_userdata as mu LEFT JOIN customer_entity_varchar AS cev ON (cev.entity_id = mu.mageuserid) AND (cev.attribute_id = '5') LEFT JOIN customer_entity_varchar AS cev1 ON (cev1.entity_id = mu.mageuserid) AND (cev1.attribute_id = '7') WHERE mu.mageuserid IN (SELECT userid FROM marketplace_product GROUP BY userid) AND mu.partnerstatus = 'Seller' AND mu.wantpartner = '1'
GROUP BY cev.entity_id ORDER BY cev1.value ASC";
$sellerlist_total = $readConnection->fetchAll($artistTotalQuery);
$count = count($sellerlist_total);
$artistQuery = "SELECT mu.*,cev.value as first_name,cev1.value as last_name FROM marketplace_userdata as mu LEFT JOIN customer_entity_varchar AS cev ON (cev.entity_id = mu.mageuserid) AND (cev.attribute_id = '5') LEFT JOIN customer_entity_varchar AS cev1 ON (cev1.entity_id = mu.mageuserid) AND (cev1.attribute_id = '7') WHERE mu.mageuserid IN (SELECT userid FROM marketplace_product GROUP BY userid) AND mu.partnerstatus = 'Seller' AND mu.wantpartner = '1' GROUP BY cev.entity_id ORDER BY cev1.value ASC $limitCond";
$sellerlist = $readConnection->fetchAll($artistQuery);
if($count>0){
?>
<?php
$categories = Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('*')->addIsActiveFilter();
$allcatid = array();
$k=0;
foreach ($categories as $c) {
$allcatid[$k] = $c->getId();
$k++;
}
$finalcat=array_shift($allcatid);
?>
<div class="div_Row">
<?php
$pagination = "";
$nextDisplayPagesLimit = 3;
$callPaging = $paging_Obj->Pagination($pagination,$count,$nextDisplayPagesLimit,$perPagerecord,$page,$next,$prev,$redirectUrl);
echo $callPaging;
?>
</div>
</div>
</div>
<div class="div_Row">
<?php
$m = 1;
foreach($sellerlist as $seller){
$customerid=$seller['mageuserid'];
$customer=Mage::getModel('customer/customer')->load($customerid);
/*********User Total Products and get last add product image Start************/
$query = "SELECT count(*) as total, max(mageproductid) as lastProduct_id FROM marketplace_product WHERE userid = $customerid";
$Product_result = $readConnection->fetchAll($query);
$totalProducts = $Product_result[0]['total'];
if(isset($totalProducts) && $totalProducts > 0){
$product_id = $Product_result[0]['lastProduct_id'];
$productDetails = Mage::getModel('catalog/product')->load($product_id);
$height = $this->helper('catalog/image')->init($productDetails, 'small_image')->getOriginalHeight();
$width = $this->helper('catalog/image')->init($productDetails, 'small_image')->getOriginalWidth();
$Product_image = $this->helper('catalog/image')->init($productDetails, 'small_image');
}else{
$Product_image = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).$APHolder;
//$profileURLArtist = Mage::getUrl()."marketplace/seller/profile/".$seller['profileurl']."/list";
$profileURLArtist = Mage::getUrl()."artist/".$seller['profileurl'];
?>
<div class="Artist_list_box span4">
<div class="Artist_main_img">
<a class="product-image-listing" href="<?php echo $profileURLArtist; ?>">
<img alt="<?php echo $customer_name; ?>" title="" src="<?php echo $Product_image;?>" style="width:<?php echo $widthRe."px";?>;max-width:<?php echo $widthRe."px";?>;margin-top:<?php echo $imageHeightDiff."px";?>; margin-left:<?php echo $imageWidthDiff."px";?>;">
</a>
</div>
<div class="List_inner_box">
<!-- <div class="List_them_bg">
</div>-->
<div class="List_inner_text">
<div class="list_Name_title">
<a href="<?php echo $profileURLArtist; ?>"><?php echo $customer_name; ?></a>
<?php if($city!='' && $country!=''){?>
<span> <?php echo $city.", ".$country;?></span>
<?php }?>
<div class="pieces"><p style="margin-bottom:0;"><?php echo $totalProducts?> Artworks</p></div>
</div>
<div class="List_them">
<a href="<?php echo $profileURLArtist; ?>">
<img style="height:50px;width:50px;" alt="<?php echo $customer_name; ?>" src="<?php echo $logo;?>">
</a>
</div>
<div class="list_text"><?php //echo $customer_desc;?></div>
</div>
</div>
</div>
<?php if($m % 4 == 0){?>
<div style="clear:both"></div>
<?php } $m++;?>
<?php
} ?>
</div>
<div class="div_Row">
<div class="pager">
<?php
$pagination = "";
$nextDisplayPagesLimit = 3;
$callPaging = $paging_Obj->Pagination($pagination,$count,$nextDisplayPagesLimit,$perPagerecord,$page,$next,$prev,$redirectUrl);
echo $callPaging;
?>
</div>
</div>
<?php