| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\ModelLogChanging;
- class OwnerPriceExpressProvince extends Model
- {
- use ModelLogChanging;
- protected $fillable = [
- "owner_price_express_id", //快递价格ID
- "province_id", //省份ID
- "initial_weight_price", //初始单价
- "additional_weight_price", //续重单价
- ];
- protected $casts = [
- "initial_weight_price" => "array",
- "additional_weight_price" => "array"
- ];
- public function ownerPriceExpress()
- { //快递计费
- return $this->belongsTo(OwnerPriceExpress::class,"owner_price_express_id","id");
- }
- public function province()
- { //省份
- return $this->hasOne(Province::class,"id","province_id");
- }
- }
|