module.exports = {
    mode: 'simple',
    modelCn: '订单管理',
    autoInsertDate: true,
    autoInsertUser: true,
    fields: {
        order_no: {
            type: 'string',
            comment: '订单号',
            meta: {
                formType: 'input',
            },
            filter: true,
        },
        total: {
            type: 'string',
            comment: '订单金额',
            meta: {
                formType: 'input',
            },
        },
        goods: {
            type:'text',
            isStore: true,
            tableHidden: true,
            comment: '商品',
            meta: {
                formType: 'input', 
                isInline: false, 
                inputType: 'text', 
            },
            fields: {
                title: {
                    type:'string',
                    comment:'商品名称'
                },
                num: {
                    type:'string',
                    comment:'商品数量'
                },
                price: {
                    type:'string',
                    comment:'商品单价'
                }
            }
        }
    },
    extendActions: {
        show: {
            by: ['userid']
        }
    },
    primaryKey: 'id',
    middlewares: ['loginRequired'], // 该模型需要登录，权限认证
}