| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- use Illuminate\Database\Eloquent\SoftDeletes;
- class ProductSKU extends Model
- {
- use SoftDeletes;
- const DEFAULT_SORT_BY = 'created_at';
- protected $fillable = [
- 'product_id',
- 'order_id',
- 'maf_order_id',
- 'status', // needs - нуждается в данном товаре, related - привязана к MafOrder
- 'rfid',
- 'factory_number',
- 'manufacture_date',
- 'service_life',
- 'certificate_number',
- 'certificate_date',
- 'certificate_issuer',
- 'certificate_type',
- ];
- public $table = 'products_sku';
- /**
- * @return BelongsTo
- */
- public function product(): BelongsTo
- {
- return $this->belongsTo(Product::class, 'product_id', 'id');
- }
- /**
- * @return BelongsTo
- */
- public function order(): BelongsTo
- {
- return $this->belongsTo(Order::class, 'order_id', 'id');
- }
- /**
- * @return BelongsTo
- */
- public function maf_order(): BelongsTo
- {
- return $this->belongsTo(MafOrder::class, 'maf_order_id', 'id');
- }
- }
|