Updates to 03-2025

This commit is contained in:
Kevin Adametz 2025-04-01 10:36:47 +02:00
parent bfa3bb1df4
commit 9ae662f63e
243 changed files with 12580 additions and 12018 deletions

View file

@ -35,6 +35,12 @@ use Illuminate\Database\Eloquent\Model;
* @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
@ -50,14 +56,29 @@ class ShoppingInstance extends Model
];
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'];
protected $casts = ['shopping_data' => 'array', 'amount' => 'float'];
protected $fillable = [
'identifier', 'user_shop_id', 'auth_user_id', 'payment', 'subdomain', 'language', 'country_id', 'shopping_data', 'back'
'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();
}
@ -78,5 +99,11 @@ class ShoppingInstance extends Model
return $this->belongsTo('App\User','auth_user_id');
}
public function getAmountFormatted(){
return formatNumber($this->amount);
}
}