| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629 | <?php$pay_status = Dever::config('base', 'pay')->pay['status'];$audit = array(    //1 => '待审核',    2 => '审核通过',    3 => '审核未通过',);$type = Dever::db('agent/member_goods')->config['set']['type'];$dh_type = array(	1 => '兑换',	2 => '自动发放',);$mid = Dever::input('search_option_mid');$button = array();if ($mid) {    $button = array    (        '返回上一页' => array('location', 'l=project/database/list&project=agent&table=member_area&page_type=1&mid=' . $mid),    );}else{    if(Dever::load('manage/auth')->checkFunc('agent.dh_order', 'editQorderout', '数据导出')){        $button = array        (            '数据导出' => array('excel', 'agent/lib/dhorder.out_dhorder'),        );    }    }$list2_button = array();if (Dever::load('manage/auth')->checkFunc('agent.dh_order', 'edit', '审核')){     $list2_button = array('审核', '"dh_order_goods&project=agent&order_id={id}&audit=1&page_type=1"', '{status} == 2');}$status = array(    1 => array('name' => '待支付', 'style' => 'font-weight:bold;color:#436EEE'),    2 => array('name' => '待审核', 'style' => 'font-weight:bold;color:#436EEE'),    3 => array('name' => '已审核(未发货)', 'style' => 'font-weight:bold;color:green'),    4 => array('name' => '已审核(已发货)', 'style' => 'font-weight:bold;color:green'),    5 => array('name' => '已完成', 'style' => 'font-weight:bold;color:green'),    6 => array('name' => '已完成(有退款)', 'style' => 'font-weight:bold;color:green'),    7 => array('name' => '作废', 'style' => 'font-weight:bold;color:#CD3700'),    8 => array('name' => '已退款', 'style' => 'font-weight:bold;color:#CD3700'),    11 => array('name' => '已过期', 'style' => 'font-weight:bold;color:#CD3700'),);$refund_status = array(    1 => '未申请',    2 => '申请中',    3 => '有退款',    4 => '已退款',);$mid = Dever::input('search_option_mid');return array(    # 表名    'name' => 'dh_order',    # 显示给用户看的名称    'lang' => '权益订单',    'order' => 80,    'status' => $status,    'end' => array    (        //'insert' => 'agent/lib/manage.sellOrderUpdate',        'update' => 'agent/lib/manage.sellOrderUpdate',    ),    # 数据结构    'struct' => array    (            'id'        => array        (            'type'      => 'int-11',            'name'      => 'ID',            'default'   => '',            'desc'      => '',            'match'     => 'is_numeric',            'search'    => 'order',            //'list'      => true,        ),         'shop_id'      => array        (            'type'      => 'int-11',            'name'      => '门店名称',            'default'   => '',            'desc'      => '门店名称',            'match'     => 'is_numeric',            'search'    => 'select',            'update'    => 'hidden',        ),        'mid'      => array        (            'type'      => 'int-11',            'name'      => '代理商姓名/手机号',            'default'   => '-1',            'desc'      => '代理商',            'match'     => 'is_string',            'update'    => 'text',            'search'    => array            (                'api' => 'agent/member-getSearch',                'col' => 'col',                'result' => 'id',                'search' => 'mid',            ),            'list_name' => '行权人',            'list'      => 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)',            'list_order' => 3,        ),        'mobile'        => array        (            'type'      => 'varchar-300',            'name'      => '手机号',            'default'   => '',            'desc'      => '手机号',            'match'     => 'option',            //'search'    => $mid ? 'hidden' : 'fulltext',            // 'list'      => true,            'list'      =>'Dever::load("agent/lib/member.set_mobile", {id})',            'list_order' => 4,        ),        'agent-member-mobile'=> array        (            'name'      => '名称',            'default'   => '',            'desc'      => '手机号',            'match'     => 'option',            'searchs'    => array            (                'api' => 'agent/member-find',                'col' => 'name',                'result' => 'id',                'search' => 'mid',            ),            # 读取另外表的关联方式            'sync'      => array('mid', 'id'),        ),        'agent-member-idcard'=> array        (            'name'      => '身份证号',            'default'   => '',            'desc'      => '手机号',            'match'     => 'option',            'searchs'    => array            (                'api' => 'agent/member-find',                'col' => 'idcard',                'result' => 'id',                'search' => 'mid',            ),            # 读取另外表的关联方式            'sync'      => array('mid', 'id'),        ),        'address_id'      => array        (            'type'      => 'int-11',            'name'      => '送货地址',            'default'   => '',            'desc'      => '送货地址',            'match'     => 'is_numeric',        ),        'type'        => array        (            'type'      => 'tinyint-1',            'name'      => '类型',            'default'   => '1',            'desc'      => '类型',            'match'     => 'is_numeric',            'update'  	=> 'radio',            'option'    => $type,        ),        'type_id'      => array        (            'type'      => 'int-11',            'name'      => '类型id',            'default'   => '-1',            'desc'      => '类型id',            'match'     => 'is_numeric',            'list_name' => '权益名称',            //'list'      => 'Dever::load("agent/lib/manage.getGoods#name", "{type}", "{type_id}", "-2")',        ),        'dh_type'        => array        (            'type'      => 'tinyint-1',            'name'      => '行权方式',            'default'   => '1',            'desc'      => '行权方式',            'match'     => 'is_numeric',            'update'  	=> 'radio',            'option'    => $dh_type,            'list'		=> true,            'list_order' => 5,        ),        'name'      => array        (            'type'      => 'varchar-800',            'name'      => '详情',            'default'   => '',            'desc'      => '订单名称',            'match'     => 'is_string',            'update'    => 'text',            'list'		=> true,            'list_order' => 6,        ),        'order_num'      => array        (            'type'      => 'varchar-100',            'name'      => '订单号',            'default'   => '',            'desc'      => '订单号',            'match'     => 'is_string',            'update'    => 'text',            //'search'    => 'fulltext',            //'list'      => true,            //'list_order' => 1,        ),        'price'      => array        (            'type'      => 'varchar-50',            'name'      => '订单总金额',            'default'   => '0',            'desc'      => '实付金额',            'match'     => 'option',            'update'    => 'text',            'list'      => false,            'list_order' => 11,        ),        'num'        => array        (            'type'      => 'int-11',            'name'      => '购买总数量',            'default'   => '',            'desc'      => '购买总数量',            'match'     => 'is_numeric',            'search'    => 'select',            'list'        => false,            'list_order'    => 10,        ),        'refund_num'        => array        (            'type'      => 'int-11',            'name'      => '退款数量',            'default'   => '0',            'desc'      => '退款数量',            'match'     => 'is_numeric',        ),        'refund_cash'      => array        (            'type'      => 'decimal-11,2',            'name'      => '退款金额',            'default'   => '0',            'desc'      => '已退订单金额',            'match'     => 'option',            'update'    => 'text',        ),        'refund_status'        => array        (            'type'      => 'tinyint-1',            'name'      => '退款状态',            'default'   => '1',            'desc'      => '申请退款状态',            'match'     => 'is_numeric',            'option'    => $refund_status,        ),        'info'      => array        (            'type'      => 'varchar-300',            'name'      => '订单备注',            'default'   => '',            'desc'      => '订单备注',            'match'     => 'option',            'update'    => 'textarea',        ),        'status'        => array        (            'type'      => 'tinyint-1',            'name'      => '订单状态',            'default'   => '1',            'desc'      => '订单状态',            'match'     => 'is_numeric',            'option'    => $status,            'search'    => 'select',            'list'      => true,            'list_order' => 7,        ),        'audit'        => array        (            'type'      => 'tinyint-1',            'name'      => '审核状态',            'default'   => '2',            'desc'      => '审核状态',            'match'     => 'is_numeric',            'option'    => $audit,            //'search'    => 'select',            'update'    => 'radio',            'control'   => 'audit',        ),        'audit_desc'        => array        (            'type'      => 'varchar-500',            'name'      => '审核备注',            'default'   => '',            'desc'      => '审核备注',            'match'     => 'is_string',            'update'    => 'textarea',            'show'      => 'audit=3',        ),        'fdate'     => array        (            'type'      => 'int-11',            'name'      => '完成时间',            'default'   => '',            'match'     => 'is_numeric',            'desc'      => '',        ),        'operdate'     => array        (            'type'      => 'int-11',            'name'      => '操作时间',            'default'   => '',            'match'     => 'is_numeric',            'desc'      => '',            //'list'      => '"{operdate}" > 0 ? date("Y-m-d H:i:s", {operdate}) : "-"',            //'list_name' => '发货时间',            //'list_order' => 8,        ),        '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", {cdate})',            //'list'      => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',            'list_order' => 2,        ),    ),    'alter' => array    (        10 => array        (            array('update', 'refund_cash', 'refund_cash', 'decimal-11,2 0 退款金额'),        ),        'version' => 10,    ),    'manage' => array    (        'delete' => false,        'edit' => false,        'insert' => false,        'button' => $button,        'list_button' => array        (            //fast_list            'list' => array('查看详情', '"dh_order_goods&project=agent&order_id={id}&page_type=1"', '{type} == 1'),            'list1' => array('查看采购单', '"buy_order&project=shop&search_option_type=1&search_option_parent_type=3&search_option_parent_order_id={id}&oper_table=dh_order&oper_project=agent"', '{type} == 1 && {status} >= 3 && {audit} == 2'),            // 'fast' => array('审核', '"dh_order&where_id={id}&col=audit,audit_desc&oper_save_jump=dh_order&oper_table=dh_order&oper_parent=dh_order"', '{type} == 1 && {status} == 2'),            'list2' => array('审核', '"dh_order_goods&project=agent&order_id={id}&audit=1&page_type=1"', '{status} == 2'),            'oper'  => array('确认收货', '"agent/lib/manage.setDhOrderStatus?mid={mid}&order_id={id}"', '{type} == 1 && {status} == 4'),        ),        'list2_button' => $list2_button,    ),    'request' => array    (        'getList' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'mid' => 'yes',                'status' => 'yes',                'state' => 1,            ),            'type' => 'all',            'order' => array('cdate' => 'desc'),            'page' => array(5, 'list'),            'col' => '*',        ),        'getAll' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'name' => array('yes', 'like'),                'mid' => 'yes',                'mobile' => 'yes',                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'all',            'order' => array('cdate' => 'desc'),            'page' => array(10, 'list'),            'col' => '*',        ),        'getYes' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'mid' => 'yes',                'state' => 1,            ),            'type' => 'all',            'order' => array('cdate' => 'desc'),            'col' => '*',        ),        # 获取提交订单超过12个小时        'getDataByTime' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'cdate' => array('yes', '<='),                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'all',            'order' => array('cdate' => 'desc'),            'col' => '*',        ),        # 获取1,2        'getBuy' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'status' => 'yes',                'mid' => 'yes',                'order_num' => '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_num,name,buy_num,cdate,cash,mid,buy_id',        ),        # 删除未支付订单        'drop' => array        (            # 匹配的正则或函数 选填项            'where' => array            (                'time' => array('yes-cdate', '<='),                'status' => 1,                'state' => 1,            ),            'type' => 'delete',            'col' => 'id,order_num',        ),        # 获取数据        'getAllByDate' => array        (            # 匹配的正则或函数 选填项            'where' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'all',            'col' => 'id,order_num,mobile,mid,cdate,price-refund_cash as total,num-refund_num as num',        ),        # 获取订单数量        'getOrderNum' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'mid' => 'yes',                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'count',            'col' => '*',        ),        # 获取总金额        'getCashNum' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'mid' => 'yes',                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'one',            'col' => 'sum(price-refund_cash) as total',        ),        # 获取商品数量        'getGoodsNum' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'mid' => 'yes',                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'one',            'col' => 'sum(num-refund_num) as total',        ),        # 获取订单数量        'getUser' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'mid' => 'yes',                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'all',            'group' => 'mobile',            'col' => 'count(mobile) as total',        ),        'getUserNum' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'mid' => 'yes',                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'count',            'col' => '*',        ),        'getExcelAll' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'state' => 1,            ),            'type' => 'all',            'col' => '*',        ),    ),);
 |