|
|
@@ -7,13 +7,14 @@ use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
use App\Traits\ModelLogChanging;
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
|
|
|
|
class TerminalPrinter extends Model
|
|
|
{
|
|
|
use ModelLogChanging;
|
|
|
use ModelTimeFormat;
|
|
|
|
|
|
- protected $fillable = ['terminal_id', 'printer_name', 'alias_name', 'logistic_id'];
|
|
|
+ protected $fillable = ['terminal_id', 'printer_name', 'alias_name'];
|
|
|
|
|
|
|
|
|
public function terminal(): BelongsTo
|
|
|
@@ -21,9 +22,8 @@ class TerminalPrinter extends Model
|
|
|
return $this->belongsTo(Terminal::class);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public function logistic_id(): BelongsTo
|
|
|
+ public function logistics(): BelongsToMany
|
|
|
{
|
|
|
- return $this->belongsTo(Logistic::class);
|
|
|
+ return $this->belongsToMany(Logistic::class,TerminalPrinterLogistic::class);
|
|
|
}
|
|
|
}
|