<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

use App\Traits\ModelLogChanging;

class Feature extends Model
{
    use ModelLogChanging;

    protected $fillable = [
        "type",     //类型
        "logic",    //逻辑
        "describe", //特征
    ];

    const TYPE = [
        0 => "商品名称",  //二级
        1 => "订单类型",
        2 => "承运商名称",
        3 => "店铺类型",
        4 => "波次类型",
        5 => "商品备注",  //二级
        6 => "长",       //二级
        7 => "订单备注",
        10=> "订单商品数",//二级
        11=> "属性仓",
        12=> "订单商品数",
        13=> "承运商英文名",
    ];
    //额外定义 8：商品数量 9：商品
    const TYPE_NODE = [0,5,6,8,9,10]; //标注二级类型
    const MAPPING = [
        "store" => [
            0 => "store_items.name",
            1 => "stored_method",
            5 => "store_items.commodity.remark",
            6 => "store_items.commodity.length",
            7 => "remark",
            8 => "store_items.amount",
            9 => "store_items.commodity",
            10=> "store_items.total",
            11=> "warehouse.name",
            12=> "total",
        ],
        "order" => [
            0 => "packages.commodities.commodity.name",
            1 => "order_type",
            2 => "logistic.name",
            3 => "shop.name",
            4 => "batch.wms_type",
            5 => "packages.commodities.commodity.remark",
            6 => "packages.commodities.commodity.length",
            7 => "remark",
            8 => 'packages.commodities.amount',
            9 => 'packages.commodities.commodity',
            10=> 'packages.commodities.total',
            12=> "total",
            13=> "logistic.english_name",
        ]
    ];
}
