added kashkool
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Cart extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'cart';
|
||||
protected $fillable = [
|
||||
'customer_id',
|
||||
'sts',
|
||||
'session_id',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
static $STS = [
|
||||
1=>'در انتظار ثبت',
|
||||
2=>'در انتظار پرداخت',
|
||||
3=>'پرداخت شده',
|
||||
4=>'لغو شده',
|
||||
];
|
||||
|
||||
public function items()
|
||||
{
|
||||
return $this->hasMany(CartItem::class, 'cart_id');
|
||||
}
|
||||
|
||||
protected function serializeDate(\DateTimeInterface $date)
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CartItem extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'cart_items';
|
||||
|
||||
protected $fillable = [
|
||||
'cart_id',
|
||||
'product_id',
|
||||
'quantity',
|
||||
'price',
|
||||
'title',
|
||||
'group_type',
|
||||
'gold_price',
|
||||
];
|
||||
|
||||
public function cart()
|
||||
{
|
||||
return $this->belongsTo(Cart::class);
|
||||
}
|
||||
|
||||
protected function serializeDate(\DateTimeInterface $date)
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Category extends Model
|
||||
{
|
||||
protected $table = 'categories';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'active',
|
||||
];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = null;
|
||||
|
||||
protected $casts = [
|
||||
'active' => 'boolean',
|
||||
];
|
||||
}
|
||||
@@ -14,6 +14,7 @@ class GiftCard extends Model
|
||||
|
||||
protected $fillable = [
|
||||
'customer_id',
|
||||
'use_once',
|
||||
'count',
|
||||
'amount',
|
||||
'total',
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Pargar extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'pargar_reqasts';
|
||||
protected $fillable = [
|
||||
'm',
|
||||
'route',
|
||||
'ip',
|
||||
'data',
|
||||
'finance_head',
|
||||
'finance_data',
|
||||
'response',
|
||||
'function_name',
|
||||
];
|
||||
protected $casts = [
|
||||
'data' => 'json',
|
||||
'finance_head' => 'json',
|
||||
'finance_data' => 'json',
|
||||
'response' => 'json',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user