<?php
/**
 * Copyright (C) LJCMS All rights reserved.
 * <E-Mail：aspcms@qq.com>
 * Url http://www.liangjing.org
 *     http://www.8CMS.com
 * Update 2016.03.19
 */

class friendlinkIModel extends X {
    public function getVolist($where = '', $orderby = '', $num = 0, $limit = '') {
        $c = XRequest::getGpc('c');
        $sql = "SELECT * FROM " . DB_PREFIX .
            "friendlink WHERE flag='1' and (catid='all' or catid='" . $c . "')";
        $sql .= !empty($where) ? ' AND ' . $where : '';
        $sql .= !empty($orderby) ? ' ' . $orderby : ' ORDER BY orders ASC';
        if (!empty($limit)) {
            $sql .= " LIMIT {$limit}";
        } else {
            if ($num > 0) {
                $sql .= " LIMIT {$num}";
            }
        }
        $data = parent::$obj->getall($sql);
        return $data;
        unset($sql);
    }
}
?>
