UserApi::user_photo PHP Method

user_photo() public method

用户相册 --using
public user_photo ( $uid_param ) : array
return array 照片列表
    public function user_photo($uid_param)
    {
        if ($uid_param) {
            $uid = $uid_param;
            $this->count = 4;
        } else {
            if (empty($this->user_id) && empty($this->data['uname'])) {
                $uid = $this->mid;
            } else {
                if ($this->user_id) {
                    $uid = intval($this->user_id);
                } else {
                    $uid = model('User')->where(array('uname' => $this->data['uname']))->getField('uid');
                }
            }
        }
        $max_id = $this->max_id ? intval($this->max_id) : 0;
        $count = $this->count ? intval($this->count) : 20;
        $map['uid'] = $uid;
        $map['attach_type'] = 'feed_image';
        $map['is_del'] = 0;
        !empty($max_id) && ($map['attach_id'] = array('lt', $max_id));
        $list = model('Attach')->where($map)->order('attach_id Desc')->limit($count)->findAll();
        $photo_list = array();
        foreach ($list as $k => $value) {
            $attachInfo = model('Attach')->getAttachById($value['attach_id']);
            $photo_list[$k]['image_id'] = $value['attach_id'];
            $photo_list[$k]['image_url'] = getImageUrl($attachInfo['save_path'] . $attachInfo['save_name']);
        }
        return $photo_list;
    }