/** * --------------------------------------------------------------------------------------------- * > 接口说明:头像列表接口 * <code> * URL地址:/image/faceList * 提交方式:GET * </code> * --------------------------------------------------------------------------------------------- * @title 头像列表接口 * @action /image/faceList * @method get */ public function faceListAction() { // valid face ids $faceId = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14); // get face images $faceList = array(); foreach ($faceId as $id) { $faceList[] = Weibo_Util_Image::getFaceImage($id); } $this->render('10000', 'Get face list ok', array('Image.list' => $faceList)); }
/** * 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; }