system_source; $status = Dever::config('base', 'pay')->pay['status']; $info = function() { return Dever::db('collection/info')->state(); }; $buy = function() { return Dever::db('collection/buy')->state(); }; # 获取分类权限 $auth = Dever::tops(); $cate = function() use ($auth) { $array = array(); if ($auth) { $info = Dever::db('collection/cate')->getIds(array('ids' => $auth)); } else { $info = Dever::db('collection/cate')->state(); } if($info) { $array += $info; } return $array; }; return array ( # 表名 'name' => 'ticket_order', # 显示给用户看的名称 'lang' => '门票订单', 'order' => 1, 'end' => array ( 'update' => 'user/lib/manage.refund', ), # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'search' => 'order', //'list' => true, ), 'order_id' => array ( 'type' => 'varchar-100', 'name' => '支付订单ID/订单表ID', 'default' => '', 'desc' => '付款订单id', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', //'list' => true, 'list' => 'Dever::load("user/lib/ticket.getOrderIdAndId", "{order_id}", {id})', ), 'uid' => array ( 'type' => 'int-11', 'name' => '用户名', 'default' => '', 'desc' => '用户id', 'match' => 'is_numeric', 'search' => array ( 'api' => 'passport/user-all', 'col' => 'username', 'result' => 'id', ), 'update' => 'text', ), 'parent_uid' => array ( 'type' => 'int-11', 'name' => '邀请人', 'default' => '', 'desc' => '邀请人', 'match' => 'is_numeric', 'update' => 'text', ), 'system_source' => array ( 'type' => 'tinyint-1', 'name' => '所属平台', 'default' => '1', 'desc' => '所属平台', 'match' => 'is_numeric', 'option' => $system_source, 'update' => 'radio', 'search' => 'select', 'list' => true, ), # 仅用于搜索 'cate_info_search' => array ( 'name' => '合集', 'default' => '', 'desc' => '合集', 'search' => 'linkage', 'search_col' => 'cate_id,info_id', 'option' => Dever::url('lib/manage.search_cate_journal', 'collection'), ), 'cate_id' => array ( 'type' => 'int-11', 'name' => '合集分类', 'default' => '1', 'desc' => '合集分类', 'match' => 'is_numeric', 'update' => 'select', 'option' => $cate, //'search' => 'select', 'list' => true, ), 'info_id' => array ( 'type' => 'int-11', 'name' => '合集ID', 'default' => '', 'desc' => '合集ID', 'match' => 'is_numeric', 'update' => 'select', 'option' => $info, //'search' => 'select', //'list' => true, ), 'object_id' => array ( 'type' => 'int-11', 'name' => '项目', 'default' => '', 'desc' => '项目', 'match' => 'is_numeric', 'update' => 'select', //'search' => 'select', //'list' => true, ), 'buy_id' => array ( 'type' => 'int-11', 'name' => '购买本数ID', 'default' => '', 'desc' => '购买本数ID', 'match' => 'is_numeric', 'update' => 'select', 'option' => $buy, //'search' => 'select', //'list' => true, ), 'buy_num' => array ( 'type' => 'int-11', 'name' => '购买数量', 'default' => '', 'desc' => '购买数量', 'match' => 'is_numeric', //'search' => 'select', //'list' => true, ), 'name' => array ( 'type' => 'varchar-80', 'name' => '订单名称', 'default' => '', 'desc' => '订单名称', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list_name' => '订单信息', 'list' => 'Dever::load("user/lib/manage.showOrderUser", "{id}")', ), 'cash' => array ( 'type' => 'varchar-50', 'name' => '支付金额', 'default' => '', 'desc' => '支付金额', 'match' => 'option', 'update' => 'text', 'list' => true, ), 'status' => array ( 'type' => 'tinyint-1', 'name' => '订单状态', 'default' => '1', 'desc' => '请选择订单状态', 'match' => 'is_numeric', 'option' => $status, 'search' => 'select', 'update' => 'radio', 'list' => true, 'list' => 'Dever::load("user/lib/manage.showOrderStatus", "{id}", "ticket")', 'control' => 'status', ), 'tk_pic' => array ( 'type' => 'varchar-150', 'name' => '退款截图', 'default' => '', 'desc' => '退款截图', 'match' => 'is_string', 'update' => 'image', 'key' => 1 ), 'tk_time' => array ( 'type' => 'int-11', 'name' => '退款时间', 'default' => '', 'desc' => '退款时间', 'match' => 'option', //'list' => true, //'update' => 'date', 'callback' => 'maketime', 'show' => 'status=5', ), 'tk_admin' => array ( 'type' => 'int-11', 'name' => '退款审核人', 'default' => '1', 'desc' => '退款审核人', 'match' => 'option', //'list' => true, 'show' => 'status=5', ), 'tk_desc' => array ( 'type' => 'varchar-300', 'name' => '退款备注', 'default' => '', 'desc' => '退款备注', 'match' => 'option', 'update' => 'textarea', //'show' => 'status=5', ), 'info' => array ( 'type' => 'varchar-300', 'name' => '订单备注', 'default' => '', 'desc' => '订单备注', 'match' => 'option', 'update' => 'textarea', //'show' => 'status=5' //'list' => '"{info}" ? "{info}" : "双击添加备注"', //'edit' => true, ), 'mobile' => array ( 'type' => 'varchar-300', 'name' => '下单手机号', 'default' => '', 'desc' => '手机号', 'match' => 'option', //'show' => 'status=5' 'search' => array ( 'api' => 'passport/user-all',//接口地址,最好是获取多条数据的地址 'col' => 'mobile',//要查询的字段 'result' => 'id',//返回的字段 'search' => 'uid',//本表的字段,默认为当前的字段 ), ), 'note' => array ( 'type' => 'tinyint-1', 'name' => '是否发送状态提醒-1未发送,2已发送', 'default' => '1', 'desc' => '请选择状态', 'match' => 'is_numeric', ), 'notice' => array ( 'type' => 'int-11', 'name' => '模板消息提醒次数', 'default' => '0', 'desc' => '模板消息提醒次数', 'match' => 'is_numeric', ), '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, 'search' => 'date', 'list' => 'date("Y-m-d H:i:s", {cdate})', //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")', ), ), 'top' => Dever::config('base')->top, # 增加这个,为了给当前的list增加一个option 'top_option' => array ( 'value' => $auth, 'col' => 'cate_id', ), 'manage' => array ( 'delete' => false, 'edit' => false, 'insert' => false, 'button' => array ( //'导出订单' => array('location', 'user/lib/manage.out'), ), 'list_button' => array( 'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2'), //'delete' => array('删除', '', '{status} == 1'), ), ), 'request' => array ( 'getList' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'info_id' => 'yes', 'uid' => 'yes', 'status' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('cdate' => 'desc'), 'page' => array(5, 'list'), 'col' => '*', ), 'getAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'uid' => 'yes', 'status' => array('1', '!='), 'state' => 1, ), 'type' => 'all', 'order' => array('cdate' => 'desc'), 'page' => array(10, 'list'), 'col' => '*', ), 'getYes' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'info_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('cdate' => 'desc'), 'col' => '*', ), # 获取提交订单超过12个小时 'getDataByTime' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'cdate' => array('yes', '>='), 'notice' => 'yes', 'note' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('cdate' => 'desc'), 'col' => '*', ), # 获取1,2 'getBuy' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'status' => 'yes', 'info_id' => 'yes', 'order_id' => 'yes', 'uid' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('id' => 'desc'), 'col' => '*', ), 'getMyAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'uid' => 'yes', 'status' => 'yes', 'cate_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('id' => 'desc'), 'page' => array(10, 'list'), 'col' => 'id,order_id,name,buy_num,cdate,cash,info_id,buy_id', ), # 删除未支付订单 'drop' => array ( # 匹配的正则或函数 选填项 'where' => array ( 'time' => array('yes-cdate', '<='), 'status' => 1, 'state' => 1, ), 'type' => 'delete', 'col' => 'id,order_id', ), # 获取数据 'getAllByDate' => array ( # 匹配的正则或函数 选填项 'where' => array ( 'time' => array('yes-cdate', '<='), ), 'type' => 'all', 'col' => 'id,order_id', ), 'getNum' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'object_id' => 'yes', 'info_id' => 'yes', 'state' => 1, ), 'type' => 'one', 'col' => 'sum(buy_num) as buy_num', ), ), );