| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559 | <?php$jstype = array(    1 => '订货结算',    2 => '退款结算',    3 => '零售结算',);$pay_type = array(    1 => '在线支付',    2 => '礼品卡支付',    3 => '钱包支付',);$status = array(    1 => '未入账',    2 => '已入账',);$audit = array(	1 => '待审核',	2 => '审核通过',	3 => '审核未通过',);$audit_1 = array(    //1 => '待审核',    2 => '审核通过',    3 => '审核未通过',);$audit_type = array(	1 => '系统',	2 => '人工',);$source = Dever::config('base')->source;$shop = function(){	$array = array();	$info = Dever::db('shop/info')->select();	if($info)	{		$array += $info;	}	return $array;};$store = function(){    $array = array();    $info = Dever::db('store/info')->select();    if($info)    {        $array += $info;    }    return $array;};$factory = function(){    $array = array();    $info = Dever::db('factory/info')->select();    if($info)    {        $array += $info;    }    return $array;};# 1是门店 2是仓库 但仓库没有结算单 3是工厂$search = Dever::input('search_option_source_type', 1);if ($search == 1) {    $search_name = '结算门店';    $search_option = $shop;    $search_url = 'shop/lib/manage.search';} elseif ($search == 2) {    $search_name = '结算仓库';    $search_option = $store;    $search_url = 'store/lib/manage.search';} if ($search == 3) {    $search_name = '结算工厂';    $search_option = $factory;    $search_url = 'factory/lib/manage.search';}return array(    # 表名    'name' => 'order',    # 显示给用户看的名称    'lang' => '结算单',    'order' => 100,    'config_jstype' => $jstype,    'config_status' => $status,    'config_audit' => $audit,    'config_audit_type' => $audit_type,    'config_source' => $source,    'end' => array    (        'insert' => 'cash/lib/set.orderUpdate_commit',        'update' => 'cash/lib/set.orderUpdate_commit',    ),    # 数据结构    'struct' => array    (            'id'        => array        (            'type'      => 'int-11',            'name'      => 'ID',            'default'   => '',            'desc'      => '',            'match'     => 'is_numeric',            'search'    => 'order',            'list'      => true,        ),         'order_num'      => array        (            'type'      => 'varchar-100',            'name'      => '结算单号',            'default'   => '',            'desc'      => '结算单号',            'match'     => 'is_string',            'update'    => 'text',            'search'    => 'fulltext',            'list'      => true,        ),        'type'      => array        (            'type'      => 'int-11',            'name'      => '采购人类型',            'default'   => '',            'desc'      => '采购人类型',            'search'    => 'hidden',            'match'     => 'is_numeric',        ),        'type_id'      => array        (            'type'      => 'int-11',            'name'      => $search_name,            'default'   => '',            'desc'      => '采购人',            'match'     => 'is_numeric',            'search'    => $search == 3 ? '' : 'select',            'option'    => $search_option,            //'update_search' => $search_url,            'list'      => $search == 3 ? false : 'Dever::load("shop/lib/manage.buyInfo", "{type}", "{type_id}")',        ),        'source_type'      => array        (            'type'      => 'int-11',            'name'      => '供货商类型',            'default'   => '',            'desc'      => '供货商类型',            'search'    => 'hidden',            'match'     => 'is_numeric',        ),        'source_id'      => array        (            'type'      => 'int-11',            'name'      => $search_name,            'default'   => '',            'desc'      => '供货商',            'match'     => 'is_numeric',            'search'    => $search == 3 ? 'select' : '',            'option'    => $search_option,            //'update_search' => $search_url,            'list'      => $search == 3 ? 'Dever::load("shop/lib/manage.buyInfo", "{source_type}", "{source_id}")' : false,        ),        'source_order_id'      => array        (            'type'      => 'int-11',            'name'      => '订货单id',            'default'   => '',            'desc'      => '订货单id',            'match'     => 'is_numeric',        ),        'source_order_num'      => array        (            'type'      => 'varchar-100',            'name'      => '订货单编号',            'default'   => '',            'desc'      => '订货单编号',            'match'     => 'is_string',            'update'    => 'text',            'search'    => 'fulltext',            'list'      => 'Dever::load("shop/lib/manage.getOrderUrl", "{source_type}", "{source_order_id}", "{source_order_num}", "'.$search.'")',        ),        'refund_id'      => array        (            'type'      => 'int-11',            'name'      => '退款id',            'default'   => '-1',            'desc'      => '退款id',            'match'     => 'is_numeric',        ),        'num'        => array        (            'type'      => 'varchar-100',            'name'      => '数量',            'default'   => '',            'desc'      => '数量',            'match'     => 'option',            'list'      => true,        ),        'cash'        => array        (            'type'      => 'varchar-50',            'name'      => '结算金额',            'default'   => '0',            'desc'      => '结算金额',            'match'     => 'option',            'update'    => 'text',            'list'      => $search == 1 ? true : false,        ),        'p_cash'        => array        (            'type'      => 'varchar-50',            'name'      => '结算金额',            'default'   => '0',            'desc'      => '结算金额',            'match'     => 'option',            'update'    => 'text',            'list'      => $search == 3 ? true : false,        ),        'jstype'        => array        (            'type'      => 'tinyint-1',            'name'      => '结算类型',            'default'   => '1',            'desc'      => '结算类型',            'match'     => 'is_numeric',            'option'    => $jstype,            'search'    => 'select',            'list'      => true,        ),        'status'        => array        (            'type'      => 'tinyint-1',            'name'      => '入账状态',            'default'   => '1',            'desc'      => '入账状态',            'match'     => 'is_numeric',            'option'    => $status,            'search'    => 'select',            'list'      => true,        ),        'audit'        => array        (            'type'      => 'tinyint-1',            'name'      => '审核状态',            'default'   => '1',            'desc'      => '审核状态',            'match'     => 'is_numeric',            'option'    => $audit_1,            'search'    => 'select',            'update'    => 'radio',            'list'      => 'Dever::load("cash/lib/set.info", "{audit_type}", "{audit}")',        ),        'audit_type'        => array        (            'type'      => 'tinyint-1',            'name'      => '审核类型',            'default'   => '1',            'desc'      => '审核类型',            'match'     => 'is_numeric',            'option'    => $audit_type,        ),        'pay_type'        => array        (            'type'      => 'tinyint-1',            'name'      => '支付类型',            'default'   => '1',            'desc'      => '支付类型',            'match'     => 'is_numeric',            'option'    => $pay_type,            'search'    => 'select',            'list'      => true,        ),        'fdate'     => array        (            'type'      => 'int-11',            'name'      => '完成时间',            'default'   => '',            'match'     => 'is_numeric',            'desc'      => '',        ),        'operdate'     => array        (            'type'      => 'int-11',            'name'      => '结算时间',            'default'   => '',            'match'     => 'is_numeric',            'desc'      => '',            'search'    => 'date',            'list'      => '"{operdate}" ? date("Y-m-d H:i:s", {operdate}) : ""',        ),        'desc'        => array        (            'type'      => 'varchar-500',            'name'      => '审核备注',            'default'   => '',            'desc'      => '审核备注',            'match'     => 'option',            'update'    => 'textarea',            'list'      => 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,            //'search'    => 'date',            'list'        => 'date("Y-m-d H:i:s", {cdate})',            //'list'      => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',        ),    ),    'alter' => array    (        3 => array        (            array('update', 'num', 'num', 'varchar-100 0 数量'),        ),        'version' => 3,    ),    'manage' => array    (        'list_table' => 'html',        'delete' => false,        'edit' => false,        'insert' => false,        // 'excel'	=> true,        'button' => array        (            '数据导出' => array('excel', 'cash/lib/order.out_order'),        ),        'page_list' => 'order_list',        'list_button' => array        (            'fast' => array('审核', '"order&where_id={id}&col=audit,desc&oper_save_jump=order&oper_table=order&oper_parent=order"', '{audit_type} == 2 && {audit} == 1'),        ),    ),    'request' => array    (        # 获取数量        'getNum' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'type' => 'yes',                'type_id' => 'yes',                'source_type' => 'yes',                'source_id' => 'yes',                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'one',            'col' => 'sum(num) as total',        ),        # 获取总金额        'getCash' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'type' => 'yes',                'type_id' => 'yes',                'source_type' => 'yes',                'source_id' => 'yes',                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'one',            'col' => 'sum(cash) as total',        ),        # 获取总金额        'getPCash' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'type' => 'yes',                'type_id' => 'yes',                'source_type' => 'yes',                'source_id' => 'yes',                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'one',            'col' => 'sum(p_cash) as total',        ),        'getAll' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'type' => 'yes',                'type_id' => 'yes',                'source_type' => 'yes',                'source_id' => 'yes',                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'all',            'page' => array(10, 'list'),            'col' => '*',        ),        'getAllByStore' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'type' => array('yes-type', '=', 'and (( '),                'type_id' => array('yes-type_id', '=', 'and )'),                'source_type' => array('yes-source_type', '=', 'or ( '),                'source_id' => array('yes-source_id', '=', 'and )) '),                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'all',            'page' => array(10, 'list'),            'col' => '*',        ),        'getAllNoPage' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'type' => 'yes',                'type_id' => 'yes',                'source_type' => 'yes',                'source_id' => 'yes',                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'all',            'col' => '*',        ),        'getAllByStoreNoPage' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'type' => array('yes-type', '=', 'and (( '),                'type_id' => array('yes-type_id', '=', 'and )'),                'source_type' => array('yes-source_type', '=', 'or ( '),                'source_id' => array('yes-source_id', '=', 'and )) '),                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'all',            'col' => '*',        ),        'getDataByOrderId' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'type' => 'yes',                'type_id' => 'yes',                'source_type' => 'yes',                'source_id' => 'yes',                'source_order_id' => array('yes', 'in'),                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'all',            'col' => '*',        ),                'getExcel' => array        (            # 匹配的正则或函数 选填项            'option' => array            (                'start' => array('yes-cdate', '>='),                'end' => array('yes-cdate', '<='),                'type' => 'yes',                'type_id' => 'yes',                'pay_type' => 'yes',                'audit' => 'yes',                'jstype' => 'yes',                'status' => array('yes', 'in'),                'state' => 1,            ),            'type' => 'all',            'col' => '*',        ),    ),);
 |