NASER aff gift card controller and models and routes
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Models\Customer;
|
||||
|
||||
|
||||
class GiftCardCodes extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'giftcard_codes';
|
||||
|
||||
protected $fillable = [
|
||||
'giftcard_id',
|
||||
'code',
|
||||
'sts',
|
||||
'unit',
|
||||
'amount',
|
||||
'assigned_to',
|
||||
'used_at',
|
||||
'expiry_date',
|
||||
];
|
||||
|
||||
static $STS = [
|
||||
1=>'فعال',
|
||||
2=>'استفاده شده',
|
||||
3=>'منقضی شده'
|
||||
];
|
||||
|
||||
static $UNIT = [
|
||||
1=>'IRR',
|
||||
2=>'Golden'
|
||||
];
|
||||
|
||||
public function assignedTo()
|
||||
{
|
||||
return $this->belongsTo(Customer::class, 'assigned_to', 'id')->select('id', 'name', 'mobile');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user