|  | @@ -0,0 +1,255 @@
 | 
	
		
			
				|  |  | +<?php
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +$type = array
 | 
	
		
			
				|  |  | +(
 | 
	
		
			
				|  |  | +    1 => '订货结算',
 | 
	
		
			
				|  |  | +    2 => '退款结算',
 | 
	
		
			
				|  |  | +);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +$status = array
 | 
	
		
			
				|  |  | +(
 | 
	
		
			
				|  |  | +    1 => '未入账',
 | 
	
		
			
				|  |  | +    2 => '已入账',
 | 
	
		
			
				|  |  | +);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +$audit = array
 | 
	
		
			
				|  |  | +(
 | 
	
		
			
				|  |  | +	1 => '待审核',
 | 
	
		
			
				|  |  | +	2 => '审核通过',
 | 
	
		
			
				|  |  | +	3 => '审核未通过',
 | 
	
		
			
				|  |  | +);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +$audit_type = array
 | 
	
		
			
				|  |  | +(
 | 
	
		
			
				|  |  | +	1 => '系统',
 | 
	
		
			
				|  |  | +	2 => '人工',
 | 
	
		
			
				|  |  | +);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +$shop = function()
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	$array = array();
 | 
	
		
			
				|  |  | +	$info = Dever::db('shop/info')->select();
 | 
	
		
			
				|  |  | +	if($info)
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		$array += $info;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +	return $array;
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +return array
 | 
	
		
			
				|  |  | +(
 | 
	
		
			
				|  |  | +    # 表名
 | 
	
		
			
				|  |  | +    'name' => 'shop',
 | 
	
		
			
				|  |  | +    # 显示给用户看的名称
 | 
	
		
			
				|  |  | +    'lang' => '门店结算单',
 | 
	
		
			
				|  |  | +    'order' => 100,
 | 
	
		
			
				|  |  | +    'config_type' => $type,
 | 
	
		
			
				|  |  | +    'config_status' => $status,
 | 
	
		
			
				|  |  | +    'config_audit' => $audit,
 | 
	
		
			
				|  |  | +    'config_audit_type' => $audit_type,
 | 
	
		
			
				|  |  | +    # 数据结构
 | 
	
		
			
				|  |  | +    '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,
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        'shop_id'      => array
 | 
	
		
			
				|  |  | +        (
 | 
	
		
			
				|  |  | +            'type'      => 'int-11',
 | 
	
		
			
				|  |  | +            'name'      => '结算门店',
 | 
	
		
			
				|  |  | +            'default'   => '',
 | 
	
		
			
				|  |  | +            'desc'      => '结算门店',
 | 
	
		
			
				|  |  | +            'match'     => 'is_numeric',
 | 
	
		
			
				|  |  | +            'search'    => 'select',
 | 
	
		
			
				|  |  | +            'update'    => 'hidden',
 | 
	
		
			
				|  |  | +            'option'	=> $shop,
 | 
	
		
			
				|  |  | +            'value'     => Dever::input('search_option_shop_id'),
 | 
	
		
			
				|  |  | +            'list'      => 'Dever::load("shop/info-find#name", {shop_id})',
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        'buy_order_id'      => array
 | 
	
		
			
				|  |  | +        (
 | 
	
		
			
				|  |  | +            'type'      => 'int-11',
 | 
	
		
			
				|  |  | +            'name'      => '订货单id',
 | 
	
		
			
				|  |  | +            'default'   => '',
 | 
	
		
			
				|  |  | +            'desc'      => '订货单id',
 | 
	
		
			
				|  |  | +            'match'     => 'is_numeric',
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        'buy_order_num'      => array
 | 
	
		
			
				|  |  | +        (
 | 
	
		
			
				|  |  | +            'type'      => 'varchar-100',
 | 
	
		
			
				|  |  | +            'name'      => '订货单编号',
 | 
	
		
			
				|  |  | +            'default'   => '',
 | 
	
		
			
				|  |  | +            'desc'      => '订货单编号',
 | 
	
		
			
				|  |  | +            'match'     => 'is_string',
 | 
	
		
			
				|  |  | +            'update'    => 'text',
 | 
	
		
			
				|  |  | +            'search'    => 'fulltext',
 | 
	
		
			
				|  |  | +            'list'      => true,
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        'num'        => array
 | 
	
		
			
				|  |  | +        (
 | 
	
		
			
				|  |  | +            'type'      => 'int-11',
 | 
	
		
			
				|  |  | +            'name'      => '数量',
 | 
	
		
			
				|  |  | +            'default'   => '',
 | 
	
		
			
				|  |  | +            'desc'      => '数量',
 | 
	
		
			
				|  |  | +            'match'     => 'is_numeric',
 | 
	
		
			
				|  |  | +            'list'        => true,
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        'cash'        => array
 | 
	
		
			
				|  |  | +        (
 | 
	
		
			
				|  |  | +            'type'      => 'varchar-50',
 | 
	
		
			
				|  |  | +            'name'      => '结算金额',
 | 
	
		
			
				|  |  | +            'default'   => '0',
 | 
	
		
			
				|  |  | +            'desc'      => '结算金额',
 | 
	
		
			
				|  |  | +            'match'     => 'option',
 | 
	
		
			
				|  |  | +            'update'    => 'text',
 | 
	
		
			
				|  |  | +            'list'      => true,
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        'type'        => array
 | 
	
		
			
				|  |  | +        (
 | 
	
		
			
				|  |  | +            'type'      => 'tinyint-1',
 | 
	
		
			
				|  |  | +            'name'      => '结算类型',
 | 
	
		
			
				|  |  | +            'default'   => '1',
 | 
	
		
			
				|  |  | +            'desc'      => '结算类型',
 | 
	
		
			
				|  |  | +            'match'     => 'is_numeric',
 | 
	
		
			
				|  |  | +            'option'    => $type,
 | 
	
		
			
				|  |  | +            '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,
 | 
	
		
			
				|  |  | +            'search'    => 'select',
 | 
	
		
			
				|  |  | +            'list'      => 'Dever::load("cash/lib/manage.info", "{audit_type}", "{audit}")',
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        'audit_type'        => array
 | 
	
		
			
				|  |  | +        (
 | 
	
		
			
				|  |  | +            'type'      => 'tinyint-1',
 | 
	
		
			
				|  |  | +            'name'      => '审核类型',
 | 
	
		
			
				|  |  | +            'default'   => '1',
 | 
	
		
			
				|  |  | +            'desc'      => '审核类型',
 | 
	
		
			
				|  |  | +            'match'     => 'is_numeric',
 | 
	
		
			
				|  |  | +            'option'    => $audit_type,
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        '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}")',
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +    ),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    'manage' => array
 | 
	
		
			
				|  |  | +    (
 | 
	
		
			
				|  |  | +        'delete' => false,
 | 
	
		
			
				|  |  | +        'edit' => false,
 | 
	
		
			
				|  |  | +        'insert' => false,
 | 
	
		
			
				|  |  | +        'excel'	=> true,
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        'list_button' => array
 | 
	
		
			
				|  |  | +        (
 | 
	
		
			
				|  |  | +            'fast' => array('审核', '"shop&where_id={id}&col=audit,desc&oper_save_jump=shop&oper_table=shop&oper_parent=shop"', '{audit_type} == 2'),
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +    ),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    'request' => array
 | 
	
		
			
				|  |  | +    (
 | 
	
		
			
				|  |  | +        # 获取总金额
 | 
	
		
			
				|  |  | +        'getAll' => array
 | 
	
		
			
				|  |  | +        (
 | 
	
		
			
				|  |  | +            # 匹配的正则或函数 选填项
 | 
	
		
			
				|  |  | +            'option' => array
 | 
	
		
			
				|  |  | +            (
 | 
	
		
			
				|  |  | +                'start' => array('yes-month', '>='),
 | 
	
		
			
				|  |  | +                'end' => array('yes-month', '<='),
 | 
	
		
			
				|  |  | +                'shop_id' => 'yes',
 | 
	
		
			
				|  |  | +                'state' => 1,
 | 
	
		
			
				|  |  | +            ),
 | 
	
		
			
				|  |  | +            'type' => 'all',
 | 
	
		
			
				|  |  | +            'page' => array(10, 'list'),
 | 
	
		
			
				|  |  | +            'col' => '*',
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +    ),
 | 
	
		
			
				|  |  | +);
 |