ColumnHelper.class.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?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');
}
}