NASER fix some issues
This commit is contained in:
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class File extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use Selector;
|
||||
protected $fillable = [
|
||||
'original_name',
|
||||
'title',
|
||||
'ext',
|
||||
'src',
|
||||
'size',
|
||||
'user_id',
|
||||
'type',
|
||||
'has_thumb',
|
||||
'url',
|
||||
];
|
||||
protected $casts = [
|
||||
"has_thumb"=>"boolean"
|
||||
];
|
||||
public function getSrcAttribute(){
|
||||
return 'https://bazarsaat.com/kernel/'.$this->attributes['src'];
|
||||
// return url($this->attributes['src']);
|
||||
}
|
||||
}
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class OfferCode extends Model
|
||||
{
|
||||
use HasFactory,Selector,SoftDeletes;
|
||||
protected $table='offer_codes';
|
||||
protected $fillable=[
|
||||
'code',
|
||||
'title',
|
||||
'description',
|
||||
'start_at',
|
||||
'end_at',
|
||||
'type',
|
||||
'discount_percent',
|
||||
'discount_price',
|
||||
'is_active',
|
||||
'use_only',
|
||||
'use_count'
|
||||
];
|
||||
static $TYPES = [
|
||||
1=>"محصول",
|
||||
2=>"دسته بندی",
|
||||
3=>"مشتری",
|
||||
4=>"برند",
|
||||
5=>""
|
||||
];
|
||||
static $TYPE_CUSTOMER = [
|
||||
1=>"تکی",
|
||||
2=>"عمده",
|
||||
];
|
||||
protected $casts=[
|
||||
'is_active' => 'boolean',
|
||||
];
|
||||
// public static function safeDelete($promotionID){
|
||||
// Promotion::findOrFail($promotionID)->delete();
|
||||
// PromotionItem::where('promotion_id',$promotionID)->delete();
|
||||
// PromotionProduct::where('promotion_id',$promotionID)->delete();
|
||||
// return true;
|
||||
// }
|
||||
|
||||
}
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+1
-1
@@ -70,7 +70,7 @@ class Product extends Model
|
||||
return $this->hasOne(Wallet::class)->where('owner',auth()->user()->id);
|
||||
}
|
||||
public function file(){
|
||||
return $this->belongsTo(File::class);
|
||||
return $this->belongsTo(File::class, 'original_image_id');
|
||||
}
|
||||
public function price(){
|
||||
return $this->hasOne(Price::class)->orderBy('id','desc');
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Reference in New Issue
Block a user