Files
OMS/app/archive/dbschema/sales.php
2025-12-28 23:13:25 +08:00

510 lines
17 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
$db['sales'] = array(
'columns' => array(
'sale_id' => array(
'type' => 'bigint unsigned',
'required' => true,
'pkey' => true,
),
'sale_bn' => array(
'type' => 'varchar(32)',
'required' => true,
'label' => '销售单号',
'is_title' => true,
'default_in_list' => true,
'in_list' => true,
'filtertype' => 'normal',
'filterdefault' => true,
'searchtype' => 'nequal',
),
'order_id' => array(
'type' => 'bigint unsigned',
'required' => true,
'label' => '订单号',
),
'order_bn' => array(
'type' => 'varchar(32)',
'label' => '订单号',
),
'iostock_bn' => array(
'type' => 'varchar(32)',
'required' => true,
'label' => '出入库单号',
'default_in_list' => false,
'in_list' => false,
'default' => 0,
),
'order_type' => array(
'type' => 'varchar(30)',
'label' => '订单类型',
'default' => 'normal',
'editable' => false,
'in_list' => false,
'default_in_list' => false,
),
'sale_time' => array(
'type' => 'time',
'label' => '销售时间',
'editable' => false,
'width' => 130,
'filtertype' => 'time',
'filterdefault' => true,
'in_list' => true,
'default_in_list' => true,
),
'total_amount' => array(
'type' => 'money',
'required' => true,
'default' => 0,
'label' => '商品金额',
'default_in_list' => true,
'in_list' => true,
),
'cost_freight' => array(
'type' => 'money',
'required' => true,
'default' => 0,
'label' => '配送费用',
'default_in_list' => true,
'in_list' => true,
),
'sale_amount' => array(
'type' => 'money',
'required' => true,
'default' => 0,
'label' => '销售金额',
'comment' => '销售金额',
'default_in_list' => true,
'in_list' => true,
),
'payment' => array(
'type' => 'varchar(255)',
'label' => '支付方式',
'width' => 65,
'editable' => false,
'in_list' => true,
'default_in_list' => false,
),
'delivery_cost' => array(
'type' => 'money',
'default' => 0,
'label' => '预收物流费用',
'default_in_list' => true,
'in_list' => true,
),
'additional_costs' => array(
'type' => 'money',
'default' => 0,
'label' => '附加费',
'default_in_list' => true,
'in_list' => true,
),
'deposit' => array(
'type' => 'money',
'default' => 0,
'label' => '预存费',
'default_in_list' => false,
'in_list' => false,
),
'discount' => array(
'type' => 'money',
'default' => 0,
'label' => '优惠金额',
'comment' => '订单折扣金额',
'default_in_list' => true,
'in_list' => true,
),
'operator' => array(
'type' => 'varchar(30)',
'label' => '操作员',
'in_list' => false,
),
'member_id' => array(
'type' => 'bigint unsigned',
'label' => '用户名称',
'in_list' => true,
),
'delivery_cost_actual' => array(
'type' => 'money',
'editable' => false,
'label' => '预估物流费用',
'comment' => '预估物流费用',
'filtertype' => 'normal',
'filterdefault' => true,
'in_list' => true,
'default_in_list' => true,
),
'delivery_id' => array(
'type' => 'bigint unsigned',
'required' => true,
'editable' => false,
'comment' => '发货单号',
'in_list' => false,
'default_in_list' => false,
),
'is_tax' => array(
'type' => 'bool',
'default' => 'false',
'required' => true,
'editable' => false,
'in_list' => true,
'label' => '是否开发票',
'width' => 80,
'filtertype' => 'yes',
'filterdefault' => true,
),
'shop_id' => array(
'type' => 'varchar(32)',
'label' => '店铺名称',
'default_in_list' => true,
'in_list' => true,
),
'shopping_guide' => array(
'type' => 'text',
'comment' => '导购',
'label' => '导购',
'width' => 130,
'in_list' => false,
),
'cost' => array(
'type' => 'money',
'default' => 0,
'label' => '成本金额',
'default_in_list' => false,
'in_list' => false,
),
'memo' => array(
'type' => 'text',
'comment' => '备注',
'label' => '备注',
'in_list' => false,
'default_in_list' => false,
),
'branch_id' => array(
'type' => 'bigint unsigned',
'label' => '仓库名称',
'default_in_list' => true,
'in_list' => true,
'filtertype' => 'normal',
'filterdefault' => true,
),
'pay_status' => array(
'type' => array(
0 => '未支付',
1 => '已支付',
),
'label' => '支付状态',
'default_in_list' => false,
'in_list' => false,
),
'logi_id' => array(
'type' => 'bigint unsigned',
'comment' => '物流公司ID',
'editable' => false,
'label' => '物流公司',
),
'logi_name' => array(
'type' => 'varchar(100)',
'label' => '物流公司',
'comment' => '物流公司名称',
'editable' => false,
'width' => 75,
'in_list' => false,
'default_in_list' => false,
),
'logi_no' => array(
'type' => 'varchar(50)',
'label' => '物流单号',
'comment' => '物流单号',
'editable' => false,
'width' => 110,
'in_list' => false,
'default_in_list' => false,
),
'order_check_id' => array(
'type' => 'bigint unsigned',
'label' => '订单审核人',
'in_list' => true,
),
'order_check_time' => array(
'type' => 'time',
'label' => '订单审核时间',
'comment' => '订单审核时间(订单审核并生成发货单时间)',
'editable' => false,
'width' => 130,
'filtertype' => 'time',
'filterdefault' => true,
'in_list' => true,
'default_in_list' => true,
),
'order_create_time' => array(
'type' => 'time',
'label' => '下单时间',
'editable' => false,
'width' => 130,
'filtertype' => 'time',
'filterdefault' => true,
'in_list' => true,
'default_in_list' => true,
),
'paytime' => array(
'type' => 'time',
'label' => '付款时间',
'editable' => false,
'width' => 130,
'filtertype' => 'time',
'filterdefault' => true,
'in_list' => true,
'default_in_list' => true,
),
'ship_time' => array(
'type' => 'time',
'label' => '发货时间',
'editable' => false,
'width' => 130,
'filtertype' => 'time',
'filterdefault' => true,
'in_list' => true,
'default_in_list' => true,
),
'archive' => array(
'type' => 'tinyint unsigned',
'label' => '是否归档',
'required' => true,
'default' => 0,
'editable' => false,
'in_list' => true,
'default_in_list' => true,
),
'selling_agent_id' => array(
'type' => 'int',
'label' => '代销人信息',
'required' => false,
'default' => 0,
'editable' => false,
'in_list' => true,
'default_in_list' => false,
),
'service_price' => array(
'type' => 'money',
'default' => '0',
'editable' => false,
'label' => '服务费用',
),
'refund_money' => array(
'type' => 'money',
'default' => '0',
'label' => '退款费用',
),
'shop_type' => array(
'type' => 'varchar(50)',
'label' => '店铺类型',
'width' => 75,
'editable' => false,
'in_list' => true,
'filtertype' => 'normal',
'filterdefault' => true,
),
'org_id' => array(
'type' => 'bigint unsigned',
'label' => '运营组织',
'editable' => false,
'width' => 60,
'filtertype' => 'normal',
'filterdefault' => true,
'in_list' => true,
'default_in_list' => true,
),
'check' => array(
'type' => 'bool',
'label' => '金额异常',
'editable' => false,
'in_list' => true,
'default' => 'false',
'filtertype' => 'yes',
'filterdefault' => true,
),
'check_msg' => array(
'type' => 'varchar(100)',
'label' => '异常原因',
'editable' => false,
'in_list' => true,
'width' => 200,
),
'settlement_amount' => array(
'type' => 'money',
'default' => '0',
'label' => '结算金额',//客户实付 + 平台支付总额
),
'actually_amount' => array(
'type' => 'money',
'default' => '0',
'label' => '客户实付',// 已支付金额 减去平台支付优惠,加平台支付总额
),
'platform_amount' => array(
'type' => 'money',
'default' => '0',
'label' => '平台承担金额(不包含支付优惠)',
),
'platform_pay_amount' => array(
'type' => 'money',
'default' => '0',
'label' => '支付优惠金额',
),
'platform_order_bn' =>array (
'type' => 'varchar(32)',
'label' => '平台订单号',
'width' => 180,
'searchtype' => 'nequal',
'editable' => false,
'filtertype' => 'normal',
'filterdefault' => true,
'in_list' => true,
'default_in_list' => false,
),
'order_bool_type' => array(
'type' => 'varchar(25)',
'label' => '交易分类',
'editable' => false,
'default' => '0',
'in_list' => true,
'default_in_list' => true,
),
'extra_info' => array(
'type' => 'varchar(25)',
'label' => '交易分类编码',
'filtertype' => 'yes',
'filterdefault' => true,
'in_list' => true,
'default_in_list' => true,
),
'up_time' => [
'type' => 'TIMESTAMP',
'label' => '更新时间',
'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
'width' => 130,
'in_list' => true,
],
'order_source' => array(
'type' => 'varchar(50)',
'label' => '来源渠道',
'default' => 'direct',
'in_list' => false,
'default_in_list' => false,
),
'addon' => array(
'type' => 'longtext',
'editable' => false,
'label' => '扩展字段',
'comment' => '扩展字段',
),
'betc_id' => array(
'type' => 'int unsigned',
'default' => 0,
'editable' => false,
'label' => '贸易公司ID',
),
'cos_id' => array(
'type' => 'int unsigned',
'default' => 0,
'editable' => false,
'label' => '组织架构ID',
),
'archive_time' => array(
'type' => 'int unsigned',
'label' => '归档时间',
'editable' => false,
'in_list' => true,
'default_in_list' => true,
),
),
'index' => array(
'ind_up_time' => ['columns' => ['up_time']],
'ind_sale_bn' => array(
'columns' => array(
0 => 'sale_bn',
),
),
'ind_iostock_bn' => array(
'columns' => array(
0 => 'iostock_bn',
),
),
'ind_sale_time' => array(
'columns' => array(
0 => 'sale_time',
),
),
'ind_order_check_time' => array(
'columns' => array(
0 => 'order_check_time',
),
),
'ind_order_create_time' => array(
'columns' => array(
0 => 'order_create_time',
),
),
'ind_ship_time' => array(
'columns' => array(
0 => 'ship_time',
),
),
'ind_platform_order_bn' => array(
'columns' => array(
0 => 'platform_order_bn',
),
),
'ind_shop_brach_pay' => array(
'columns' => array(
0 => 'shop_id',
1 => 'org_id',
2 => 'branch_id',
3 => 'paytime',
),
),
'idx_org_shippaytime_aggregategs' => array(
'columns' => array(
'org_id',
'ship_time',
'paytime',
'order_id',
'total_amount',
'cost_freight',
'sale_amount',
'discount',
'delivery_cost_actual',
'additional_costs',
),
),
'idx_check' => array(
'columns' => array(
0 => 'check',
),
),
'ind_betc_id' => array(
'columns' => array(
0 => 'betc_id',
),
),
'ind_cos_id' => array(
'columns' => array(
0 => 'cos_id',
),
),
'ind_archive_time' => array(
'columns' => array(
0 => 'archive_time',
),
),
),
'comment' => '销售单归档表',
'engine' => 'innodb',
'version' => '$Rev: $',
'charset' => 'utf8mb4',
);