User Statistik
This commit is contained in:
parent
70240d2b6a
commit
53bdba33cd
24 changed files with 2633 additions and 9 deletions
29
app/Models/BackofficeStatisticsSnapshot.php
Normal file
29
app/Models/BackofficeStatisticsSnapshot.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class BackofficeStatisticsSnapshot extends Model
|
||||
{
|
||||
protected $table = 'backoffice_statistics_snapshots';
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'year',
|
||||
'month',
|
||||
'payload',
|
||||
'calculated_at',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'user_id' => 'int',
|
||||
'year' => 'int',
|
||||
'month' => 'int',
|
||||
'payload' => 'array',
|
||||
'calculated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -167,6 +167,8 @@ class ShoppingOrder extends Model
|
|||
'api_notice',
|
||||
'api_status',
|
||||
'mode',
|
||||
'customer_order_source',
|
||||
'customer_order_source_comment',
|
||||
'shipped',
|
||||
'tracking',
|
||||
];
|
||||
|
|
@ -180,6 +182,29 @@ class ShoppingOrder extends Model
|
|||
'points' => 'float',
|
||||
];
|
||||
|
||||
public const CUSTOMER_ORDER_SOURCE_OPTIONS = [
|
||||
'recommendation' => 'Empfehlung',
|
||||
'social_media' => 'Social Media',
|
||||
'search_engine' => 'Google / Suchmaschine',
|
||||
'event' => 'Event / Messe',
|
||||
'consultant_link' => 'Berater-Link',
|
||||
'returning_customer' => 'Wiederbesteller',
|
||||
'other' => 'Sonstiges',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function customerOrderSourceOptions(): array
|
||||
{
|
||||
return self::CUSTOMER_ORDER_SOURCE_OPTIONS;
|
||||
}
|
||||
|
||||
public function getCustomerOrderSourceLabel(): string
|
||||
{
|
||||
return self::CUSTOMER_ORDER_SOURCE_OPTIONS[$this->customer_order_source] ?? '';
|
||||
}
|
||||
|
||||
public static $shippedTypes = [
|
||||
0 => 'open',
|
||||
1 => 'in_process',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue