OwnerPriceExpressProvince.php 691 B

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