added kashkool

This commit is contained in:
2026-06-11 22:08:47 +03:30
parent 779a67a23e
commit 2d177ad581
24 changed files with 1575 additions and 3 deletions
+37
View File
@@ -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');
}
}
+33
View File
@@ -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');
}
}
+22
View File
@@ -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',
];
}
+1
View File
@@ -14,6 +14,7 @@ class GiftCard extends Model
protected $fillable = [
'customer_id',
'use_once',
'count',
'amount',
'total',
+28
View File
@@ -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',
];
}