NASER fix some issues
This commit is contained in:
@@ -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;
|
||||
// }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user