/** * --------------------------------------------------------------------------------------------- * > 接口说明:头像列表接口 * <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[] = NAMESPACE_Util_Image::getFaceImage($id); } $this->render('10000', 'Get face list ok', array('Image.list' => $faceList)); }
/** * 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; }
/** * 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; }