<?php
declare(strict_types=1);

namespace app\common\model;

use app\common\model\base\BaseModel;

class StockConfig extends BaseModel
{

      //类型
      const VarietyName = 'variety_name';
      const PackingBox  = 'packing_box';
      const Material     = 'material';

      //状态
      const StatusNormal  = 1;
      const StatusDisable = 0;

      public static function getTypeList(){
            return [
                  self::VarietyName =>'品种名称',
                  self::PackingBox  =>'包装箱',
                  self::Material    =>'耗材',
            ];
      }

      public function stockdetail()
      {
            return $this->hasMany(StockDetail::class,'type_id', 'type_id')->field('type_id,num');
      }



}
