This commit is contained in:
gholak tala
2026-01-24 14:03:11 +00:00
parent 7dcd83715a
commit eb26afbcb3
224 changed files with 32652 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Address extends Model
{
use HasFactory,Selector;
public $timestamps=FALSE;
protected $fillable =[
'city',
'province',
'phone',
'address',
'zip',
'customer_id',
'major_id',
'default_address',
];
protected $casts = [
'default_address'=>'boolean'
];
}
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class BankAccount extends Model
{
use HasFactory,SoftDeletes,Selector;
protected $fillable = [
'customer_id',
'cart_number',
'shaba_number',
'bank_name',
'account_number',
'sts'
];
static $STS = [
1=>'در انتظار تایید',
2=>'تایید شده',
3=>'رد شده',
];
public function customer(){
return $this->belongsTo(Customer::class);
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class City extends Model
{
use HasFactory;
public $timestamps = false;
protected $fillable=[
'title',
'code',
'parent_id',
'has_children',
'level'
];
protected $casts = [
'has_children'=>'boolean'
];
static $LEVEL = [
1=>'استان',
2=>'شهر',
];
public function children(){
return $this->hasMany(City::class,'parent_id')->with('children');
}
public function parent(){
return $this->belongsTo(City::class,'parent_id')->with('parent');
}
}
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Cnt extends Model
{
use HasFactory;
protected $table = 'const';
protected $fillable = [
'key',
'title_fa',
'value',
'value_json'
];
protected $casts = [
'value_json'=>'array'
];
}
+123
View File
@@ -0,0 +1,123 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Hash;
use Rooyesh\Wallet\models\Wallet;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Tymon\JWTAuth\Contracts\JWTSubject;
class Customer extends Authenticatable implements JWTSubject
{
use HasFactory,SoftDeletes,Selector;
protected $fillable = [
'fname',
'lname',
'name',
'active',
'finger_print',
'mobile',
'email',
'avatar_id',
'last_seen_at',
'default_address_id',
'sts',
'total_transaction',
'token_sms',
'password',
'orders_count',
'birth_date',
'shop_name',
'phone_number',
'code',
'city',
'province',
'n_code',
'is_archive',
'gram',
'trade_active',//آیا امکان معامله دارد؟
'type',
'referral_id',
'referral_to_id',
'credential_id',
'moshtari_code',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password',
'token_sms',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
"active" => "boolean",
"gold" => "float",
"is_archive" => "boolean",
"finger_print" => "boolean",
];
static $TYPE = [
1=>'همکار',
2=>'خانگی',
3=>'سرمایه گذار'
];
static $TYPES = [
1=>'همکار',
2=>'خانگی',
3=>'سرمایه گذار'
];
public function setNameAttribute($value = null)
{
$fname = $this->attributes['fname'] ?? '';
$lname = $this->attributes['lname'] ?? '';
$this->attributes['name'] = trim("$fname $lname");
}
public function wallet()
{
return $this->hasMany(Wallet::class ,'owner')->with(['fund','product'])->select(['cash', 'fund_id','product_id','gold', 'owner']);
}
public function user()
{
return $this->belongsTo(User::class)->select(['id','name']);
}
public function referral()
{
return $this->belongsTo(Customer::class, 'referral_to_id', 'referral_id');
}
// hash password
public function setPasswordAttribute($value){
$this->attributes['password'] = Hash::make($value);
}
public function getJWTIdentifier()
{
return $this->getKey();
}
public function getJWTCustomClaims()
{
return [];
}
public function tahesab()
{
return $this->hasMany(Tahesab::class, 'customer_id', 'id');
}
}
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Rooyesh\Wallet\models\Wallet;
class Fund extends Model
{
use HasFactory,Selector,SoftDeletes;
protected $fillable =[
'title',
'file_id',
'customer_id',
];
public function wallet()
{
return $this->hasMany(Wallet::class);
}
}
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Log extends Model
{
use HasFactory;
protected $fillable = [
'user_id',
'customer_id',
'data'
];
public function customer()
{
return $this->belongsTo(Customer::class)->select(['id','name']);
}
public function user()
{
return $this->belongsTo(User::class)->select(['id','name']);
}
}
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Message extends Model
{
use HasFactory;
protected $table = 'messages';
protected $receiver;
protected $fillable = [
'sms',
'receiver',
'platforms',
];
// public function receiver(){
// return $this->belongsTo(Customer::class,'receiver',"mobile")->select(['id','name','mobile','n_code','is_legal']);
// }
public function person()
{
return $this->belongsTo(Customer::class, 'receiver', 'mobile')
->select(['id', 'name', 'mobile', 'n_code', 'is_legal'])
->withDefault(function ($receiver) {
$mobile = $this->receiver;
if ($mobile && $user = User::where('mobile', $mobile)->first()) {
$receiver->fill($user->only(['id', 'name', 'mobile', 'n_code', 'is_legal']));
}
});
}
}
+64
View File
@@ -0,0 +1,64 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Rooyesh\Wallet\models\Transaction;
class Order extends Model
{
use HasFactory,Selector;
protected $fillable = [
'customer_id',
'sts',
'direction',
'amount',//میزان طلا
'price',//قیمت هر گرم طلا برای مشتری
'total_price',//قیمت کل برای مشتری
'price_original',//قیمت هر گرم طلا بدون سود
'total_price_liman',//قیمت هر گرم طلا بدون سود
'total_price_original',//قیمت کل بدون سود
'fee',//سود هر گرم
'total_fee',//سود کل
'service_charge_percentage',//درصد کارمزد
'service_charge',//میزان کارمزد
'service_charge_price',//مبلغ کارمزد به ریال
'payment_sts',
'payment_amount',//میزان پرداخت شده
'payment_remind',//میزان مبلغ باقی مانده
'type',//نوع مشتری
'pay_at',//تاریخ انجام معامله در پنل ادمین
'price_id',//
];
static $STS = [
1 => 'باز',
2 => 'موفق',
3 => 'ناموفق'
];
static $DIRECTION = [
1 => 'خرید',
2 => 'فروش'
];
static $PAYMENT_STS=[
1 => 'در انتظار پرداخت',
2 => 'در حال پرداخت',
3 => 'partially_paid',
4 => 'پرداخت شده',
5 => 'partially_refunded',
6 => 'مرجوعی',
7 => 'پرداخت نشده',
];
static $TYPE = [
1=>'همکار',
2=>'خانگی'
];
public function customer(){
return $this->belongsTo(Customer::class);
}
public function transactions(){
return $this->hasMany(Transaction::class);
}
}
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Price extends Model
{
use HasFactory;
protected $fillable = [
"price",
"date_at",
"time_at",
"user_id"
];
public function user()
{
return $this->belongsTo(User::class)->select(['id','name']);
}
public function order(){
return $this->hasMany(Order::class, 'price_id');
}
}
+18
View File
@@ -0,0 +1,18 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class PriceCandle extends Model
{
use HasFactory;
protected $fillable = [
"start",
"high",
"low",
"end",
"date_at"
];
}
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class PriceTrigger extends Model
{
use HasFactory, SoftDeletes;
protected $fillable = [
'customer_id',
'target_price',
'price_condition',
'action',
'is_active',
'triggered_at',
];
protected $casts = [
"is_active" => "boolean",
];
public function customer()
{
return $this->belongsTo(Customer::class);
}
}
+121
View File
@@ -0,0 +1,121 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Rooyesh\Wallet\models\Transaction;
use Rooyesh\Wallet\models\Wallet;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
class Product extends Model
{
use HasFactory,Selector,SoftDeletes;
protected $fillable = [
'title', // The title of the record.
'price', // The amount of the record.
'amount', // The amount of the record.
'unit', // The unit of the item.
'group_type', // The unit of the item.
'file_id', // The ID of the associated file.
'can_canceled', // Whether the record can be canceled (boolean).
'active', // The active status of the record (boolean).
'for_barayand', // Whether it is for Barayand (boolean).
'show', // Whether to show the record (boolean).
'open_sell', // Whether selling is open (boolean).
'auto_open_at', // Whether selling is open (boolean).
'auto_close_at', // Whether selling is open (boolean).
'kalhor_name', // The name of the Kalhor entity.
'default_credit', // Default credit amount.
'reading_method', // The method of reading.
'open_buy', // Whether buying is open (boolean).
'percent_fee_sell', // Add percent_fee_sell to fillable
'cash_fee_buy', // Add cash_fee_buy to fillable
'cash_fee_sell', // Add cash_fee_sell to fillable
'percent_fee_buy', // Add percent_fee_buy to fillable
'metal_id', //the material of metal (#gold or #silver)
];
protected $casts = [
'can_canceled' => 'boolean', // Cast to boolean.
'active' => 'boolean', // Cast to boolean.
'show' => 'boolean', // Cast to boolean.
'for_barayand' => 'boolean', // Cast to boolean.
'open_sell' => 'boolean', // Cast to boolean.
'auto_sell' => 'boolean', // Cast to boolean (you mentioned this in your casts but it's missing in `$fillable`).
'open_buy' => 'boolean', // Cast to boolean.
'auto_buy' => 'boolean', // Cast to boolean.
'price' => 'int', // Cast to float.
'percent_fee_sell' => 'float', // Cast to float.
'percent_fee_buy' => 'float', // Cast to float.
'cash_fee_buy' => 'int', // Cast to int or decimal if needed
'cash_fee_sell' => 'int', // Cast to int or decimal if needed
];
static $METAL_ID = [
1=>'طلا',
2=>'نقره',
];
public function wallet()
{
return $this->hasOne(Wallet::class);
}
public function walletMy()
{
return $this->hasOne(Wallet::class)->where('owner',auth()->user()->id);
}
public function file(){
return $this->belongsTo(File::class);
}
public function price(){
return $this->hasOne(Price::class)->orderBy('id','desc');
}
public function getPrices()
{
$now = Carbon::now();
$lastMonth = Carbon::now()->subMonth();
$subQuery = DB::table('prices')
->select('product_id', 'date_at', 'price')
->whereBetween('date_at', [$lastMonth, $now])
->where('product_id', $this->id)
->orderBy('date_at', 'desc')
->distinct('date_at')
->groupBy('date_at', 'product_id', 'price');
return DB::table(DB::raw("({$subQuery->toSql()}) as sub"))
->mergeBindings($subQuery->getQuery())
->get(['product_id', 'date_at', 'price']);
}
public function prices(){
$now = Carbon::now();
$lastMonth = Carbon::now()->subMonth();
$data = [];
$datas= $this->hasMany(Price::class, 'product_id')
->whereBetween('date_at', [$lastMonth, $now])
->distinct('date_at')
->select(['product_id', 'date_at', 'difference', 'price']);
return $datas;
}
public function default(){
return $this->hasMany(ProductCredit::class);
}
public function sub(){
return $this->hasOne(PackageProduct::class)->where('is_base',true);
}
// public function wallet(){
// return $this->hasOne(Wallet::class);
// }
public function transaction(){
return $this->hasMany(Transaction::class);
}
public function transactionAgentPanel(){
return $this->hasMany(Transaction::class)->where('note','برداشت بابت فروش')->orwhere('note','واریز بابت خرید')->orwhere('note','سند ورود طلا');
}
}
+260
View File
@@ -0,0 +1,260 @@
<?php
/**
* Created by PhpStorm.
* User: AraNote
* Date: 29/04/2018
* Time: 04:38 PM
*/
namespace App\Models;
use Hekmatinasser\Verta\Verta;
use Illuminate\Support\Arr;
trait Selector
{
static $formatJ = 'Y/n/j-H:i';
static $formatBJ = 'Y/n/j';
static $SELECT_CUJ = [
'created_at as caj',
'updated_at as uaj',
];
public static $DATE_FORMAT = 'Y/m/d - h:i';
public static $BIRTHDAY_FORMAT = 'Y/m/d';
static $SELECT_CAJ = 'created_at as caj';
static $SELECT_DAJ = 'date_at as daj';
static $SELECT_VAJ = 'vision_at as vaj';
static $SELECT_EAJ = 'end_at as eaj';
static $SELECT_SAJ = 'start_at as saj';
static $SELECT_BIRTH_DAY_J = 'birth_date as bdj';
static $SELECT_MARRIAGE_DATE_J = 'marriage_date as mdj';
static $SELECT_STS_STR = 'sts as sts_str';
static $SELECT_TYPE_STR = 'type as type_str';
static $SELECT_USER_TYPE_STR = 'user_type as user_type_str';
static $SELECT_GENDER_STR = 'gender as gender_str';
static $SELECT_TYPE_SEND_STR = 'type_send as type_send_str';
static $SELECT_PAYMENT_TYPE_STR = 'payment_type as payment_type_str';
public static $MAP_COLUMNS = [
'caj' => "created_at",
'daj' => 'date_at',
'eaj' => 'end_at',
'saj' => 'start_at',
'bdj' => 'birth_date',
'mdj' => 'marriage_date',
'vaj' => 'vision_at',
'type_str' => "type",
'user_type_str' => "user_type",
'sts_str' => "sts",
'gender_str' => "gender",
'type_send_str' => "type_send",
'payment_type_str' => "payment_type",
];
//created_at
public function getCreatedAtJAttribute($value)
{
if (is_null($value)) return null;
return Verta::instance($value)->format(self::$DATE_FORMAT);
}
public function getCajAttribute($value)
{
return $this->convertDate($value);
}
// ------------------start_at----------------------------------
public function getStartAtJAttribute($value)
{
if (is_null($value)) return null;
return Verta::instance($value)->format(self::$DATE_FORMAT);
}
public function getSajAttribute($value)
{
return $this->convertDate($value);
}
// ----------------------date_at--------------------------------
public function getDateJAttribute($value)
{
if (is_null($value)) return null;
return Verta::instance($value)->format(self::$BIRTHDAY_FORMAT);
}
public function getdajAttribute($value)
{
return $this->convertDateB($value);
}
// ----------------------birthday_at----------------------------------
public function getBirthDateJAttribute($value)
{
if (is_null($value)) return null;
return Verta::instance($value)->format(self::$BIRTHDAY_FORMAT);
}
public function getBdjAttribute($value)
{
return $this->convertDateB($value);
}
// ----------------------marriage_date----------------------------------
public function getMarriageDateJAttribute($value)
{
if (is_null($value)) return null;
return Verta::instance($value)->format(self::$BIRTHDAY_FORMAT);
}
public function getMdjAttribute($value)
{
return $this->convertDateB($value);
}
// -------------------vision_at---------------------------------------
public function getVisionAtJAttribute($value)
{
if (is_null($value)) return null;
return Verta::instance($value)->format(self::$DATE_FORMAT);
}
public function getVajAttribute($value)
{
return $this->convertDate($value);
}
// --------------------------end_at-------------------------------------------
public function getEndAtJAttribute($value)
{
if (is_null($value)) return null;
return Verta::instance($value)->format(self::$DATE_FORMAT);
}
public function getEajAttribute($value)
{
return $this->convertDate($value);
}
// -------------------------type_str----------------------------------------
public function getTypeStrAttribute($value)
{
if (is_null($value)) return $value;
return Arr::get(self::$TYPES, $value, 'تعریف نشده');
}
static function GetTypes($value)
{
if (is_null($value)) {
return null;
}
return Arr::get(self::$TYPES, $value, 'بدون مقدار');
}
// -------------------------payment_type_str----------------------------------------
public function getPaymentTypeStrAttribute($value)
{
if (is_null($value)) return $value;
return Arr::get(self::$PAYMENT_TYPE, $value, 'تعریف نشده');
}
static function GetPaymentTypes($value)
{
if (is_null($value)) {
return null;
}
return Arr::get(self::$PAYMENT_TYPE, $value, 'بدون مقدار');
}
// ----------------------------user_type_str-------------------------------
public function getUserTypeStrAttribute($value)
{
if (is_null($value)) return $value;
$cnt = Cnt::select('value')->findOrFail($value)->pluck('value')->toArray();
return Arr::get($cnt, $value, 'تعریف نشده');
}
static function GetUserType($value)
{
if (is_null($value)) {
return null;
}
return Arr::get(config('userType'), $value, 'بدون مقدار');
}
// -------------------------------sts_str-----------------------------
static function GetSts($value)
{
if (is_null($value)) {
return null;
}
return Arr::get(self::$STS, $value, 'بدون مقدار');
}
public function getStsStrAttribute($value)
{
return self::GetSts($value);
}
// -------------------------gender_str----------------------------------------
public function getGenderStrAttribute($value)
{
if (is_null($value)) return $value;
return Arr::get(self::$GENDER, $value, 'تعریف نشده');
}
static function GetGender($value)
{
if (is_null($value)) {
return null;
}
return Arr::get(self::$GENDER, $value, 'بدون مقدار');
}
//---------------------type_send str--------------------------------------
public function getTypeSendStrAttribute($value)
{
if (is_null($value)) return $value;
return Arr::get(self::$TYPE_SEND, $value, 'تعریف نشده');
}
static function GetTypeSend($value)
{
if (is_null($value)) {
return null;
}
return Arr::get(self::$TYPE_SEND, $value, 'بدون مقدار');
}
static function selectWithjDate()
{
return array_merge(['*'], self::$SELECT_CUJ);
}
protected function convertDate($value, $format = NULL, $farsi = TRUE)
{
if (is_null($value)) {
return NULL;
}
if (is_null($format)) {
$format = self::$formatJ;
}
return Verta::instance($value)->format($format, $farsi);
}
protected function convertDateB($value, $format = NULL, $farsi = TRUE)
{
if (is_null($value)) {
return NULL;
}
if (is_null($format)) {
$format = self::$formatBJ;
}
return Verta::instance($value)->format($format, $farsi);
}
public function convertColumns($key){
return Arr::get(self::$MAP_COLUMNS , $key , $key);
}
// public function getUserTypeStrAttribute(){
// if (is_null($this->attributes['user_type'])) return null;
// return Arr::get(config('userType') , $this->attributes['user_type'] , 'تعریف نشده');
// }
public static function deleteUrl($src){
return substr($src,strlen(\request()->root())+1,strlen($src));
}
}
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Setting extends Model
{
use HasFactory;
protected $table = 'settings';
protected $fillable = [
'key',
'title_fa',
'value',
'value_json'
];
protected $casts = [
'value_json'=>'array'
];
}
+56
View File
@@ -0,0 +1,56 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Tahesab extends Model
{
use HasFactory;
protected $table = 'tahesab';
protected $fillable = [
'customer_id',
'amount',
'desc',
'order_id',
'date',
'created_at',
'updated_at',
'sh_factor',
'tahesab_id',
'res',
'factor_number',
'tah_id',
];
static $STS = [
1 => 'باز',
2 => 'موفق',
3 => 'ناموفق'
];
static $DIRECTION = [
1 => 'خرید',
2 => 'فروش'
];
static $PAYMENT_STS=[
1 => 'در انتظار پرداخت',
2 => 'در حال پرداخت',
3 => 'partially_paid',
4 => 'پرداخت شده',
5 => 'partially_refunded',
6 => 'مرجوعی',
7 => 'پرداخت نشده',
];
public function customer()
{
return $this->belongsTo(Customer::class, 'customer_id', 'id');
}
}
+63
View File
@@ -0,0 +1,63 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class TransactionsAdmin extends Model
{
use HasFactory,SoftDeletes,Selector;
protected $fillable = [
'customer_id',
'order_id',
'customer_to_id',
'user_id',
'wallet',
'transaction_id',
'cash',
'note',
'type',
'gold',
'balance_cash',
'balance_gold',
'withdraw_id',
];
// static $STS = [
// 1=>'در انتظار تایید',
// 2=>'تایید شده',
// 3=>'رد شده',
// ];
public function customer()
{
return $this->belongsTo(Customer::class);
}
public function customerTo()
{
return $this->belongsTo(Customer::class, 'customer_to_id');
}
public function user()
{
return $this->belongsTo(User::class);
}
public function order()
{
return $this->belongsTo(Order::class);
}
// public function transaction()
// {
// return $this->belongsTo(\Rooyesh\Wallet\Models\Transaction::class, 'transaction_id');
// }
public function withdraw()
{
return $this->belongsTo(Withdraw::class);
}
}
+83
View File
@@ -0,0 +1,83 @@
<?php
namespace App\Models;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Illuminate\Support\Facades\Hash;
use Tymon\JWTAuth\Contracts\JWTSubject;
class User extends Authenticatable implements JWTSubject
{
use HasApiTokens, HasFactory, Notifiable,Selector,SoftDeletes;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'fname',
'lname',
'name',
'password',
'mobile',
'user_type',
'token_sms',
'last_seen_at',
'active',
'send_sms',
'avatar_id',
'email',
'sts'
];
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'active'=> 'boolean',
'send_sms'=> 'boolean',
];
/**
* Get the identifier that will be stored in the subject claim of the JWT.
*
* @return mixed
*/
public function getJWTIdentifier()
{
return $this->getKey();
}
/**
* Return a key value array, containing any custom claims to be added to the JWT.
*
* @return array
*/
public function getJWTCustomClaims()
{
return [];
}
// hash password
public function setPasswordAttribute($value){
$this->attributes['password'] = Hash::make($value);
}
}
+1
View File
@@ -0,0 +1 @@
<?php␍␍namespace App\Models;␍␍use Illuminate\Database\Eloquent\Factories\HasFactory;␍use Illuminate\Database\Eloquent\Model;␍use Rooyesh\Wallet\models\Transaction;␍␍␍class Withdraw extends Model␍{␍ use HasFactory,Selector;␍ protected $fillable = [␍ 'customer_id',␍ 'user_id',␍ 'cash',␍ 'gold',␍ 'note',␍ 'tracked_number',␍ 'bank_account_id',␍ 'date_at',//تاریخ و ساعت واریز␍ 'sts',␍ 'type',␍ ];␍ static $STS = [␍ 1 => 'در انتظار واریز',␍ 2 => 'واریز شد',␍ 4 => 'واریز توسط ادمین',␍ 5 => 'پاداش معرفی',␍ 9 => 'سود زیر مجموعه',␍ 3 => 'واریز ناموفق',␍ 50 => 'در انتظار ارسال',␍ 51 => 'ارسال شده',␍ 52 => 'لغو شده',␍ ];␍ public function customer()␍ {␍ return $this->belongsTo('App\Models\Customer')->select(['id','name',"mobile"]);␍ }␍ public function Address()␍ {␍ return $this->belongsTo('App\Models\Address');␍ }␍ public function Transaction()␍ {␍ return $this->hasMany(Transaction::class, 'withdraw_id', 'id');␍ }␍ public function bank_account()␍ {␍ return $this->hasOne('App\Models\BankAccount','id','bank_account_id');␍ }␍}␍
+168
View File
@@ -0,0 +1,168 @@
[10-Jun-2024 05:12:23 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Order.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Order.php on line 8
[10-Jun-2024 05:12:47 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Log.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Log.php on line 8
[10-Jun-2024 08:43:37 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Fund.php:10
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Fund.php on line 10
[10-Jun-2024 08:46:18 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Auth\User' not found in /home/montechi/public_html/server_app/app/Models/Customer.php:13
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Customer.php on line 13
[10-Jun-2024 08:49:06 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/PriceCandle.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/PriceCandle.php on line 8
[10-Jun-2024 08:49:30 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/BankAccount.php:9
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/BankAccount.php on line 9
[10-Jun-2024 15:43:01 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Price.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Price.php on line 8
[10-Jun-2024 15:46:46 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Withdraw.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Withdraw.php on line 8
[10-Jun-2024 20:04:25 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Cnt.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Cnt.php on line 8
[10-Jun-2024 20:04:25 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Auth\User' not found in /home/montechi/public_html/server_app/app/Models/Customer.php:13
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Customer.php on line 13
[10-Jun-2024 20:04:25 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Fund.php:10
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Fund.php on line 10
[10-Jun-2024 20:04:26 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Auth\User' not found in /home/montechi/public_html/server_app/app/Models/User.php:15
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/User.php on line 15
[10-Jun-2024 20:04:28 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Price.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Price.php on line 8
[10-Jun-2024 20:04:29 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Order.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Order.php on line 8
[10-Jun-2024 20:04:30 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Log.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Log.php on line 8
[10-Jun-2024 20:04:31 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/BankAccount.php:9
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/BankAccount.php on line 9
[10-Jun-2024 20:04:35 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/PriceCandle.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/PriceCandle.php on line 8
[10-Jun-2024 20:05:30 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Withdraw.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Withdraw.php on line 8
[10-Jun-2024 20:05:32 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Log.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Log.php on line 8
[10-Jun-2024 20:05:39 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Price.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Price.php on line 8
[10-Jun-2024 20:05:40 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Auth\User' not found in /home/montechi/public_html/server_app/app/Models/Customer.php:13
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Customer.php on line 13
[10-Jun-2024 20:05:46 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Fund.php:10
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Fund.php on line 10
[10-Jun-2024 20:05:51 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Cnt.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Cnt.php on line 8
[10-Jun-2024 20:05:54 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Order.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Order.php on line 8
[10-Jun-2024 20:05:55 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Auth\User' not found in /home/montechi/public_html/server_app/app/Models/User.php:15
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/User.php on line 15
[10-Jun-2024 20:06:09 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/BankAccount.php:9
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/BankAccount.php on line 9
[10-Jun-2024 20:06:10 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/PriceCandle.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/PriceCandle.php on line 8
[10-Jun-2024 20:07:30 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Log.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Log.php on line 8
[10-Jun-2024 20:07:30 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Withdraw.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Withdraw.php on line 8
[10-Jun-2024 20:07:51 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Cnt.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Cnt.php on line 8
[10-Jun-2024 20:07:54 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Order.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Order.php on line 8
[10-Jun-2024 20:07:56 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Auth\User' not found in /home/montechi/public_html/server_app/app/Models/User.php:15
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/User.php on line 15
[10-Jun-2024 20:07:58 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/BankAccount.php:9
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/BankAccount.php on line 9
[10-Jun-2024 20:07:58 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/PriceCandle.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/PriceCandle.php on line 8
[10-Jun-2024 20:09:52 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Order.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Order.php on line 8
[10-Jun-2024 20:09:53 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/PriceCandle.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/PriceCandle.php on line 8
[10-Jun-2024 20:09:53 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/BankAccount.php:9
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/BankAccount.php on line 9
[10-Jun-2024 20:10:42 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/BankAccount.php:9
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/BankAccount.php on line 9
[10-Jun-2024 20:10:56 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Auth\User' not found in /home/montechi/public_html/server_app/app/Models/User.php:15
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/User.php on line 15
[10-Jun-2024 20:11:06 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Cnt.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Cnt.php on line 8
[10-Jun-2024 20:11:44 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/Fund.php:10
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/Fund.php on line 10
[10-Jun-2024 20:11:56 UTC] PHP Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in /home/montechi/public_html/server_app/app/Models/PriceCandle.php:8
Stack trace:
#0 {main}
thrown in /home/montechi/public_html/server_app/app/Models/PriceCandle.php on line 8