OwnerPriceExpressProvince.php 811 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Traits\ModelLogChanging;
  5. class OwnerPriceExpressProvince extends Model
  6. {
  7. use ModelLogChanging;
  8. protected $fillable = [
  9. "owner_price_express_id", //快递价格ID
  10. "province_id", //省份ID
  11. "initial_weight_price", //初始单价
  12. "additional_weight_price", //续重单价
  13. ];
  14. protected $casts = [
  15. "initial_weight_price" => "array",
  16. "additional_weight_price" => "array"
  17. ];
  18. public function ownerPriceExpress()
  19. { //快递计费
  20. return $this->belongsTo(OwnerPriceExpress::class,"owner_price_express_id","id");
  21. }
  22. public function province()
  23. { //省份
  24. return $this->hasOne(Province::class,"id","province_id");
  25. }
  26. }