<?php namespace Source\Lib;
use Dever;
class Value
{
    # 获取附件列表
    public function getList($info_id)
    {
        $data[0] = array
        (
            'id' => -1,
            'name' => '全部附件',
        );
        $where['info_id'] = $info_id;
        $data = array_merge($data, Dever::db('info_value', 'source')->select($where));
        if ($data) {
            foreach ($data as &$v) {
                if (!$v['name']) {
                    $v['name'] = $v['value'];
                }
                if (!$v['name']) {
                    $v['name'] = $v['id'];
                }
            }
        }
        return $data;
    }
}