'小程序', 2 => 'H5', 3 => 'ios', 4 => '安卓', ); $status = array ( 1 => '待支付', 2 => '已支付', 3 => '支付失败', 4 => '待接单', 5 => '待服务', 6 => '用户取消', 7 => '老师取消', 8 => '服务完成', 9 => '已评价', 10 => '已退款', ); $product = function() { return Dever::db('course/info')->state(); }; $seller = function() { $array = array ( -1 => '无', ); $info = Dever::db('seller/info')->state(); if($info) { $array += $info; } return $array; }; $teacher = function() { $array = array ( -1 => '无', ); $info = Dever::db('teacher/info')->state(); if($info) { $array += $info; } return $array; }; $cate = function() { $array = array(); $info = Dever::db('course/cate')->state(); if($info) { $array += $info; } return $array; }; return array ( # 表名 'name' => 'order', # 显示给用户看的名称 'lang' => '订单管理', 'order' => 1, 'end' => array ( //'update' => 'course/lib/pay.order', ), # 数据结构 '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', 'default' => '', 'desc' => '付款订单id', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list' => true, //'list' => '"{order_id}" ? "{order_id}" : "{code}"', ), 'cate_course' => array ( 'name' => '课程', 'default' => '', 'desc' => '课程', 'search' => 'linkage', 'search_col' => 'cate_id,product_id', 'option' => Dever::url('lib/manage.search_cate_course', 'course'), ), 'cate_id' => array ( 'type' => 'int-11', 'name' => '课程分类', 'default' => '1', 'desc' => '课程分类', 'match' => 'is_numeric', 'update' => 'select', 'option' => $cate, //'search' => 'select', 'list' => true, ), 'name' => array ( 'type' => 'varchar-80', 'name' => '订单名称', 'default' => '', 'desc' => '订单名称', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list_name' => '订单信息', 'list' => 'Dever::load("course/lib/manage.showOrderUser", "{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', ), 'product_id' => array ( 'type' => 'int-11', 'name' => '课程', 'default' => '', 'desc' => '课程', 'match' => 'is_numeric', 'update' => 'select', 'option' => $product, //'search' => 'select', //'list' => true, ), 'buy_num' => array ( 'type' => 'int-11', 'name' => '购买数量', 'default' => '', 'desc' => '购买数量', 'match' => 'is_numeric', //'search' => 'select', //'list' => true, ), 'system' => array ( 'type' => 'int-11', 'name' => '系统', 'default' => '1', 'desc' => '系统', 'match' => 'is_numeric', 'option' => $system, 'search' => 'select', 'update' => 'radio', 'list' => true, ), 'teacher_id' => array ( 'type' => 'int-11', 'name' => '讲师', 'default' => '-1', 'desc' => '讲师', 'match' => 'is_numeric', 'update' => 'select', 'option' => $teacher, 'search' => 'select', //'list' => true, ), 'seller_id' => array ( 'type' => 'int-11', 'name' => '销售人', 'default' => '-1', 'desc' => '销售人', 'match' => 'is_numeric', 'update' => 'select', 'option' => $seller, 'search' => 'select', //'list' => true, ), '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' => 'Dever::load("course/lib/manage.showOrderStatus", "{id}")', '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', ), '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}")', ), ), 'manage' => array ( 'delete' => false, 'edit' => false, 'insert' => false, 'button' => array ( //'导出订单' => array('location', 'journal/lib/manage.out'), ), 'list_button' => array( 'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2 && ({type} == 1 || {type} == 3)'), //'delete' => array('删除', '', '{status} == 1'), ), ), 'request' => array ( 'getAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'type' => 'yes', 'status' => array('1', '!='), 'uid' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('cdate' => 'desc'), 'page' => array(10, 'list'), 'col' => '*', ), 'getYes' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'product_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('cdate' => 'desc'), 'col' => '*', ), # 获取提交订单超过12个小时 'getDataByTime' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'cdate' => array('yes', '>='), 'notice' => 'yes', 'note' => 'yes', 'type' => array('yes', 'in'), 'state' => 1, ), 'type' => 'all', 'order' => array('cdate' => 'desc'), 'col' => '*', ), # 获取1,2 'getBuy' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'status' => 'yes', 'type' => array('yes', 'in'), 'product_id' => 'yes', 'order_id' => 'yes', 'uid' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('id' => 'desc'), 'col' => '*', ), 'getNew' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'state' => 1, ), 'type' => 'all', 'order' => array('cdate' => 'desc'), 'limit' => '0,100', 'col' => '*', ), ), );