belongsTo(ServiceWork::class, 'work_id', 'id'); } public function orderGoods() { return $this->hasMany(OrderGoods::class, 'sn', 'sn'); } public function getPaymentTypeTextAttr($value, $data) { $payment_type_data = DictData::where('type_value','payment_type')->column('name','value'); return $payment_type_data[$data['payment_type']]; } }