StockConfig.php 751 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. declare(strict_types=1);
  3. namespace app\common\model;
  4. use app\common\model\base\BaseModel;
  5. class StockConfig extends BaseModel
  6. {
  7. //类型
  8. const VarietyName = 'variety_name';
  9. const PackingBox = 'packing_box';
  10. const Material = 'material';
  11. //状态
  12. const StatusNormal = 1;
  13. const StatusDisable = 0;
  14. public static function getTypeList(){
  15. return [
  16. self::VarietyName =>'品种名称',
  17. self::PackingBox =>'包装箱',
  18. self::Material =>'耗材',
  19. ];
  20. }
  21. public function stockdetail()
  22. {
  23. return $this->hasMany(StockDetail::class,'type_id', 'type_id')->field('type_id,num');
  24. }
  25. }