| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\ModelLogChanging;
- class OwnerPriceOperationItem extends Model
- {
- use ModelLogChanging;
- protected $fillable = [
- "owner_price_operation_id", //作业计费ID
- "strategy", //子策略
- "amount", //起步数
- "unit_id", //单位ID
- "unit_price", //单价
- "feature", //特征
- "priority", //优先级 值越大越高
- "discount_price", //减免单价
- ];
- public $timestamps=false;
- public static $features = null;
- public static $columnMapping = null;
- public function unit()
- { //单位
- return $this->hasOne(Unit::class,"id","unit_id");
- }
- /* 格式化依据静态参数,在调用前设置 */
- public function getFeatureFormatAttribute()
- {
- if ($this->strategy == '默认')return "/";
- return app("FeatureService")->formatFeature(self::$features,$this->feature,self::$columnMapping);
- }
- }
|