/** * Get all blog list * @param int $startId Start Blog ID */ public function getListByPage($startId = 0) { $list = array(); $sql = $this->select()->from($this->t1, '*'); if ($startId > 0) { $sql = $sql->where("{$this->t1}.id > ?", $startId); } $sql = $sql->order("{$this->t1}.uptime desc"); $sql = $sql->limit(5); $res = $this->dbr()->fetchAll($sql); foreach ($res as $row) { $customerDao = new Core_Customer(); $customer = $customerDao->read($row['customerid']); $blog = array('id' => $row['id'], 'face' => Weibo_Util_Image::getFaceUrl($customer['face']), 'content' => '<b>' . $customer['name'] . '</b> : ' . $row['content'], 'comment' => '评论(' . $row['commentcount'] . ')', 'uptime' => $row['uptime']); array_push($list, $blog); } return $list; }
/** * Get customer by id * @param int $id */ public function getById($id) { $customer = $this->read($id); $customer['faceurl'] = Weibo_Util_Image::getFaceUrl($customer['face']); return $customer; }