| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 | <?php$cate = function(){    $array = array();    $data = Dever::db('work/q_cate')->state();    if($data)    {        $array += $data;    }    return $array;};$branch = function(){    $array = array();    $data = Dever::db('work/branch')->state();    if($data)    {        foreach ($data as $k => $v) {            $group = Dever::db('manage/group')->find($v['group_id']);            $data[$k]['id'] = $v['group_id'];            $data[$k]['name'] = $group['name'];        }        $array += $data;    }    return $array;};$product = function(){    $array = array();    $data = Dever::db('work/product')->state();    if($data)    {        $array += $data;    }    return $array;};$type = array(    1 => '上架',    2 => '下架',);$button = false;if (Dever::load('manage/auth')->checkFunc('work.question', 'qcate', '问题分类设置')){    $button['问题分类设置'] = array('location', 'l=project/database/list&project=work&table=q_cate&&oper_table=question');}if (Dever::load('manage/auth')->checkFunc('work.question', 'qsource', '问题来源设置')){    $button['问题来源设置'] = array('location', 'l=project/database/list&project=work&table=q_source&&oper_table=question');}if (Dever::load('manage/auth')->checkFunc('work.question', 'qpriority', '优先级设置')){    $button['优先级设置'] = array('location', 'l=project/database/list&project=work&table=priority&&oper_table=question');}return array(    # 表名    'name' => 'question',    # 显示给用户看的名称    'lang' => '问题设置',    # 后台菜单排序    'order' => 98,    // 'menu' => false,    // 'auto' => 100000,    # 数据结构    'struct' => array    (        'id'        => array        (            'type'      => 'int-11',            'name'      => 'ID',            'default'   => '',            'desc'      => '',            'match'     => 'is_numeric',            'search'    => 'order',            'list'      => true,            'order'     => 'desc',        ),        'company_id'       => array        (            'type'      => 'int-11',            'name'      => '所属公司',            'default'   => '1',            'desc'      => '所属公司',            'match'     => 'is_numeric',            'update'    => 'hidden',            //'search'    => $company ? 'select' : false,            //'list'      => true,        ),        'name'      => array        (            'type'      => 'varchar-200',            'name'      => '名称',            'default'   => '',            'desc'      => '名称',            'match'     => 'is_string',            'update'    => 'text',            'search'    => 'fulltext',            'list'      => true,        ),        'cate_id'      => array        (            'type'      => 'int-11',            'name'      => '选择所属分类',            'default'   => '-1',            'desc'      => '选择所属分类',            'match'     => 'is_string',            'option'    => $cate,            'update'    => 'select',            'search'    => 'select',            'list'      => true,        ),        'branch_id'      => array        (            'type'      => 'int-11',            'name'      => '关联部门',            'default'   => '-1',            'desc'      => '关联部门',            'match'     => 'is_string',            'search'    => 'select',            'update'    => 'select',            'option'    => $branch,            // Dever::url('lib/appoint.get?level_total=1', 'work'),            'list'      => 'Dever::load("work/lib/manage.branch",{branch_id})',        ),        'product_id'      => array        (            'type'      => 'int-11',            'name'      => '相关系统产品',            'default'   => '-1',            'desc'      => '相关系统产品',            'match'     => 'is_string',            'option'    => $product,            'update'    => 'select',            'list'      => true,        ),        'type'        => array        (            'type'      => 'tinyint-1',            'name'      => '上下架状态',            'default'   => '1',            'desc'      => '上下架状态',            'match'     => 'is_numeric',            'update'    => 'radio',            'option'    => $type,            'search'    => 'select',            'list'      => true,        ),        'reorder'       => array        (            'type'      => 'int-11',            'name'      => '排序-数值越大越靠前',            'default'   => '1',            'desc'      => '请输入排序',            'match'     => 'option',            'update'  => 'text',            'search'    => 'order',            'list'      => true,            'order'     => 'desc',            'edit'      => true,        ),        'state'     => array        (            'type'      => 'tinyint-1',            'name'      => '状态',            'default'   => '1',            'desc'      => '请选择状态',            'match'     => 'is_numeric',        ),                'cdate'     => array        (            'type'      => 'int-11',            'name'      => '创建时间',            'match'     => array('is_numeric', time()),            'desc'      => '',            # 只有insert时才生效            'insert'    => true,            'list'      => 'date("Y-m-d H:i:s", {cdate})',        ),    ),    'manage' => array    (    	//'insert' => false,        'delete' => false,        // 'edit' => false,        'button' => $button,                # 设置公司权限        'company' => 'company_id',    ),    'request' => array    (        // 'getData' => array        // (        //     # 匹配的正则或函数 选填项        //     'option' => array        //     (        //         //'id' => array('yes', '!='),        //         'state' => 1,        //     ),        //     'type' => 'all',        //     'order' => array('id' => 'desc'),        //     'col' => '*|id',        // ),        'getAll' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'branch_id' => 'yes',                // 'id' => array('yes','>'),                'state' => 1,            ),            'type' => 'all',            'order' => array('reorder' => 'desc', 'id' => 'asc'),            'col' => '*',        ),        'getSearchAll' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'cate_id'=>'yes',                'state' => 1,                'type' => 1,            ),            'type' => 'all',            'order' => array('reorder' => 'desc', 'id' => 'asc'),            'col' => 'id as value, name',        ),        'getTotal' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'branch_id'=>'yes',                'state' => 1,                'type' => 1,            ),            'type' => 'count',            // 'order' => array('reorder' => 'desc', 'id' => 'asc'),            'col' => '*',        ),    ),);
 |