OwnerOutStorageRule.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. class OwnerOutStorageRule extends ModelExtended
  5. {
  6. protected $fillable = [
  7. "owner_price_operation_id", //作业计费ID
  8. "strategy", //出库策略
  9. "amount", //起步数
  10. "unit_id", //单位ID
  11. "unit_price", //单价
  12. "feature", //特征
  13. "priority", //优先级 值越大越高
  14. ];
  15. public $timestamps=false;
  16. public static $features = null;
  17. public static $columnMapping = null;
  18. public function unit()
  19. { //单位
  20. return $this->hasOne(Unit::class,"id","unit_id");
  21. }
  22. /* 格式化依据静态参数,在调用前设置 */
  23. public function getFeatureFormatAttribute()
  24. {
  25. if ($this->strategy == '默认')return "/";
  26. return app("FeatureService")->formatFeature(self::$features,$this->feature,self::$columnMapping);
  27. }
  28. }