"array", "weight_interval" => "array" ]; public function owners() { //货主 return $this->belongsToMany(Owner::class,"owner_price_express_owner","owner_price_express_id","owner_id"); } public function logistics() { //物流 return $this->belongsToMany(Logistic::class,"owner_price_express_logistic","owner_price_express_id","logistic_id"); } public function details() { //计费详情 return $this->hasMany(OwnerPriceExpressProvince::class,"owner_price_express_id","id"); } public function taxRate() { //税率 return $this->belongsTo(TaxRate::class); } public function getOwnerIdAttribute() { //获取货主ID数组 return array_column(DB::select(DB::raw("SELECT * FROM owner_price_express_owner WHERE owner_price_express_id = ?"),[$this->id]),"owner_id"); } public function getLogisticIdAttribute() { //获取快递ID数组 return array_column(DB::select(DB::raw("SELECT * FROM owner_price_express_logistic WHERE owner_price_express_id = ?"),[$this->id]),"logistic_id"); } }