コード例 #1
0
ファイル: Blog.php プロジェクト: bin2415/android-php
 /**
  * Get all blog list 
  * @param int $pageId
  */
 public function getListByPage($pageId = 0)
 {
     $list = array();
     $sql = $this->select()->from($this->t1, '*')->order("{$this->t1}.uptime desc")->limit(10);
     $res = $this->dbr()->fetchAll($sql);
     foreach ($res as $row) {
         $customerDao = new Core_Customer();
         $customer = $customerDao->read($row['customerid']);
         $blog = array('id' => $row['id'], 'face' => NAMESPACE_Util_Image::getFaceUrl($customer['face']), 'content' => '<b>' . $customer['name'] . '</b> : ' . $row['content'], 'comment' => '评论(' . $row['commentcount'] . ')', 'uptime' => $row['uptime']);
         array_push($list, $blog);
     }
     return $list;
 }
コード例 #2
0
ファイル: Customer.php プロジェクト: bin2415/android-php
 /**
  * Get customer by id
  * @param int $id
  */
 public function getById($id)
 {
     $customer = $this->read($id);
     $customer['faceurl'] = NAMESPACE_Util_Image::getFaceUrl($customer['face']);
     return $customer;
 }