/
home
/
henzagold
/
server
/
app
/
Models
/
File Upload :
llllll
Current File: //home/henzagold/server/app/Models/OrderItem.php
<?php namespace App\Models; use App\DB\Selector; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class OrderItem extends Model { use HasFactory; use Selector; use SoftDeletes; protected $fillable = [ 'order_id', 'variant_id', 'product_id', 'product_title', 'variant_title', 'percent', 'price', 'rial_pay', 'note', 'wage', 'qty', 'sts', 'w', 'rash_weight', 'original_rash_weight', 'discount', 'original_percent', ]; public function product(){ return $this->belongsTo('App\Models\Product' , 'product_id')->select(['id' ,'title' , 'mobile_pic_id'])->with(['tmobile','variants']); } public function variants() { return $this->belongsTo('App\Models\ProductVariant', 'variant_id'); } public function getWAttribute($value) { return Utility::round($value); } public function getWageAttribute($value) { return Utility::round($value); } public function order() { return $this->belongsTo('App\Models\Order', 'order_id'); } }
Copyright ©2k19 -
Hexid
|
Tex7ure