update 20.10.2025
This commit is contained in:
parent
8c11130b5d
commit
a939cd51ef
616 changed files with 84821 additions and 4121 deletions
109
dev/app-bak/Models/ShoppingInstance.php
Normal file
109
dev/app-bak/Models/ShoppingInstance.php
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\ShoppingInstance
|
||||
*
|
||||
* @property string $identifier
|
||||
* @property int $user_shop_id
|
||||
* @property int|null $auth_user_id
|
||||
* @property int $country_id
|
||||
* @property string $subdomain
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property-read \App\User|null $auth_user
|
||||
* @property-read \App\Models\Country $country
|
||||
* @property-read \App\Models\UserShop $user_shop
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereAuthUserId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereCountryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereIdentifier($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereSubdomain($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereUserShopId($value)
|
||||
* @property int|null $payment
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance wherePayment($value)
|
||||
* @property array|null $shopping_data
|
||||
* @property string|null $back
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereBack($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereShoppingData($value)
|
||||
* @property string|null $language
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingInstance whereLanguage($value)
|
||||
* @property int|null $status
|
||||
* @property float|null $amount
|
||||
* @property int|null $shopping_user_id
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingInstance whereAmount($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingInstance whereShoppingUserId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingInstance whereStatus($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class ShoppingInstance extends Model
|
||||
{
|
||||
|
||||
public $paymentTypes = [
|
||||
1 => 'Customer Shop',
|
||||
2 => 'Berater Shop',
|
||||
3 => 'Berater Membership',
|
||||
4 => 'Berater Wizard',
|
||||
5 => 'Berater Homeparty',
|
||||
6 => 'Berater Shop to Customer Shop',
|
||||
|
||||
];
|
||||
|
||||
public $statuses = [
|
||||
0 => 'link_sent',
|
||||
1 => 'link_openly',
|
||||
2 => 'link_check',
|
||||
3 => 'link_pending',
|
||||
4 => 'link_appointed',
|
||||
5 => 'link_failed',
|
||||
6 => 'link_canceled',
|
||||
10 => 'link_paid',
|
||||
];
|
||||
|
||||
protected $table = 'shopping_instances';
|
||||
|
||||
protected $casts = ['shopping_data' => 'array', 'amount' => 'float'];
|
||||
|
||||
protected $fillable = [
|
||||
'identifier', 'user_shop_id', 'auth_user_id', 'status', 'payment', 'subdomain', 'language', 'country_id', 'amount', 'shopping_user_id', 'shopping_data', 'back'
|
||||
];
|
||||
|
||||
public function getStatus(){
|
||||
return isset($this->statuses[$this->status]) ? $this->statuses[$this->status] : 'link_sent';
|
||||
}
|
||||
|
||||
public function getLocale(){
|
||||
return $this->language ? $this->language : \App::getLocale();
|
||||
}
|
||||
|
||||
public function user_shop()
|
||||
{
|
||||
return $this->belongsTo('App\Models\UserShop', 'user_shop_id');
|
||||
}
|
||||
|
||||
public function country()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Country', 'country_id');
|
||||
}
|
||||
|
||||
//can null
|
||||
public function auth_user()
|
||||
{
|
||||
return $this->belongsTo('App\User','auth_user_id');
|
||||
}
|
||||
|
||||
public function getAmountFormatted(){
|
||||
return formatNumber($this->amount);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue