ColumnHelper.class.php 1.1 KB
<?php
/**
 * Created by PhpStorm.
 * User: zhonglei
 * Date: 2017/10/10
 * Time: 15:01
 */

namespace Common\Common;

use Common\Model\CommonModel;
use Common\Model\CommonRecommenderModel;

class ColumnHelper
{
    /**
     * 实例化
     * @return ColumnHelper
     */
    public static function &instance()
    {
        static $instance;

        if (empty($instance)) {
            $instance = new self();
        }

        return $instance;
    }

    /**
     * 获取栏目列表
     * @author daijun
     *
     * @return array
     */
    public function list_column_data()
    {
        // 实例化
        $recommenderModel = new CommonRecommenderModel();

        // 组装查询条件
        $conds = [
            'type' => Constant::TYPE_ICON, // 类型为icon
            'hide' => Constant::HIDE_NO    // 是否显示:显示
        ];

        // 组装排序参数
        $order_option = [
            'displayorder' => 'ASC'
        ];

        // 查询并返回栏目列表数据
        return $recommenderModel->list_by_conds($conds, null, $order_option, 'recommender_id,title,hide');

    }
}