Jump to content

Problem with sorting


Sradesign
 Share

Recommended Posts

Hi I have an strange problem with sorting of my page details using API.

I use this code for getting the sorted result :

<?php
$notes = $pages->find("parent=/notes/,limit=20,sort=-modified");
foreach($notes as $note){
if($user->name = $note->createdUser->name){
?>
<li style="padding: 5px">
<div class="row">
<div class="col-md-8">
<div class="desc">
<span class="label label-sm bg-<?php echo $crm_color; ?>">
<i class="fa fa-<?php echo $crm_icon; ?>"></i> <?php echo $note->crm_type; ?>
</span>  
<?php echo substr($note->crm_comment, 0, 30).' ...'; ?>
</div>
</div>
<div class="col-md-4 text-right">
<i class="fa fa-clock-o"></i> <?php echo date("Y/m/d h:s", $note->modified); ?>
</div>
</div>
</li>
<?php 
}
} 
?>

and look at the result in attachment the dates are random.

post-3854-0-04236700-1448275010_thumb.jp

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...