Compare commits
122
Commits
5fa0056b8b
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d2f4c1052 | ||
|
|
d9be81b3a6 | ||
|
|
6a64dc0b8c | ||
|
|
5bb3defa32 | ||
|
|
330a262be4 | ||
|
|
4529cec124 | ||
|
|
bf5e06848a | ||
|
|
a125dddb4c | ||
|
|
a02f762910 | ||
|
|
7afc8e87ad | ||
|
|
ee3afc95da | ||
|
|
4ca4a32ca1 | ||
|
|
19169d38f3 | ||
|
|
b2239596ec | ||
|
|
da840dc501 | ||
|
|
c6bfe04b6a | ||
|
|
15a900b2a8 | ||
|
|
113dbad806 | ||
|
|
20e93ba014 | ||
|
|
4b93848164 | ||
|
|
d4a4d0c5f1 | ||
|
|
d1163b6692 | ||
|
|
b8baf9c65b | ||
|
|
ec33b51bff | ||
|
|
07d4383145 | ||
|
|
c8d8f1ced1 | ||
|
|
8eaead42e6 | ||
|
|
51e2659a1e | ||
|
|
54bbb420ec | ||
|
|
b20fcb0034 | ||
|
|
9cfa60de30 | ||
|
|
d6a13837c5 | ||
|
|
c6b2602564 | ||
|
|
efda1b66f6 | ||
|
|
d05c24b96a | ||
|
|
fa89153a76 | ||
|
|
55cd29da32 | ||
|
|
5ac22d5e18 | ||
|
|
d2733e16bc | ||
|
|
31f86944bd | ||
|
|
ac7037170d | ||
|
|
2545542033 | ||
|
|
33e8107517 | ||
|
|
c8858574c1 | ||
|
|
55f31acf2a | ||
|
|
fc1e1b2832 | ||
|
|
e09e42ab41 | ||
|
|
b89410c8f1 | ||
|
|
7ba7fb2dac | ||
|
|
2312a9cc57 | ||
|
|
513dc7002d | ||
|
|
4f9e02f79d | ||
|
|
0b6854378c | ||
|
|
a9b004963c | ||
|
|
e41168121f | ||
|
|
483b5e1abe | ||
|
|
b60e7c2f99 | ||
|
|
03737bc540 | ||
|
|
8ade164b9d | ||
|
|
d221ff6eac | ||
|
|
8ec2203918 | ||
|
|
838d6419f4 | ||
|
|
f6f5dd0c7c | ||
|
|
4b2a1c1b01 | ||
|
|
d5713472fc | ||
|
|
e52722d3e1 | ||
|
|
2728944c39 | ||
|
|
03b3d47151 | ||
|
|
acf1b78c47 | ||
|
|
8ffd838a27 | ||
|
|
f26cf05573 | ||
|
|
5926e4e226 | ||
|
|
62a2e1710a | ||
|
|
5503dc7ba0 | ||
|
|
7fc0e2e029 | ||
|
|
432ccdb3fe | ||
|
|
c4796f0ade | ||
|
|
e0c1baf849 | ||
|
|
f9c0c5aec5 | ||
|
|
7e0b74d79c | ||
|
|
db917bdc92 | ||
|
|
34701ecbff | ||
|
|
e3e74f7d91 | ||
|
|
ed9e1db12e | ||
|
|
eb66222c85 | ||
|
|
436a8ec142 | ||
|
|
c2f068e8bf | ||
|
|
c228041abf | ||
|
|
89cb571b56 | ||
|
|
0a09953bdd | ||
|
|
407f773dec | ||
|
|
b89372e0c2 | ||
|
|
fb2d5503f6 | ||
|
|
50e15caad1 | ||
|
|
e384c577d1 | ||
|
|
aa0a29cb0e | ||
|
|
15ec42c41a | ||
|
|
e7ddd8049b | ||
|
|
0649a82b02 | ||
|
|
d6fe50e69a | ||
|
|
c0c4373ba0 | ||
|
|
5b87936a50 | ||
|
|
b2737232d1 | ||
|
|
8ae58d2e2a | ||
|
|
01b62be635 | ||
|
|
274d653f95 | ||
|
|
0a936bc84b | ||
|
|
8cb1d428cb | ||
|
|
29018914d1 | ||
|
|
8092b5c419 | ||
|
|
15e3fc392d | ||
|
|
4b39c59630 | ||
|
|
36584b8de4 | ||
|
|
28882bfdb5 | ||
|
|
1fbf53cf1f | ||
|
|
4f7f9f28f1 | ||
|
|
d0e2f32501 | ||
|
|
679038a503 | ||
|
|
f9e8b17d58 | ||
|
|
498660e9cc | ||
|
|
be67754a38 | ||
|
|
712b2f2f68 |
No files matched your search
@@ -0,0 +1,8 @@
|
|||||||
|
socio proviamo a definire per semplicità i 3 modi di indagine del tool così è più facile anche per noi
|
||||||
|
|
||||||
|
1) SMP
|
||||||
|
|
||||||
|
2) ET (indagine per Events e Team, quella che abbiamo fatto per Lanus e Sarsfield)
|
||||||
|
|
||||||
|
3) PP
|
||||||
|
|
||||||
+536
-26
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A helper file for Laravel, to provide autocomplete information to your IDE
|
* A helper file for Laravel, to provide autocomplete information to your IDE
|
||||||
* Generated for Laravel 12.56.0.
|
* Generated for Laravel 12.70.0.
|
||||||
*
|
*
|
||||||
* This file should not be included in your code, only analyzed by your IDE!
|
* This file should not be included in your code, only analyzed by your IDE!
|
||||||
*
|
*
|
||||||
@@ -3349,6 +3349,19 @@ namespace Illuminate\Support\Facades {
|
|||||||
$instance->precompiler($precompiler);
|
$instance->precompiler($precompiler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the path to the compiled version of a view.
|
||||||
|
*
|
||||||
|
* @param string $path
|
||||||
|
* @return string
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function getCompiledPath($path)
|
||||||
|
{
|
||||||
|
/** @var \Illuminate\View\Compilers\BladeCompiler $instance */
|
||||||
|
return $instance->getCompiledPath($path);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the given callback using a custom echo format.
|
* Execute the given callback using a custom echo format.
|
||||||
*
|
*
|
||||||
@@ -3412,20 +3425,6 @@ namespace Illuminate\Support\Facades {
|
|||||||
$instance->withoutComponentTags();
|
$instance->withoutComponentTags();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the path to the compiled version of a view.
|
|
||||||
*
|
|
||||||
* @param string $path
|
|
||||||
* @return string
|
|
||||||
* @static
|
|
||||||
*/
|
|
||||||
public static function getCompiledPath($path)
|
|
||||||
{
|
|
||||||
//Method inherited from \Illuminate\View\Compilers\Compiler
|
|
||||||
/** @var \Illuminate\View\Compilers\BladeCompiler $instance */
|
|
||||||
return $instance->getCompiledPath($path);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if the view at the given path is expired.
|
* Determine if the view at the given path is expired.
|
||||||
*
|
*
|
||||||
@@ -10379,6 +10378,20 @@ namespace Illuminate\Support\Facades {
|
|||||||
return $instance->globalOptions($options);
|
return $instance->globalOptions($options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute a callback while requests are created without global middleware or global options.
|
||||||
|
*
|
||||||
|
* @template TReturn
|
||||||
|
* @param (\Closure(): TReturn) $callback
|
||||||
|
* @return TReturn
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function withoutGlobalConfiguration($callback)
|
||||||
|
{
|
||||||
|
/** @var \Illuminate\Http\Client\Factory $instance */
|
||||||
|
return $instance->withoutGlobalConfiguration($callback);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new response instance for use during stubbing.
|
* Create a new response instance for use during stubbing.
|
||||||
*
|
*
|
||||||
@@ -14154,7 +14167,6 @@ namespace Illuminate\Support\Facades {
|
|||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @method static \BackedEnum|(\BackedEnum|null enum(string $key, string $enumClass, \BackedEnum|null $default = null)
|
|
||||||
* @see \Illuminate\Http\Request
|
* @see \Illuminate\Http\Request
|
||||||
*/
|
*/
|
||||||
class Request {
|
class Request {
|
||||||
@@ -15134,10 +15146,6 @@ namespace Illuminate\Support\Facades {
|
|||||||
* being the original client, and each successive proxy that passed the request
|
* being the original client, and each successive proxy that passed the request
|
||||||
* adding the IP address where it received the request from.
|
* adding the IP address where it received the request from.
|
||||||
*
|
*
|
||||||
* If your reverse proxy uses a different header name than "X-Forwarded-For",
|
|
||||||
* ("Client-Ip" for instance), configure it via the $trustedHeaderSet
|
|
||||||
* argument of the Request::setTrustedProxies() method instead.
|
|
||||||
*
|
|
||||||
* @see getClientIps()
|
* @see getClientIps()
|
||||||
* @see https://wikipedia.org/wiki/X-Forwarded-For
|
* @see https://wikipedia.org/wiki/X-Forwarded-For
|
||||||
* @static
|
* @static
|
||||||
@@ -20614,6 +20622,7 @@ namespace Illuminate\Support\Facades {
|
|||||||
* @param array $headers
|
* @param array $headers
|
||||||
* @param string|null $disposition
|
* @param string|null $disposition
|
||||||
* @return \Symfony\Component\HttpFoundation\StreamedResponse
|
* @return \Symfony\Component\HttpFoundation\StreamedResponse
|
||||||
|
* @throws UnableToRetrieveMetadata
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function response($path, $name = null, $headers = [], $disposition = 'inline')
|
public static function response($path, $name = null, $headers = [], $disposition = 'inline')
|
||||||
@@ -20631,6 +20640,7 @@ namespace Illuminate\Support\Facades {
|
|||||||
* @param string|null $name
|
* @param string|null $name
|
||||||
* @param array $headers
|
* @param array $headers
|
||||||
* @return \Symfony\Component\HttpFoundation\StreamedResponse
|
* @return \Symfony\Component\HttpFoundation\StreamedResponse
|
||||||
|
* @throws UnableToRetrieveMetadata
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function serve($request, $path, $name = null, $headers = [])
|
public static function serve($request, $path, $name = null, $headers = [])
|
||||||
@@ -20647,6 +20657,7 @@ namespace Illuminate\Support\Facades {
|
|||||||
* @param string|null $name
|
* @param string|null $name
|
||||||
* @param array $headers
|
* @param array $headers
|
||||||
* @return \Symfony\Component\HttpFoundation\StreamedResponse
|
* @return \Symfony\Component\HttpFoundation\StreamedResponse
|
||||||
|
* @throws UnableToRetrieveMetadata
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function download($path, $name = null, $headers = [])
|
public static function download($path, $name = null, $headers = [])
|
||||||
@@ -20845,6 +20856,7 @@ namespace Illuminate\Support\Facades {
|
|||||||
*
|
*
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @return string|false
|
* @return string|false
|
||||||
|
* @throws UnableToRetrieveMetadata
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function mimeType($path)
|
public static function mimeType($path)
|
||||||
@@ -23447,6 +23459,41 @@ namespace Illuminate\Support\Facades {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace AnourValar\EloquentSerialize\Facades {
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
class EloquentSerializeFacade {
|
||||||
|
/**
|
||||||
|
* Pack
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Relations\Relation $builder
|
||||||
|
* @return string
|
||||||
|
* @throws \RuntimeException
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function serialize($builder)
|
||||||
|
{
|
||||||
|
/** @var \AnourValar\EloquentSerialize\Service $instance */
|
||||||
|
return $instance->serialize($builder);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unpack
|
||||||
|
*
|
||||||
|
* @param mixed $package
|
||||||
|
* @throws \LogicException
|
||||||
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function unserialize($package)
|
||||||
|
{
|
||||||
|
/** @var \AnourValar\EloquentSerialize\Service $instance */
|
||||||
|
return $instance->unserialize($package);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
namespace Fruitcake\LaravelDebugbar\Facades {
|
namespace Fruitcake\LaravelDebugbar\Facades {
|
||||||
/**
|
/**
|
||||||
* @method static void alert(mixed $message)
|
* @method static void alert(mixed $message)
|
||||||
@@ -24191,6 +24238,24 @@ namespace BezhanSalleh\FilamentShield\Facades {
|
|||||||
return $instance->buildPermissionKeyUsing($callback);
|
return $instance->buildPermissionKeyUsing($callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function enforcePolicies($condition = true, $except = null)
|
||||||
|
{
|
||||||
|
/** @var \BezhanSalleh\FilamentShield\FilamentShield $instance */
|
||||||
|
return $instance->enforcePolicies($condition, $except);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function registerEnforcedPolicies()
|
||||||
|
{
|
||||||
|
/** @var \BezhanSalleh\FilamentShield\FilamentShield $instance */
|
||||||
|
return $instance->registerEnforcedPolicies();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
@@ -24327,6 +24392,19 @@ namespace BezhanSalleh\FilamentShield\Facades {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Transform custom permissions from config into formatted key => label pairs.
|
||||||
|
*
|
||||||
|
* When `format_custom_permission_keys` is enabled (default), permission keys are
|
||||||
|
* formatted according to the configured case. If the key contains the configured
|
||||||
|
* separator, each segment is formatted independently and rejoined.
|
||||||
|
*
|
||||||
|
* When a `buildPermissionKeyUsing` closure is registered, custom permissions are
|
||||||
|
* routed through it with `entity` set to `'custom'` and `affix` set to `null`.
|
||||||
|
* Returning `null` from the closure falls back to the default formatting behavior.
|
||||||
|
*
|
||||||
|
* When `format_custom_permission_keys` is disabled, keys are used exactly as
|
||||||
|
* defined in config — useful for externally managed permissions (Terraform, Keycloak, etc.).
|
||||||
|
*
|
||||||
* @return array<string, string>
|
* @return array<string, string>
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
@@ -25545,6 +25623,299 @@ namespace Livewire {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace Maatwebsite\Excel\Facades {
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
class Excel {
|
||||||
|
/**
|
||||||
|
* @param array<string, string> $headers
|
||||||
|
* @param array<string, string> $headers
|
||||||
|
* @throws Exception
|
||||||
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function download($export, $fileName, $writerType = null, $headers = [])
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||||
|
return $instance->download($export, $fileName, $writerType, $headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string|null $disk Fallback for usage with named properties
|
||||||
|
* @throws Exception
|
||||||
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function store($export, $filePath, $diskName = null, $writerType = null, $diskOptions = [], $disk = null)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||||
|
return $instance->store($export, $filePath, $diskName, $writerType, $diskOptions, $disk);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function queue($export, $filePath, $disk = null, $writerType = null, $diskOptions = [])
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||||
|
return $instance->queue($export, $filePath, $disk, $writerType, $diskOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function raw($export, $writerType)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||||
|
return $instance->raw($export, $writerType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws ValidationException
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function import($import, $filePath, $disk = null, $readerType = null)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||||
|
return $instance->import($import, $filePath, $disk, $readerType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array<array-key, array<int, array<array-key, mixed>>>
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function toArray($import, $filePath, $disk = null, $readerType = null)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||||
|
return $instance->toArray($import, $filePath, $disk, $readerType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Collection<array-key, Collection<int, Collection<array-key, mixed>>>
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function toCollection($import, $filePath, $disk = null, $readerType = null)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||||
|
return $instance->toCollection($import, $filePath, $disk, $readerType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function queueImport($import, $filePath, $disk = null, $readerType = null)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||||
|
return $instance->queueImport($import, $filePath, $disk, $readerType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a custom export source handler.
|
||||||
|
*
|
||||||
|
* The handler may implement SheetSourceHandler (sync), QueuedSheetSourceHandler
|
||||||
|
* (queued), or both. Pass a class name to have it resolved lazily from the
|
||||||
|
* service container, or pass an instance directly.
|
||||||
|
*
|
||||||
|
* @param \Maatwebsite\Excel\Contracts\SheetSourceHandler|\Maatwebsite\Excel\Contracts\QueuedSheetSourceHandler|class-string $handlers
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function registerSourceHandler(...$handlers)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||||
|
return $instance->registerSourceHandler(...$handlers);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a custom macro.
|
||||||
|
*
|
||||||
|
* @param string $name
|
||||||
|
* @param object|callable $macro
|
||||||
|
* @param-closure-this static $macro
|
||||||
|
* @return void
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function macro($name, $macro)
|
||||||
|
{
|
||||||
|
\Maatwebsite\Excel\Excel::macro($name, $macro);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mix another object into the class.
|
||||||
|
*
|
||||||
|
* @param object $mixin
|
||||||
|
* @param bool $replace
|
||||||
|
* @return void
|
||||||
|
* @throws \ReflectionException
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function mixin($mixin, $replace = true)
|
||||||
|
{
|
||||||
|
\Maatwebsite\Excel\Excel::mixin($mixin, $replace);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if macro is registered.
|
||||||
|
*
|
||||||
|
* @param string $name
|
||||||
|
* @return bool
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function hasMacro($name)
|
||||||
|
{
|
||||||
|
return \Maatwebsite\Excel\Excel::hasMacro($name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flush the existing macros.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function flushMacros()
|
||||||
|
{
|
||||||
|
\Maatwebsite\Excel\Excel::flushMacros();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function extend($concern, $handler, $event = 'Maatwebsite\\Excel\\Events\\BeforeWriting')
|
||||||
|
{
|
||||||
|
return \Maatwebsite\Excel\Excel::extend($concern, $handler, $event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register local event listeners.
|
||||||
|
*
|
||||||
|
* @param array<string, callable> $listeners
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function registerListeners($listeners)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||||
|
return $instance->registerListeners($listeners);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function clearListeners()
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||||
|
return $instance->clearListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a global event listener.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function listen($event, $listener)
|
||||||
|
{
|
||||||
|
return \Maatwebsite\Excel\Excel::listen($event, $listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function raise($event)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||||
|
return $instance->raise($event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return callable[]
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function listeners($event)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Excel $instance */
|
||||||
|
return $instance->listeners($event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When asserting downloaded, stored, queued or imported, use regular expression
|
||||||
|
* to look for a matching file path.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function matchByRegex()
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||||
|
return $instance->matchByRegex();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When asserting downloaded, stored, queued or imported, use regular string
|
||||||
|
* comparison for matching file path.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function doNotMatchByRegex()
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||||
|
return $instance->doNotMatchByRegex();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function assertDownloaded($fileName, $callback = null)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||||
|
return $instance->assertDownloaded($fileName, $callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function assertStored($filePath, $disk = null, $callback = null)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||||
|
return $instance->assertStored($filePath, $disk, $callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function assertQueued($filePath, $disk = null, $callback = null)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||||
|
return $instance->assertQueued($filePath, $disk, $callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array<int, object> $chain
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function assertQueuedWithChain($chain)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||||
|
return $instance->assertQueuedWithChain($chain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function assertExportedInRaw($classname, $callback = null)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||||
|
return $instance->assertExportedInRaw($classname, $callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function assertImported($filePath, $disk = null, $callback = null)
|
||||||
|
{
|
||||||
|
/** @var \Maatwebsite\Excel\Fakes\ExcelFake $instance */
|
||||||
|
return $instance->assertImported($filePath, $disk, $callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
namespace Stevebauman\Location\Facades {
|
namespace Stevebauman\Location\Facades {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
@@ -25678,6 +26049,34 @@ namespace Illuminate\Support {
|
|||||||
return \Illuminate\Support\Collection::debug();
|
return \Illuminate\Support\Collection::debug();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see \Maatwebsite\Excel\Mixins\DownloadCollectionMixin::downloadExcel()
|
||||||
|
* @param string $fileName
|
||||||
|
* @param string|null $writerType
|
||||||
|
* @param mixed $withHeadings
|
||||||
|
* @param array $responseHeaders
|
||||||
|
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function downloadExcel($fileName, $writerType = null, $withHeadings = false, $responseHeaders = [])
|
||||||
|
{
|
||||||
|
return \Illuminate\Support\Collection::downloadExcel($fileName, $writerType, $withHeadings, $responseHeaders);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see \Maatwebsite\Excel\Mixins\StoreCollectionMixin::storeExcel()
|
||||||
|
* @param string $filePath
|
||||||
|
* @param string|null $disk
|
||||||
|
* @param string|null $writerType
|
||||||
|
* @param mixed $withHeadings
|
||||||
|
* @return \Illuminate\Foundation\Bus\PendingDispatch|bool
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function storeExcel($filePath, $disk = null, $writerType = null, $withHeadings = false)
|
||||||
|
{
|
||||||
|
return \Illuminate\Support\Collection::storeExcel($filePath, $disk, $writerType, $withHeadings);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
@@ -25693,6 +26092,29 @@ namespace Illuminate\Support {
|
|||||||
return \Illuminate\Support\Str::sanitizeHtml($html);
|
return \Illuminate\Support\Str::sanitizeHtml($html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see \Filament\Support\SupportServiceProvider::packageBooted()
|
||||||
|
* @param string|null $url
|
||||||
|
* @param array $allowedSchemes
|
||||||
|
* @return string|null
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function sanitizeUrl($url, $allowedSchemes = [])
|
||||||
|
{
|
||||||
|
return \Illuminate\Support\Str::sanitizeUrl($url, $allowedSchemes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see \Filament\Support\SupportServiceProvider::packageBooted()
|
||||||
|
* @param \BackedEnum|string|null $color
|
||||||
|
* @return string|null
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function sanitizeCssColor($color)
|
||||||
|
{
|
||||||
|
return \Illuminate\Support\Str::sanitizeCssColor($color);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
@@ -25707,6 +26129,27 @@ namespace Illuminate\Support {
|
|||||||
return \Illuminate\Support\Stringable::sanitizeHtml();
|
return \Illuminate\Support\Stringable::sanitizeHtml();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see \Filament\Support\SupportServiceProvider::packageBooted()
|
||||||
|
* @param array $allowedSchemes
|
||||||
|
* @return \Illuminate\Support\Stringable
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function sanitizeUrl($allowedSchemes = [])
|
||||||
|
{
|
||||||
|
return \Illuminate\Support\Stringable::sanitizeUrl($allowedSchemes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see \Filament\Support\SupportServiceProvider::packageBooted()
|
||||||
|
* @return \Illuminate\Support\Stringable
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function sanitizeCssColor()
|
||||||
|
{
|
||||||
|
return \Illuminate\Support\Stringable::sanitizeCssColor();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26123,6 +26566,9 @@ namespace Illuminate\Database\Eloquent\Relations {
|
|||||||
namespace Livewire\Features\SupportTesting {
|
namespace Livewire\Features\SupportTesting {
|
||||||
/**
|
/**
|
||||||
* @template TComponent of \Livewire\Component
|
* @template TComponent of \Livewire\Component
|
||||||
|
* @method $this assertSuccessful()
|
||||||
|
* @method $this assertOk()
|
||||||
|
* @method $this assertStatus(int $status)
|
||||||
* @mixin \Illuminate\Testing\TestResponse
|
* @mixin \Illuminate\Testing\TestResponse
|
||||||
*/
|
*/
|
||||||
class Testable {
|
class Testable {
|
||||||
@@ -26140,12 +26586,13 @@ namespace Livewire\Features\SupportTesting {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @see \Filament\Actions\Testing\TestsActions::unmountAction()
|
* @see \Filament\Actions\Testing\TestsActions::unmountAction()
|
||||||
|
* @param string|bool|null $cancelParentActions
|
||||||
* @return static
|
* @return static
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function unmountAction()
|
public static function unmountAction($cancelParentActions = null)
|
||||||
{
|
{
|
||||||
return \Livewire\Features\SupportTesting\Testable::unmountAction();
|
return \Livewire\Features\SupportTesting\Testable::unmountAction($cancelParentActions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28815,7 +29262,7 @@ namespace Illuminate\View {
|
|||||||
/**
|
/**
|
||||||
* @see \Filament\Support\SupportServiceProvider::packageBooted()
|
* @see \Filament\Support\SupportServiceProvider::packageBooted()
|
||||||
* @param array|string|int|null $span
|
* @param array|string|int|null $span
|
||||||
* @param array|int|null $start
|
* @param array|string|int|null $start
|
||||||
* @param array|string|int|null $order
|
* @param array|string|int|null $order
|
||||||
* @param bool $isHidden
|
* @param bool $isHidden
|
||||||
* @return \Illuminate\View\ComponentAttributeBag
|
* @return \Illuminate\View\ComponentAttributeBag
|
||||||
@@ -28843,6 +29290,7 @@ namespace Illuminate\View {
|
|||||||
/**
|
/**
|
||||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||||
* @param mixed $data
|
* @param mixed $data
|
||||||
|
* @return static
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function layoutData($data = [])
|
public static function layoutData($data = [])
|
||||||
@@ -28853,6 +29301,7 @@ namespace Illuminate\View {
|
|||||||
/**
|
/**
|
||||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||||
* @param mixed $section
|
* @param mixed $section
|
||||||
|
* @return static
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function section($section)
|
public static function section($section)
|
||||||
@@ -28863,6 +29312,7 @@ namespace Illuminate\View {
|
|||||||
/**
|
/**
|
||||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||||
* @param mixed $title
|
* @param mixed $title
|
||||||
|
* @return static
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function title($title)
|
public static function title($title)
|
||||||
@@ -28873,6 +29323,7 @@ namespace Illuminate\View {
|
|||||||
/**
|
/**
|
||||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||||
* @param mixed $slot
|
* @param mixed $slot
|
||||||
|
* @return static
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function slot($slot)
|
public static function slot($slot)
|
||||||
@@ -28884,6 +29335,7 @@ namespace Illuminate\View {
|
|||||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||||
* @param mixed $view
|
* @param mixed $view
|
||||||
* @param mixed $params
|
* @param mixed $params
|
||||||
|
* @return static
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function extends($view, $params = [])
|
public static function extends($view, $params = [])
|
||||||
@@ -28895,6 +29347,7 @@ namespace Illuminate\View {
|
|||||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||||
* @param mixed $view
|
* @param mixed $view
|
||||||
* @param mixed $params
|
* @param mixed $params
|
||||||
|
* @return static
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function layout($view, $params = [])
|
public static function layout($view, $params = [])
|
||||||
@@ -28905,6 +29358,7 @@ namespace Illuminate\View {
|
|||||||
/**
|
/**
|
||||||
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
* @see \Livewire\Features\SupportPageComponents\SupportPageComponents::registerLayoutViewMacros()
|
||||||
* @param callable $callback
|
* @param callable $callback
|
||||||
|
* @return static
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function response($callback)
|
public static function response($callback)
|
||||||
@@ -29577,7 +30031,7 @@ namespace {
|
|||||||
* @param string $pageName
|
* @param string $pageName
|
||||||
* @param int|null $page
|
* @param int|null $page
|
||||||
* @param \Closure|int|null $total
|
* @param \Closure|int|null $total
|
||||||
* @return \Illuminate\Pagination\LengthAwarePaginator
|
* @return \Illuminate\Pagination\LengthAwarePaginator<int, TModel>
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
@@ -29594,7 +30048,7 @@ namespace {
|
|||||||
* @param array|string $columns
|
* @param array|string $columns
|
||||||
* @param string $pageName
|
* @param string $pageName
|
||||||
* @param int|null $page
|
* @param int|null $page
|
||||||
* @return \Illuminate\Contracts\Pagination\Paginator
|
* @return \Illuminate\Pagination\Paginator<int, TModel>
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function simplePaginate($perPage = null, $columns = [], $pageName = 'page', $page = null)
|
public static function simplePaginate($perPage = null, $columns = [], $pageName = 'page', $page = null)
|
||||||
@@ -29610,7 +30064,7 @@ namespace {
|
|||||||
* @param array|string $columns
|
* @param array|string $columns
|
||||||
* @param string $cursorName
|
* @param string $cursorName
|
||||||
* @param \Illuminate\Pagination\Cursor|string|null $cursor
|
* @param \Illuminate\Pagination\Cursor|string|null $cursor
|
||||||
* @return \Illuminate\Contracts\Pagination\CursorPaginator
|
* @return \Illuminate\Pagination\CursorPaginator<int, TModel>
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function cursorPaginate($perPage = null, $columns = [], $cursorName = 'cursor', $cursor = null)
|
public static function cursorPaginate($perPage = null, $columns = [], $cursorName = 'cursor', $cursor = null)
|
||||||
@@ -31352,6 +31806,60 @@ namespace {
|
|||||||
return \Illuminate\Database\Eloquent\Builder::getRelationWithoutConstraintsProxy($relation);
|
return \Illuminate\Database\Eloquent\Builder::getRelationWithoutConstraintsProxy($relation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see \Maatwebsite\Excel\Mixins\DownloadQueryMacro::__invoke()
|
||||||
|
* @param string $fileName
|
||||||
|
* @param string|null $writerType
|
||||||
|
* @param mixed $withHeadings
|
||||||
|
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function downloadExcel($fileName, $writerType = null, $withHeadings = false)
|
||||||
|
{
|
||||||
|
return \Illuminate\Database\Eloquent\Builder::downloadExcel($fileName, $writerType, $withHeadings);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see \Maatwebsite\Excel\Mixins\StoreQueryMacro::__invoke()
|
||||||
|
* @param string $filePath
|
||||||
|
* @param string|null $disk
|
||||||
|
* @param string|null $writerType
|
||||||
|
* @param mixed $withHeadings
|
||||||
|
* @return \Illuminate\Foundation\Bus\PendingDispatch|bool
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function storeExcel($filePath, $disk = null, $writerType = null, $withHeadings = false)
|
||||||
|
{
|
||||||
|
return \Illuminate\Database\Eloquent\Builder::storeExcel($filePath, $disk, $writerType, $withHeadings);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see \Maatwebsite\Excel\Mixins\ImportMacro::__invoke()
|
||||||
|
* @param string $filename
|
||||||
|
* @param string|null $disk
|
||||||
|
* @param string|null $readerType
|
||||||
|
* @return \Maatwebsite\Excel\Importer|\Illuminate\Foundation\Bus\PendingDispatch|\Illuminate\Bus\PendingBatch
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function import($filename, $disk = null, $readerType = null)
|
||||||
|
{
|
||||||
|
return \Illuminate\Database\Eloquent\Builder::import($filename, $disk, $readerType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see \Maatwebsite\Excel\Mixins\ImportAsMacro::__invoke()
|
||||||
|
* @param string $filename
|
||||||
|
* @param callable $mapping
|
||||||
|
* @param string|null $disk
|
||||||
|
* @param string|null $readerType
|
||||||
|
* @return \Maatwebsite\Excel\Importer|\Illuminate\Foundation\Bus\PendingDispatch|\Illuminate\Bus\PendingBatch
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function importAs($filename, $mapping, $disk = null, $readerType = null)
|
||||||
|
{
|
||||||
|
return \Illuminate\Database\Eloquent\Builder::importAs($filename, $mapping, $disk, $readerType);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the columns to be selected.
|
* Set the columns to be selected.
|
||||||
*
|
*
|
||||||
@@ -34404,10 +34912,12 @@ namespace {
|
|||||||
class Validator extends \Illuminate\Support\Facades\Validator {}
|
class Validator extends \Illuminate\Support\Facades\Validator {}
|
||||||
class View extends \Illuminate\Support\Facades\View {}
|
class View extends \Illuminate\Support\Facades\View {}
|
||||||
class Vite extends \Illuminate\Support\Facades\Vite {}
|
class Vite extends \Illuminate\Support\Facades\Vite {}
|
||||||
|
class EloquentSerialize extends \AnourValar\EloquentSerialize\Facades\EloquentSerializeFacade {}
|
||||||
class Debugbar extends \Fruitcake\LaravelDebugbar\Facades\Debugbar {}
|
class Debugbar extends \Fruitcake\LaravelDebugbar\Facades\Debugbar {}
|
||||||
class FilamentShield extends \BezhanSalleh\FilamentShield\Facades\FilamentShield {}
|
class FilamentShield extends \BezhanSalleh\FilamentShield\Facades\FilamentShield {}
|
||||||
class Agent extends \Jenssegers\Agent\Facades\Agent {}
|
class Agent extends \Jenssegers\Agent\Facades\Agent {}
|
||||||
class Livewire extends \Livewire\Livewire {}
|
class Livewire extends \Livewire\Livewire {}
|
||||||
|
class Excel extends \Maatwebsite\Excel\Facades\Excel {}
|
||||||
class Location extends \Stevebauman\Location\Facades\Location {}
|
class Location extends \Stevebauman\Location\Facades\Location {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,15 +2,16 @@
|
|||||||
|
|
||||||
namespace App\Actions;
|
namespace App\Actions;
|
||||||
|
|
||||||
use App\Models\SofaScoreCategory;
|
|
||||||
use App\Models\SofaScoreTournament;
|
use App\Models\SofaScoreTournament;
|
||||||
use App\Models\StatisticFixtures;
|
use App\Models\StatisticFixtures;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
class LoadSofaScoreCategory
|
class LoadSofaScoreCategory
|
||||||
{
|
{
|
||||||
public static function load()
|
public static function load()
|
||||||
{
|
{
|
||||||
$league_ids = StatisticFixtures::where('sport_id', 1)
|
$league_ids = StatisticFixtures::where('sport_id', 1)
|
||||||
|
->where('starttime', '>=', Carbon::now())
|
||||||
->groupBy('league_id')
|
->groupBy('league_id')
|
||||||
->pluck('league_id')->toArray();
|
->pluck('league_id')->toArray();
|
||||||
|
|
||||||
@@ -20,6 +21,9 @@ class LoadSofaScoreCategory
|
|||||||
foreach ($res as $value) {
|
foreach ($res as $value) {
|
||||||
$arr[$value->sofa_score_category_id] = $value->sofascore_category->name;
|
$arr[$value->sofa_score_category_id] = $value->sofascore_category->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
asort($arr);
|
||||||
|
|
||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,12 +3,14 @@
|
|||||||
namespace App\Actions;
|
namespace App\Actions;
|
||||||
|
|
||||||
use App\Models\StatisticFixtures;
|
use App\Models\StatisticFixtures;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
class LoadStatisticFixturesLeaguesOptions
|
class LoadStatisticFixturesLeaguesOptions
|
||||||
{
|
{
|
||||||
public static function load(?int $sofascore_category_id = 0)
|
public static function load(?int $sofascore_category_id = 0)
|
||||||
{
|
{
|
||||||
$res = StatisticFixtures::with('league')
|
$res = StatisticFixtures::with('league')
|
||||||
|
->where('starttime', '>=', Carbon::now())
|
||||||
->whereHas('league', function ($query) use ($sofascore_category_id) {
|
->whereHas('league', function ($query) use ($sofascore_category_id) {
|
||||||
$query->where('sofa_score_category_id', $sofascore_category_id);
|
$query->where('sofa_score_category_id', $sofascore_category_id);
|
||||||
})
|
})
|
||||||
@@ -18,6 +20,7 @@ class LoadStatisticFixturesLeaguesOptions
|
|||||||
foreach ($res as $value) {
|
foreach ($res as $value) {
|
||||||
$arr[$value->league_id] = $value->league->name;
|
$arr[$value->league_id] = $value->league->name;
|
||||||
}
|
}
|
||||||
|
asort($arr);
|
||||||
|
|
||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Actions;
|
|||||||
|
|
||||||
use App\Models\SofaScoreRosa;
|
use App\Models\SofaScoreRosa;
|
||||||
use App\Models\StatisticFixtures;
|
use App\Models\StatisticFixtures;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
class LoadStatisticFixturesMatchOptions
|
class LoadStatisticFixturesMatchOptions
|
||||||
{
|
{
|
||||||
@@ -14,12 +15,16 @@ class LoadStatisticFixturesMatchOptions
|
|||||||
}
|
}
|
||||||
$team_map = SofaScoreRosa::pluck('ss_team_name', 'ss_team_id')->toArray();
|
$team_map = SofaScoreRosa::pluck('ss_team_name', 'ss_team_id')->toArray();
|
||||||
|
|
||||||
$res = StatisticFixtures::where('league_id', $league_id)->get();
|
$res = StatisticFixtures::where('league_id', $league_id)
|
||||||
|
->where('starttime', '>=', Carbon::now())
|
||||||
|
->get();
|
||||||
|
|
||||||
$arr = [];
|
$arr = [];
|
||||||
foreach ($res as $val) {
|
foreach ($res as $val) {
|
||||||
|
if (isset($team_map[$val->home_id]) && isset($team_map[$val->away_id])) {
|
||||||
$arr[$val->id] = $val->starttime->format('Y-m-d H:i').' - '.$team_map[$val->home_id].' vs '.$team_map[$val->away_id];
|
$arr[$val->id] = $val->starttime->format('Y-m-d H:i').' - '.$team_map[$val->home_id].' vs '.$team_map[$val->away_id];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ class Grapper extends Command
|
|||||||
{
|
{
|
||||||
use GrappingSofascore;
|
use GrappingSofascore;
|
||||||
|
|
||||||
protected $signature = 'grp:sofa {--d} {--r} {--f}';
|
protected $signature = 'grp:ss {--d} {--r} {--f}';
|
||||||
|
|
||||||
protected $description = 'grap sofascore selecting';
|
protected $description = 'grap select function';
|
||||||
|
|
||||||
public function handleGrapper(): void
|
public function handleGrapper(): void
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ use Illuminate\Support\Facades\DB;
|
|||||||
|
|
||||||
class MaglooStore1x2
|
class MaglooStore1x2
|
||||||
{
|
{
|
||||||
public static function store($value, $base)
|
public static function store(array $value, array $base)
|
||||||
{
|
{
|
||||||
$odds = [];
|
$odds = [];
|
||||||
$odds['h3w'] = number_format($value['static'][1], 2) ?? 1;
|
$odds['h3w'] = number_format($value['static'][1] ?? 1, 2) ?? 1;
|
||||||
$odds['d3w'] = number_format($value['static'][2], 2) ?? 1;
|
$odds['d3w'] = number_format($value['static'][2] ?? 1, 2) ?? 1;
|
||||||
$odds['a3w'] = number_format($value['static'][3], 2) ?? 1;
|
$odds['a3w'] = number_format($value['static'][3] ?? 1, 2) ?? 1;
|
||||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||||
$odds['flags'] = 1;
|
$odds['flags'] = 1;
|
||||||
$odds = array_merge($odds, $base);
|
$odds = array_merge($odds, $base);
|
||||||
|
|||||||
@@ -1,177 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\CurlSofa;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\Sleeper;
|
|
||||||
use App\Models\Country;
|
|
||||||
use App\Models\SofaScoreCategory;
|
|
||||||
use App\Models\SofaScoreDayTournament;
|
|
||||||
use App\Models\SofaScoreTournament;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
class DaysTournament
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* a Grap --d --f 67 --fun=4 --task=1
|
|
||||||
*
|
|
||||||
* Ita Serie-A-Saison 23-08-2025 - 24-05-2026
|
|
||||||
* Ger Bundesliga 22-08-2025 – 16-05-2026
|
|
||||||
* Eng Premier league 15-08-2025 - 24-05-2026
|
|
||||||
* Spa La Liga 15-08-2025 - 24-05-2026
|
|
||||||
* Fra Liggue 15-08-2025 - 17-05-2026
|
|
||||||
*/
|
|
||||||
public static function get(string $day)
|
|
||||||
{
|
|
||||||
$debug = Grap::$options['d'] ?? 0;
|
|
||||||
$force = Grap::$options['F'] ?? 0;
|
|
||||||
|
|
||||||
$tournaments_counter = 0;
|
|
||||||
|
|
||||||
$has = SofaScoreDayTournament::where('day', $day)->first();
|
|
||||||
|
|
||||||
$sport = [];
|
|
||||||
$sport[1] = 'football';
|
|
||||||
|
|
||||||
foreach ($sport as $sport_id => $slug) {
|
|
||||||
if (!$force && $has) {
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note("Tournaments $day for " . strtoupper($slug) . ' allready grapped', 'bb');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note("$day\ngrappig", 'g');
|
|
||||||
}
|
|
||||||
|
|
||||||
$page = 1;
|
|
||||||
|
|
||||||
while ($page) {
|
|
||||||
|
|
||||||
$url = Grap::$options['base_url'] . "api/v1/sport/$slug/scheduled-tournaments/$day/page/$page";
|
|
||||||
|
|
||||||
Sleeper::rand();
|
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
|
||||||
|
|
||||||
if ($data['hasNextPage']) {
|
|
||||||
$page++;
|
|
||||||
} else {
|
|
||||||
$page = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($data['scheduled'] as $row) {
|
|
||||||
|
|
||||||
if (isset($row['tournament']['uniqueTournament'])) {
|
|
||||||
$tournament = $row['tournament']['uniqueTournament'];
|
|
||||||
} else {
|
|
||||||
$tournament = $row['tournament'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$category = $tournament['category'];
|
|
||||||
|
|
||||||
if ($sport_id == 5) {
|
|
||||||
$country_id = 470;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CATEGORY
|
|
||||||
*/
|
|
||||||
$find = [
|
|
||||||
'Amateur',
|
|
||||||
'Bosnia & Herzegovina',
|
|
||||||
'Czechia',
|
|
||||||
'DR Congo',
|
|
||||||
'Netherlands',
|
|
||||||
'North & Central America',
|
|
||||||
'Bonaire',
|
|
||||||
'Sao Tome and Principe',
|
|
||||||
'Cape Verde',
|
|
||||||
'Macao',
|
|
||||||
'Saint Kitts and Nevis',
|
|
||||||
'Eswatini',
|
|
||||||
'Timor Leste',
|
|
||||||
'Laos',
|
|
||||||
'Congo Republic',
|
|
||||||
|
|
||||||
];
|
|
||||||
$replace = [
|
|
||||||
'',
|
|
||||||
'Bosnia Herzegovina',
|
|
||||||
'Czech Republic',
|
|
||||||
'Congo DR',
|
|
||||||
'Holland',
|
|
||||||
'North America',
|
|
||||||
'Bonaire, Sint Eustatius and Saba',
|
|
||||||
'Sao Tome e Principe',
|
|
||||||
'Cape Verde Islands',
|
|
||||||
'Macau',
|
|
||||||
'St. Kitts and Nevis',
|
|
||||||
'Swaziland',
|
|
||||||
'East Timor',
|
|
||||||
'Lao Peoples\'s Democratic Republic',
|
|
||||||
'Congo DR',
|
|
||||||
];
|
|
||||||
$country_id = Country::where('name', trim(str_replace($find, $replace, $category['name'])))->value('id');
|
|
||||||
}
|
|
||||||
|
|
||||||
// dd($category, $country_id);
|
|
||||||
|
|
||||||
if (! $country_id) {
|
|
||||||
// platzhalter fix later sofa_score_categories => txodds countries
|
|
||||||
// CATEGORY find <-> replace
|
|
||||||
// Log::channel('sofascore')->info($tournament);
|
|
||||||
|
|
||||||
$sofa_score_category_id = 10000000;
|
|
||||||
} else {
|
|
||||||
$call = SofaScoreCategory::updateOrCreate([
|
|
||||||
'id' => (int) $category['id'],
|
|
||||||
'country_id' => (int) $country_id,
|
|
||||||
'slug' => $category['slug'],
|
|
||||||
], [
|
|
||||||
'name' => $category['name'],
|
|
||||||
]);
|
|
||||||
|
|
||||||
$sofa_score_category_id = $call->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TOURNAMENT
|
|
||||||
*/
|
|
||||||
SofaScoreTournament::updateOrCreate([
|
|
||||||
'sport_id' => (int) $sport_id,
|
|
||||||
'tournament_id' => (int) $tournament['id'],
|
|
||||||
'sofa_score_category_id' => (int) $sofa_score_category_id,
|
|
||||||
], [
|
|
||||||
'name' => $tournament['name'],
|
|
||||||
'slug' => $tournament['slug'],
|
|
||||||
]);
|
|
||||||
$tournaments_counter++;
|
|
||||||
|
|
||||||
// if ($debug) {
|
|
||||||
// Notice::note('tournament: ' . $tournament['name'], 'p');
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DAY TOURNAMENT
|
|
||||||
*/
|
|
||||||
SofaScoreDayTournament::updateOrCreate([
|
|
||||||
'tournament_id' => (int) $tournament['id'],
|
|
||||||
'sport_id' => (int) $sport_id,
|
|
||||||
'day' => $day,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note("tournaments: $tournaments_counter", 'p');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('days tournament done', 'g');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,239 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\CurlSofa;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\LoadDays;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\Sleeper;
|
|
||||||
use App\Models\SofaScoreDayTournament;
|
|
||||||
use App\Models\SofaScoreEventGrapped;
|
|
||||||
use App\Models\SofaScoreTaskDay;
|
|
||||||
use App\Models\SofaScoreTaskTournament;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
use Illuminate\Support\Facades\File;
|
|
||||||
|
|
||||||
class Grapper
|
|
||||||
{
|
|
||||||
public static function load(int $task_id)
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* , JSON_PRETTY_PRINT
|
|
||||||
* to fromat json
|
|
||||||
*/
|
|
||||||
$debug = Grap::$options['d'] ?? 0;
|
|
||||||
$restart = Grap::$options['r'] ?? 0;
|
|
||||||
$force = Grap::$options['f'] ?? 0;
|
|
||||||
|
|
||||||
if (! $task_id) {
|
|
||||||
Notice::note('task id missing', 'r', 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$days = LoadDays::load($task_id);
|
|
||||||
|
|
||||||
$count = 0;
|
|
||||||
|
|
||||||
/** take for task 2 the same like for task 1 */
|
|
||||||
switch ($task_id) {
|
|
||||||
case 1:
|
|
||||||
case 2:
|
|
||||||
$active_tournaments = SofaScoreTaskTournament::with('tournament')->where('sofa_score_task_id', 1)->where('disabled', false)->get();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
$active_tournaments = SofaScoreTaskTournament::with('tournament')->where('sofa_score_task_id', $task_id)->where('disabled', false)->get();
|
|
||||||
// $active_tournaments = SofaScoreTaskTournament::with('tournament')->where('sofa_score_tournament_id', 247)->where('sofa_score_task_id', $task_id)->where('disabled', false)->get();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Restart
|
|
||||||
*/
|
|
||||||
if ($restart) {
|
|
||||||
|
|
||||||
SofaScoreEventGrapped::where('grapper_id', $task_id)->delete();
|
|
||||||
|
|
||||||
foreach ($days as $day) {
|
|
||||||
// if restarting find position
|
|
||||||
SofaScoreTaskDay::where('grapper_id', (int) $task_id)
|
|
||||||
->where('day', $day)
|
|
||||||
->update(['done' => 0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('Restarted grapper', 'br', 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($days as $day) {
|
|
||||||
|
|
||||||
DaysTournament::get($day);
|
|
||||||
|
|
||||||
dd($active_tournaments);
|
|
||||||
|
|
||||||
foreach ($active_tournaments as $tournament) {
|
|
||||||
|
|
||||||
$res = SofaScoreDayTournament::whereDate('day', '=', $day)->where('tournament_id', $tournament->sofa_score_tournament_id)->first();
|
|
||||||
|
|
||||||
if ($res) {
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note($tournament->sofa_score_tournament_id, 'bb');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $force) {
|
|
||||||
Sleeper::rand(1);
|
|
||||||
} else {
|
|
||||||
Sleeper::rand();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note($day, 'br');
|
|
||||||
}
|
|
||||||
|
|
||||||
$url = Grap::$options['base_url']."api/v1/unique-tournament/$tournament->sofa_score_tournament_id/scheduled-events/$day";
|
|
||||||
$data = CurlSofa::load($url);
|
|
||||||
|
|
||||||
Notice::note($data, 'bb');
|
|
||||||
|
|
||||||
if (isset($data['events'])) {
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note($tournament->tournament->name, 'bb');
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($data['events'] as $event) {
|
|
||||||
|
|
||||||
Grap::$useragent = rand(1, 6);
|
|
||||||
|
|
||||||
if (! $force && SofaScoreEventGrapped::where('grapper_id', $task_id)->where('id', (int) $event['id'])->exists()) {
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('DB - Allready grapped at '.$day.' - '.$event['homeTeam']['name'].' vs '.$event['awayTeam']['name'], 'g');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$now = Carbon::now()->subHours(3);
|
|
||||||
|
|
||||||
$carbon_day = new Carbon($day);
|
|
||||||
|
|
||||||
$starttime = Carbon::createFromTimestamp($event['startTimestamp']);
|
|
||||||
|
|
||||||
// dd($starttime);
|
|
||||||
|
|
||||||
// if ($now->greaterThan($starttime) && $starttime->isSameDay($carbon_day)) {
|
|
||||||
|
|
||||||
if (! $force) {
|
|
||||||
Sleeper::rand(1);
|
|
||||||
} else {
|
|
||||||
Sleeper::rand();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note($day.' - '.$event['homeTeam']['name'].' vs '.$event['awayTeam']['name'], 'bg');
|
|
||||||
}
|
|
||||||
|
|
||||||
$folder = strtolower(Grap::$storage.'/'.$day.'/'.$day.'-'.$event['tournament']['category']['slug'].'-'.$event['tournament']['slug'].'/'.$event['slug']);
|
|
||||||
|
|
||||||
File::makeDirectory($folder, 0775, true, true);
|
|
||||||
|
|
||||||
/*********************************
|
|
||||||
* EVENT event
|
|
||||||
*********************************/
|
|
||||||
|
|
||||||
File::put($folder.'/event.json', json_encode($event));
|
|
||||||
|
|
||||||
/*********************************
|
|
||||||
* EVENT statistics
|
|
||||||
*********************************/
|
|
||||||
|
|
||||||
$event_id = $event['id'];
|
|
||||||
|
|
||||||
$url = Grap::$options['base_url']."api/v1/event/$event_id/statistics";
|
|
||||||
|
|
||||||
Sleeper::rand();
|
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
|
||||||
|
|
||||||
$data['id'] = $event_id;
|
|
||||||
|
|
||||||
File::put($folder.'/statistics.json', json_encode($data));
|
|
||||||
|
|
||||||
/*********************************
|
|
||||||
* EVENT lineups
|
|
||||||
*********************************/
|
|
||||||
|
|
||||||
$url = Grap::$options['base_url']."api/v1/event/$event_id/lineups";
|
|
||||||
|
|
||||||
Sleeper::rand();
|
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
|
||||||
|
|
||||||
$data['id'] = $event_id;
|
|
||||||
|
|
||||||
File::put($folder.'/lineups.json', json_encode($data));
|
|
||||||
|
|
||||||
/*********************************
|
|
||||||
* EVENT odds
|
|
||||||
*********************************/
|
|
||||||
|
|
||||||
$url = Grap::$options['base_url']."api/v1/event/$event_id/odds/1/all";
|
|
||||||
|
|
||||||
Sleeper::rand();
|
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
|
||||||
|
|
||||||
$data['id'] = $event_id;
|
|
||||||
|
|
||||||
File::put($folder.'/odds.json', json_encode($data));
|
|
||||||
|
|
||||||
/*********************************
|
|
||||||
* EVENT incidents
|
|
||||||
*********************************/
|
|
||||||
|
|
||||||
$url = Grap::$options['base_url']."api/v1/event/$event_id/incidents";
|
|
||||||
|
|
||||||
Sleeper::rand();
|
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
|
||||||
|
|
||||||
$data['id'] = $event_id;
|
|
||||||
|
|
||||||
File::put($folder.'/incidents.json', json_encode($data));
|
|
||||||
|
|
||||||
$grapped = SofaScoreEventGrapped::firstOrNew(['id' => $event['id']]);
|
|
||||||
$grapped->grapper_id = $task_id;
|
|
||||||
$grapped->day = $day;
|
|
||||||
$grapped->liga = $event['tournament']['name'];
|
|
||||||
$grapped->name = $event['homeTeam']['name'].' vs '.$event['awayTeam']['name'];
|
|
||||||
$grapped->url = $url;
|
|
||||||
$grapped->starttime = $starttime->toDateTimeString();
|
|
||||||
$grapped->save();
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SofaScoreTaskDay::updateOrCreate([
|
|
||||||
'grapper_id' => (int) $task_id,
|
|
||||||
'day' => $day,
|
|
||||||
], [
|
|
||||||
'done' => 1,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$count++;
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note("$count days done, sleep 10-20 sec", 'p');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $force) {
|
|
||||||
Sleeper::rand(2);
|
|
||||||
} else {
|
|
||||||
Sleeper::rand();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\CurlLivescore;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\CurlSofa;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
use DOMDocument;
|
|
||||||
use DOMXPath;
|
|
||||||
|
|
||||||
class GrapperTest
|
|
||||||
{
|
|
||||||
public static $testfiles = '/Testfiles/';
|
|
||||||
|
|
||||||
public static function load()
|
|
||||||
{
|
|
||||||
$read = Grap::$options['R'] ?? 0;
|
|
||||||
$save = Grap::$options['S'] ?? 0;
|
|
||||||
|
|
||||||
$testfile = 'livescore.txt';
|
|
||||||
|
|
||||||
$path = __DIR__ . self::$testfiles . $testfile;
|
|
||||||
|
|
||||||
Notice::note('Grapper testing ' . $testfile, 'b');
|
|
||||||
|
|
||||||
// $url = 'https://www.livescore.in/horse-racing/canada/woodbine-2020/';
|
|
||||||
$url = 'https://www.sofascore.com/api/v1/event/16298660/statistics';
|
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
|
||||||
|
|
||||||
Notice::note($data, '', 1);
|
|
||||||
|
|
||||||
if ($read) {
|
|
||||||
Notice::note('data read localy', 'p');
|
|
||||||
|
|
||||||
$data = file_get_contents($path);
|
|
||||||
} else {
|
|
||||||
$data = CurlLivescore::load($url);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($save) {
|
|
||||||
|
|
||||||
file_put_contents($path, $data);
|
|
||||||
|
|
||||||
Notice::note('file saved localy', 'g');
|
|
||||||
}
|
|
||||||
|
|
||||||
$dom = new DOMDocument;
|
|
||||||
|
|
||||||
// Prevent warnings caused by HTML5 tags that native DOMDocument doesn't fully understand
|
|
||||||
libxml_use_internal_errors(true);
|
|
||||||
|
|
||||||
// Use mb_convert_encoding to ensure DOMDocument treats the input as UTF-8
|
|
||||||
$dom->loadHTML(mb_convert_encoding($data, 'HTML-ENTITIES', 'UTF-8'));
|
|
||||||
libxml_clear_errors();
|
|
||||||
|
|
||||||
// 3. Use XPath to query specific HTML elements
|
|
||||||
$xpath = new DOMXPath($dom);
|
|
||||||
|
|
||||||
// Example: Target match rows or team names (Update classes based on actual DOM structure)
|
|
||||||
// Modern livescore sites often use classes like '.event__match' or '.event__participant'
|
|
||||||
$teams = $xpath->query("//div[contains(@class, 'event__participant')]");
|
|
||||||
|
|
||||||
foreach ($teams as $team) {
|
|
||||||
echo trim($team->nodeValue) . PHP_EOL;
|
|
||||||
}
|
|
||||||
|
|
||||||
Notice::note($data, 'p', 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
use Illuminate\Filesystem\Filesystem;
|
|
||||||
|
|
||||||
class ClearDir
|
|
||||||
{
|
|
||||||
public static function clear($dir = ''): void
|
|
||||||
{
|
|
||||||
$file = new Filesystem;
|
|
||||||
$debug = Grap::$options['d'];
|
|
||||||
|
|
||||||
if ($dir) {
|
|
||||||
$file->cleanDirectory($dir);
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('Folder removed', 'br');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$file->cleanDirectory(Grap::$storage);
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('Folder content deleted', 'br');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
|
|
||||||
class CurlSofa
|
|
||||||
{
|
|
||||||
public static function load(string $url)
|
|
||||||
{
|
|
||||||
$debug = Grap::$options['d'] ?? 0;
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note($url, 'b');
|
|
||||||
}
|
|
||||||
// $useragents = [];
|
|
||||||
// $useragents[1] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36";
|
|
||||||
// $useragents[2] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36";
|
|
||||||
// $useragents[3] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15";
|
|
||||||
// $useragents[4] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0";
|
|
||||||
// $useragents[5] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0";
|
|
||||||
// $useragents[6] = "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Mobile Safari/537.36";
|
|
||||||
$useragents = [];
|
|
||||||
$useragents[1] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15';
|
|
||||||
$useragents[2] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3.1 Safari/605.1.15';
|
|
||||||
$useragents[3] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36';
|
|
||||||
$useragents[4] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.1 Safari/605.1.15';
|
|
||||||
$useragents[5] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0';
|
|
||||||
$useragents[6] = 'Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36';
|
|
||||||
|
|
||||||
// GET /api/v1/config/default-unique-tournaments/AT/football HTTP/2
|
|
||||||
// Host: www.sofascore.com
|
|
||||||
// User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:139.0) Gecko/20100101 Firefox/139.0
|
|
||||||
// Accept: */*
|
|
||||||
// Accept-Language: de,en-US;q=0.7,en;q=0.3
|
|
||||||
// Accept-Encoding: gzip, deflate, br, zstd
|
|
||||||
// Referer: https://www.sofascore.com/
|
|
||||||
// X-Requested-With: 629800
|
|
||||||
// DNT: 1
|
|
||||||
// Sec-GPC: 1
|
|
||||||
// Connection: keep-alive
|
|
||||||
// Sec-Fetch-Dest: empty
|
|
||||||
// Sec-Fetch-Mode: cors
|
|
||||||
// Sec-Fetch-Site: same-origin
|
|
||||||
// Priority: u=4
|
|
||||||
// Pragma: no-cache
|
|
||||||
// Cache-Control: no-cache
|
|
||||||
// TE: trailers
|
|
||||||
$headers = [
|
|
||||||
'User-Agent: '.$useragents[Grap::$useragent],
|
|
||||||
'Accept: */*',
|
|
||||||
'Accept-Language: de,en-US;q=0.7,en;q=0.3',
|
|
||||||
'Accept-Encoding: gzip, deflate, br, zstd',
|
|
||||||
'Referer: https://www.sofascore.com/',
|
|
||||||
'X-Requested-With: 629800',
|
|
||||||
'DNT: 1',
|
|
||||||
'Sec-GPC: 1',
|
|
||||||
'Connection: keep-alive',
|
|
||||||
'Sec-Fetch-Dest: empty',
|
|
||||||
'Sec-Fetch-Mode: cors',
|
|
||||||
'Sec-Fetch-Site: same-origin',
|
|
||||||
'Priority: u=4',
|
|
||||||
'Pragma: no-cache',
|
|
||||||
'Cache-Control: no-cache',
|
|
||||||
'TE: trailers',
|
|
||||||
];
|
|
||||||
|
|
||||||
$ch = curl_init();
|
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
|
||||||
// This line magically handles all decompression out-of-the-box:
|
|
||||||
curl_setopt($ch, CURLOPT_ENCODING, '');
|
|
||||||
$data = curl_exec($ch);
|
|
||||||
|
|
||||||
$data = json_decode($data, true);
|
|
||||||
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
|
||||||
|
|
||||||
class FileType
|
|
||||||
{
|
|
||||||
public static function filter(array $files, array $types = ['json'])
|
|
||||||
{
|
|
||||||
$filtered = [];
|
|
||||||
foreach ($files as $file) {
|
|
||||||
$path_parts = pathinfo($file);
|
|
||||||
if (isset($path_parts['extension']) && in_array($path_parts['extension'], $types)) {
|
|
||||||
$filtered[] = $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $filtered;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use App\Models\SofaScoreTask;
|
|
||||||
use App\Models\SofaScoreTaskDay;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
|
|
||||||
class LoadDays
|
|
||||||
{
|
|
||||||
public static function load(int $task_id)
|
|
||||||
{
|
|
||||||
$debug = Grap::$options['d'] ?? 0;
|
|
||||||
$restart = Grap::$options['r'] ?? 0;
|
|
||||||
|
|
||||||
$dates = [];
|
|
||||||
|
|
||||||
if (! $task_id) {
|
|
||||||
Notice::note('no task id', 'br');
|
|
||||||
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$task = SofaScoreTask::with('sport')->where('id', $task_id)->first();
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('Task id:' . $task->id . ', mode:' . $task->mode . ', sport:' . $task->sport->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($task->mode) {
|
|
||||||
|
|
||||||
case 'daily':
|
|
||||||
$dates[] = ValidateDate::get(Grap::$folder);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'last3days':
|
|
||||||
case 'range':
|
|
||||||
switch ($task_id) {
|
|
||||||
case 2:
|
|
||||||
$from = Carbon::now()->subDays(3);
|
|
||||||
$to = Carbon::now()->subDays(1);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
$from = ValidateDate::get($task->day_from);
|
|
||||||
$from = Carbon::createFromDate($from);
|
|
||||||
$to = ValidateDate::get($task->day_to);
|
|
||||||
$to = Carbon::createFromDate($to);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$lengthdates = $from->diffInDays($to);
|
|
||||||
|
|
||||||
if ($lengthdates < 1) {
|
|
||||||
Notice::note('start must be before end', 'r', 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($restart) {
|
|
||||||
// get all days
|
|
||||||
while ($from <= $to) {
|
|
||||||
$dates[] = $from->format('Y-m-d');
|
|
||||||
$from->addDay();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// remove days done
|
|
||||||
while ($from <= $to) {
|
|
||||||
|
|
||||||
$res = SofaScoreTaskDay::firstOrNew(['grapper_id' => (int) $task_id, 'day' => $from->format('Y-m-d')]);
|
|
||||||
|
|
||||||
if (! $res->done) {
|
|
||||||
$dates[] = $from->format('Y-m-d');
|
|
||||||
}
|
|
||||||
$from->addDay();
|
|
||||||
}
|
|
||||||
|
|
||||||
shuffle($dates);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $dates) {
|
|
||||||
Notice::note('NO DATES OR ALL GRAPPED', 'br', 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note($dates, 'b');
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove when element in array is double (day and slug)
|
|
||||||
$dates = array_unique($dates, SORT_REGULAR);
|
|
||||||
|
|
||||||
return $dates;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
|
||||||
|
|
||||||
use App\Console\Commands\Nuh;
|
|
||||||
use App\Models\SofaScoreTournament;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
|
|
||||||
class LoadTournaments
|
|
||||||
{
|
|
||||||
public static function load()
|
|
||||||
{
|
|
||||||
$sport_id = Nuh::$options['sport_id'];
|
|
||||||
$debug = Nuh::$options['d'] ?? 0;
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('LoadTournaments, sport: ' . $sport_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
$tornaments = SofaScoreTournament::select('name', 'tournament_id')->where('sport_id', $sport_id)->where('enabled', 1)->get();
|
|
||||||
|
|
||||||
if (! $tornaments) {
|
|
||||||
Notice::note('no tornaments active for task', 'r', 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $tornaments;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
|
|
||||||
class MoveToArchive
|
|
||||||
{
|
|
||||||
public static function move(int $task_id)
|
|
||||||
{
|
|
||||||
$files = ReadDir::get_tree(Grap::$storage);
|
|
||||||
|
|
||||||
$filtered_files = FileType::filter($files, ['xlsx', 'json']);
|
|
||||||
|
|
||||||
|
|
||||||
foreach ($filtered_files as $file) {
|
|
||||||
|
|
||||||
switch ($task_id) {
|
|
||||||
case 1:
|
|
||||||
$nfile = \str_replace('/daily/', '/daily_archiv/', $file);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
rename($file, $nfile);
|
|
||||||
|
|
||||||
dd($file, $nfile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
|
||||||
|
|
||||||
class ReadDir
|
|
||||||
{
|
|
||||||
public static function get_tree(string $dir, &$results = array())
|
|
||||||
{
|
|
||||||
$files = scandir($dir);
|
|
||||||
foreach ($files as $value) {
|
|
||||||
$path = realpath($dir . DIRECTORY_SEPARATOR . $value);
|
|
||||||
if (!is_dir($path)) {
|
|
||||||
$results[] = $path;
|
|
||||||
} else if ($value != "." && $value != "..") {
|
|
||||||
self::get_tree($path, $results);
|
|
||||||
$results[] = $path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $results;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
|
|
||||||
class RemoveDir
|
|
||||||
{
|
|
||||||
public static function remove(): void
|
|
||||||
{
|
|
||||||
$debug = Grap::$options['d'];
|
|
||||||
|
|
||||||
// Deletes the directory and everything inside it relative to the disk root
|
|
||||||
|
|
||||||
Storage::deleteDirectory(Grap::$storage . '/' . Grap::$folder);
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('Directory: ' . Grap::$storage . '/' . Grap::$folder . ' removed', 'p');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use App\Models\SofaScoreTask;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
|
|
||||||
class SetStorage
|
|
||||||
{
|
|
||||||
public static function set(int $task_id)
|
|
||||||
{
|
|
||||||
$debug = Grap::$options['d'];
|
|
||||||
|
|
||||||
$force = Grap::$options['f'];
|
|
||||||
|
|
||||||
$folder = Grap::$options['folder'] ?? '';
|
|
||||||
|
|
||||||
$date = Grap::$options['date'] ?? '';
|
|
||||||
|
|
||||||
$day = Grap::$options['day'] ?? 1;
|
|
||||||
|
|
||||||
// must be connectet to task for activated ligas
|
|
||||||
$task = SofaScoreTask::where('id', $task_id)->first();
|
|
||||||
|
|
||||||
$sofascore_data = storage_path('sofascore_data') . '/';
|
|
||||||
if ($task) {
|
|
||||||
$storage_name = Strings::clean($task->name);
|
|
||||||
|
|
||||||
switch ($task->id) {
|
|
||||||
case 1:
|
|
||||||
Grap::$storage = $sofascore_data . $storage_name;
|
|
||||||
Grap::$folder = Carbon::now()->subDays($day)->format('Y-m-d');
|
|
||||||
Grap::$excel = Grap::$storage . '/' . Grap::$folder;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
Grap::$storage = $sofascore_data . $storage_name;
|
|
||||||
Grap::$folder = $date;
|
|
||||||
Grap::$excel = $sofascore_data . $storage_name . '/' . $date;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
Grap::$storage = $sofascore_data . 'range/' . $storage_name;
|
|
||||||
Grap::$folder = $storage_name;
|
|
||||||
Grap::$excel = $sofascore_data . 'range/' . $storage_name;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
Grap::$storage = $sofascore_data . $storage_name;
|
|
||||||
Grap::$folder = 'rosa-' . Carbon::now()->format('Y-m-d');
|
|
||||||
Grap::$excel = Grap::$storage . '/rosa-' . Carbon::now()->format('Y-m-d');
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
Grap::$storage = $sofascore_data . 'excel';
|
|
||||||
Grap::$folder = $folder;
|
|
||||||
Grap::$excel = $sofascore_data . 'excel/' . $storage_name;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} elseif ($folder) {
|
|
||||||
Grap::$storage = $sofascore_data;
|
|
||||||
Grap::$folder = $folder;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note(Grap::$storage, 'g');
|
|
||||||
Notice::note(Grap::$folder, 'g');
|
|
||||||
if (!$force) {
|
|
||||||
sleep(4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
|
||||||
|
|
||||||
class Sleeper
|
|
||||||
{
|
|
||||||
public static function rand($speed = false)
|
|
||||||
{
|
|
||||||
switch ($speed) {
|
|
||||||
case 1:
|
|
||||||
// 5 -10 sec
|
|
||||||
$sleep = rand(5000000, 10000000);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
// 10 - 20 sec
|
|
||||||
$sleep = rand(10000000, 20000000);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
// 1 -1.5 sec
|
|
||||||
$sleep = rand(100000, 150000);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
usleep($sleep);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
|
||||||
|
|
||||||
class Strings
|
|
||||||
{
|
|
||||||
|
|
||||||
public static function clean(string $string)
|
|
||||||
{
|
|
||||||
$string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens.
|
|
||||||
$string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
|
|
||||||
$string = strtolower($string);
|
|
||||||
|
|
||||||
return preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
|
||||||
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
|
|
||||||
class ValidateDate
|
|
||||||
{
|
|
||||||
public static function get(string $date)
|
|
||||||
{
|
|
||||||
if (Carbon::createFromDate($date) !== false) {
|
|
||||||
return $date;
|
|
||||||
} else {
|
|
||||||
Notice::note('Wrong date format', 'r', 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use RecursiveDirectoryIterator;
|
|
||||||
use RecursiveIteratorIterator;
|
|
||||||
use ZipArchive;
|
|
||||||
|
|
||||||
class ZipFolder
|
|
||||||
{
|
|
||||||
public static function create()
|
|
||||||
{
|
|
||||||
|
|
||||||
$zip = new ZipArchive;
|
|
||||||
|
|
||||||
if ($zip->open(Grap::$zipfile, ZipArchive::CREATE | ZipArchive::OVERWRITE) === true) {
|
|
||||||
|
|
||||||
if (is_dir(Grap::$storage)) {
|
|
||||||
|
|
||||||
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(Grap::$storage));
|
|
||||||
|
|
||||||
foreach ($files as $file) {
|
|
||||||
if (! $file->isDir()) {
|
|
||||||
$filePath = $file->getRealPath();
|
|
||||||
$relativePath = substr($filePath, strlen(Grap::$storage) + 1);
|
|
||||||
$zip->addFile($filePath, $relativePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$zip->close();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return response()->json(['error' => 'Failed to create ZIP archive'], 500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\FileType;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\ReadDir;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
||||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
||||||
|
|
||||||
class MakeExcel
|
|
||||||
{
|
|
||||||
public static $max = 2000;
|
|
||||||
|
|
||||||
public static function create(string $what = '')
|
|
||||||
{
|
|
||||||
ini_set('memory_limit', -1);
|
|
||||||
|
|
||||||
$debug = Grap::$options['d'] ?? 0;
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note("Make Excel");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($what == 'day') {
|
|
||||||
$files = ReadDir::get_tree(Grap::$storage . '/' . Grap::$folder);
|
|
||||||
} else {
|
|
||||||
$files = ReadDir::get_tree(Grap::$storage);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$files = array_chunk(FileType::filter($files), self::$max);
|
|
||||||
|
|
||||||
foreach ($files as $key => $value) {
|
|
||||||
|
|
||||||
$has = count($value);
|
|
||||||
if (! $key && $has < self::$max) {
|
|
||||||
$from = 1;
|
|
||||||
$to = $has;
|
|
||||||
} elseif (! $key) {
|
|
||||||
$from = 1;
|
|
||||||
$key++;
|
|
||||||
$to = $key * self::$max;
|
|
||||||
} elseif ($has == self::$max) {
|
|
||||||
$from = $key * self::$max + 1;
|
|
||||||
$key++;
|
|
||||||
$to = $key * self::$max;
|
|
||||||
} else {
|
|
||||||
$from = $key * self::$max + 1;
|
|
||||||
$to = $key * self::$max + $has;
|
|
||||||
}
|
|
||||||
|
|
||||||
$spreadsheet = new Spreadsheet;
|
|
||||||
$spreadsheet->getProperties()->setTitle(Grap::$excel . '_' . $from . '-' . $to);
|
|
||||||
$activeWorksheet = $spreadsheet->getActiveSheet();
|
|
||||||
|
|
||||||
$column = 1;
|
|
||||||
foreach ($value as $file) {
|
|
||||||
$data = file_get_contents($file);
|
|
||||||
$data = json_decode($data, true);
|
|
||||||
$json_string = json_encode($data, JSON_PRETTY_PRINT);
|
|
||||||
|
|
||||||
$arr = explode(PHP_EOL, $json_string);
|
|
||||||
$row = 0;
|
|
||||||
foreach ($arr as $string) {
|
|
||||||
$row++;
|
|
||||||
$replacedString = preg_replace("/\\\\u([0-9abcdef]{4})/", "&#x$1;", $string);
|
|
||||||
$utf8string = mb_convert_encoding($replacedString, 'UTF-8', 'HTML-ENTITIES');
|
|
||||||
$activeWorksheet->setCellValue([$column, $row], $utf8string);
|
|
||||||
}
|
|
||||||
$column++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$spreadsheet->setActiveSheetIndex(0);
|
|
||||||
$writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
|
|
||||||
$writer->save(Grap::$excel . '_' . $from . '-' . $to . '.xlsx');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grapper\Sofascore;
|
|
||||||
|
|
||||||
class Player
|
|
||||||
{
|
|
||||||
public static function call()
|
|
||||||
{
|
|
||||||
// https://www.sofascore.com/api/v1/player/824509
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\CurlSofa;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\Sleeper;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\Strings;
|
|
||||||
use App\Models\SofaScoreRosa;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
use Illuminate\Support\Facades\File;
|
|
||||||
|
|
||||||
class Rose
|
|
||||||
{
|
|
||||||
public static function run()
|
|
||||||
{
|
|
||||||
$debug = Grap::$options['d'] ?? 0;
|
|
||||||
$restart = Grap::$options['r'] ?? 0;
|
|
||||||
|
|
||||||
if ($debug && ! $restart) {
|
|
||||||
Notice::note('RESTART ?', 'bb');
|
|
||||||
sleep(5);
|
|
||||||
}
|
|
||||||
|
|
||||||
File::makeDirectory(Grap::$storage.'/'.Grap::$folder, 0775, true, true);
|
|
||||||
|
|
||||||
if ($restart) {
|
|
||||||
SofaScoreRosa::query()->update(['grapped' => 0]);
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('reset all grapped to 0', 'r', 1);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('continuing grapping', 'bg');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = SofaScoreRosa::where('is_active', 1)->where('grapped', 0)->get();
|
|
||||||
|
|
||||||
$all = $res->count();
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note("total $all", 'br');
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($res as $key => $value) {
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
$key++;
|
|
||||||
echo "\n$key/$all\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$url = Grap::$options['base_url'].'api/v1/team/'.$value->ss_team_id.'/players';
|
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
|
||||||
|
|
||||||
$data['ss_team_id'] = $value->ss_team_id;
|
|
||||||
$data['ss_team_name'] = $value->ss_team_name;
|
|
||||||
|
|
||||||
/*********************************
|
|
||||||
* add team to folder
|
|
||||||
*********************************/
|
|
||||||
|
|
||||||
File::put(Grap::$storage.'/'.Grap::$folder.'/'.Strings::clean($value->ss_team_name).'.json', json_encode($data));
|
|
||||||
|
|
||||||
SofaScoreRosa::where('id', $value->id)->update(['grapped' => 1]);
|
|
||||||
|
|
||||||
Sleeper::rand(rand(0, 3));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\FileType;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\ReadDir;
|
|
||||||
use App\Mail\SofaScoreDataMail;
|
|
||||||
use App\Models\SofaScoreEventGrapped;
|
|
||||||
use App\Models\SofaScoreTask;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
use Illuminate\Support\Facades\Mail;
|
|
||||||
|
|
||||||
class SendMail
|
|
||||||
{
|
|
||||||
public static function run(int $task_id)
|
|
||||||
{
|
|
||||||
$debug = Grap::$options['d'] ?? 0;
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('Send Mail', 'bb');
|
|
||||||
}
|
|
||||||
|
|
||||||
$task = SofaScoreTask::where('id', $task_id)->first();
|
|
||||||
|
|
||||||
$files = ReadDir::get_tree(Grap::$storage);
|
|
||||||
|
|
||||||
$sendfiles = FileType::filter($files, ['xlsx']);
|
|
||||||
|
|
||||||
$header = self::createHeader($task);
|
|
||||||
|
|
||||||
$table = self::createTable($task);
|
|
||||||
|
|
||||||
Mail::to('hermann.telser@gmail.com')
|
|
||||||
->cc('ubaldo.perrucci@gmail.com')
|
|
||||||
->send(
|
|
||||||
new SofaScoreDataMail($header, $table, $sendfiles)
|
|
||||||
);
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note("Mail Send", 'bg');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function createTable(SofaScoreTask $task)
|
|
||||||
{
|
|
||||||
$res = SofaScoreEventGrapped::where('grapper_id', $task->id)->get();
|
|
||||||
|
|
||||||
$table = '';
|
|
||||||
foreach ($res as $value) {
|
|
||||||
$table .= '|' . $value->liga . '|' . $value->name . '|' . $value->starttime . '|
|
|
||||||
';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $table;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function createHeader(SofaScoreTask $task)
|
|
||||||
{
|
|
||||||
switch ($task->id) {
|
|
||||||
case 2:
|
|
||||||
$text = $task->name . ' - ' . $task->day_from;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$text = $task->name . ' - ' . $task->day_from . ' - ' . $task->day_to;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
$text = $task->name . ' - ' . Grap::$folder;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use App\Models\SofaScoreRosa;
|
|
||||||
use App\Models\SofaScoreTask;
|
|
||||||
use App\Models\SofaScoreTaskTournament;
|
|
||||||
use App\Models\SofaScoreTournament;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
class SettingsToLocal
|
|
||||||
{
|
|
||||||
public static function run()
|
|
||||||
{
|
|
||||||
$debug = Grap::$options['d'] ?? 0;
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('⚽ settings to local');
|
|
||||||
Notice::note('⚽ close all vpn');
|
|
||||||
}
|
|
||||||
exec('killall ssh');
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('⚽ open vpn');
|
|
||||||
}
|
|
||||||
exec('ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190');
|
|
||||||
/**
|
|
||||||
* SofaScoreRosa
|
|
||||||
*/
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('SofaScoreRosa', 'g');
|
|
||||||
}
|
|
||||||
SofaScoreRosa::truncate();
|
|
||||||
$rows = DB::connection('remote_mariadb')->table('sofa_score_rosas')->get();
|
|
||||||
foreach ($rows as $row) {
|
|
||||||
SofaScoreRosa::insert((array) $row);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* SofaScoreTask
|
|
||||||
*/
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('SofaScoreTask', 'g');
|
|
||||||
}
|
|
||||||
SofaScoreTask::truncate();
|
|
||||||
$rows = DB::connection('remote_mariadb')->table('sofa_score_tasks')->get();
|
|
||||||
foreach ($rows as $row) {
|
|
||||||
SofaScoreTask::insert((array) $row);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* SofaScoreTaskTournament
|
|
||||||
*/
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('SofaScoreTaskTournament', 'g');
|
|
||||||
}
|
|
||||||
SofaScoreTaskTournament::truncate();
|
|
||||||
$rows = DB::connection('remote_mariadb')->table('sofa_score_task_tournaments')->get();
|
|
||||||
foreach ($rows as $row) {
|
|
||||||
SofaScoreTaskTournament::insert((array) $row);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* SofaScoreTournament
|
|
||||||
*/
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('SofaScoreTournament', 'g');
|
|
||||||
}
|
|
||||||
SofaScoreTournament::truncate();
|
|
||||||
$rows = DB::connection('remote_mariadb')->table('sofa_score_tournaments')->get();
|
|
||||||
foreach ($rows as $row) {
|
|
||||||
SofaScoreTournament::insert((array) $row);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('⚽ close all vpn');
|
|
||||||
}
|
|
||||||
exec('killall ssh');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
|
||||||
|
|
||||||
use App\Console\Commands\Nuh;
|
|
||||||
use App\Models\SofaScoreRosaTournament;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
class SettingsToProduction
|
|
||||||
{
|
|
||||||
public static function run()
|
|
||||||
{
|
|
||||||
$debug = Nuh::$options['d'] ?? 0;
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('Settings To Production', 'bb');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('SofaScoreRosaTournament', 'g');
|
|
||||||
}
|
|
||||||
|
|
||||||
DB::connection('remote_mariadb')->table('sofa_score_rosa_tournaments')->truncate();
|
|
||||||
|
|
||||||
$rows = SofaScoreRosaTournament::get();
|
|
||||||
|
|
||||||
foreach ($rows as $row) {
|
|
||||||
|
|
||||||
DB::connection('remote_mariadb')->table('sofa_score_rosa_tournaments')->insert([
|
|
||||||
"ss_team_id" => $row->ss_team_id,
|
|
||||||
"ss_tournament_id" => $row->ss_tournament_id,
|
|
||||||
"disabled" => $row->disabled,
|
|
||||||
"grapped" => $row->grapped,
|
|
||||||
"created_at" => $row->created_at,
|
|
||||||
"updated_at" => $row->updated_at,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grap;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\ReadDir;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\Strings;
|
|
||||||
use App\Models\SofaScoreCategory;
|
|
||||||
use App\Models\SofaScoreRosa;
|
|
||||||
use App\Models\SofaScoreTask;
|
|
||||||
use App\Models\StatistikoEvent;
|
|
||||||
use App\Models\StatistikoPlayer;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
|
|
||||||
class SqlMover
|
|
||||||
{
|
|
||||||
public static function run()
|
|
||||||
{
|
|
||||||
|
|
||||||
Notice::note('SqlMover', 'b');
|
|
||||||
|
|
||||||
|
|
||||||
// $task = SofaScoreTask::where('id', 3)->first();
|
|
||||||
// $folder = Strings::clean($task->name) . '-' . $task->day_from . '-' . $task->day_to;
|
|
||||||
// $sofascore_data = storage_path('sofascore_data') . '/';
|
|
||||||
// $files = ReadDir::get_tree($sofascore_data . $folder);
|
|
||||||
// dd($files);
|
|
||||||
|
|
||||||
$file = file_get_contents(__dir__ . '/SqlMover/country.txt');
|
|
||||||
$data = explode(PHP_EOL, $file);
|
|
||||||
foreach ($data as $key => $value) {
|
|
||||||
if ($key) {
|
|
||||||
$row = explode(',', $value);
|
|
||||||
$country_id = $row[0];
|
|
||||||
$flag = $row[2];
|
|
||||||
$season_mode = $row[6];
|
|
||||||
SofaScoreCategory::where('country_id', $country_id)->update([
|
|
||||||
'season_mode' => $season_mode,
|
|
||||||
'flag' => $flag,
|
|
||||||
'in_soccer' => 1,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Notice::note('DONE', 'r', 1);
|
|
||||||
|
|
||||||
|
|
||||||
// Notice::note('StatistikoPlayer', 'b');
|
|
||||||
// $res = StatistikoEvent::pluck('match_id');
|
|
||||||
// foreach ($res as $match_id) {
|
|
||||||
// $has = StatistikoPlayer::where('match_id', (int) $match_id)->first();
|
|
||||||
// if (!$has)
|
|
||||||
// echo $match_id . "\n";
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Notice::note('StatistikoEvent', 'b');
|
|
||||||
// $res = StatistikoPlayer::get();
|
|
||||||
// foreach ($res as $pl) {
|
|
||||||
// $has = StatistikoEvent::where('match_id', (int) $pl->match_id)->first();
|
|
||||||
// if (!$has) {
|
|
||||||
// echo $match_id . "\n";
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
Notice::note('done', 'bb', 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
id,name,icon,iso2,iso3,cc,season_mode,is_country,disabled,created_at,updated_at
|
|
||||||
467,Argentina,flag-country-ar,AR,ARG,ARG,fullyear,1,0,NULL,2026-06-15 17:26:31
|
|
||||||
454,Australia,flag-country-au,AU,AUS,AUS,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
383,Austria,flag-country-at,AT,AUT,AUT,halfyear,1,0,NULL,2026-06-15 15:46:53
|
|
||||||
377,Belgium,flag-country-be,BE,BEL,BEL,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
409,Brazil,flag-country-br,BR,BRA,BRA,fullyear,1,0,NULL,2026-06-15 15:46:11
|
|
||||||
363,Bulgaria,flag-country-bg,BG,BGR,BUL,halfyear,1,0,NULL,2026-06-15 17:22:37
|
|
||||||
424,China,flag-country-cn,CN,CHN,CHN,fullyear,1,0,NULL,2026-06-15 15:44:40
|
|
||||||
389,Colombia,flag-country-co,CO,COL,COL,fullyear,1,0,NULL,2026-06-15 17:25:12
|
|
||||||
415,Croatia,flag-country-hr,HR,HRV,CRO,NULL,1,0,NULL,NULL
|
|
||||||
468,Czech Republic,flag-country-cz,CZ,CZE,CZE,NULL,1,0,NULL,2025-08-30 05:52:59
|
|
||||||
378,Denmark,flag-country-dk,DK,DNK,DEN,fullyear,1,0,NULL,2026-06-15 17:25:12
|
|
||||||
382,England,extra-england,NULL,ENG,ENG,NULL,1,0,2025-05-24 06:40:45,2025-05-24 06:40:45
|
|
||||||
678,Europe,flag-country-eu,NULL,NULL,REUROPE,NULL,0,0,2026-02-24 16:28:34,2026-02-24 16:30:36
|
|
||||||
381,European Cup,flag-country-eu,NULL,NULL,ECUP,halfyear,1,0,2025-08-30 04:45:37,2026-06-15 17:21:02
|
|
||||||
403,Finland,flag-country-fi,FI,FIN,FIN,fullyear,1,0,NULL,2026-06-15 17:25:12
|
|
||||||
408,France,flag-country-fr,FR,FRA,FRA,halfyear,1,0,NULL,2026-06-15 15:47:10
|
|
||||||
446,Germany,flag-country-de,DE,DEU,GER,halfyear,1,0,NULL,2026-06-15 15:47:39
|
|
||||||
394,Greece,flag-country-gr,GR,GRC,GRE,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
407,Holland,flag-country-nl,NL,NLD,DUT,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
412,Hungary,flag-country-hu,HU,HUN,HUN,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
373,Iceland,flag-country-is,IS,NULL,ICE,NULL,1,0,2025-08-30 04:45:33,2025-08-30 05:52:59
|
|
||||||
466,International,extra-caf,NULL,NULL,INT,NULL,1,0,2025-08-30 04:45:33,2025-08-30 05:52:59
|
|
||||||
543,International Cup,extra-world,NULL,NULL,ICUP,NULL,1,0,2025-08-30 04:45:36,2025-08-30 05:52:59
|
|
||||||
435,Ireland,flag-country-ie,IE,IRL,IRE,NULL,1,0,NULL,NULL
|
|
||||||
398,Italy,flag-country-it,IT,ITA,ITA,halfyear,1,0,NULL,2026-06-15 15:46:41
|
|
||||||
416,Japan,flag-country-jp,JP,JPN,JPN,fullyear,1,0,NULL,2026-06-15 15:44:23
|
|
||||||
406,Major League Soccer,NULL,NULL,NULL,MLS,fullyear,1,0,2025-08-30 04:45:33,2026-06-15 17:25:12
|
|
||||||
413,Mexico,flag-country-mx,MX,MEX,MEX,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
426,Northern Ireland,extra-nordirland,NULL,NIR,NIR,NULL,1,0,2025-05-24 06:40:45,2025-05-24 06:40:45
|
|
||||||
431,Norway,flag-country-no,NO,NOR,NOR,fullyear,1,0,NULL,2026-06-15 15:45:46
|
|
||||||
457,Peru,flag-country-pe,PE,PER,PER,NULL,1,0,NULL,2025-05-24 06:40:45
|
|
||||||
386,Poland,flag-country-pl,PL,POL,POL,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
418,Portugal,flag-country-pt,PT,PRT,POR,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
443,Romania,flag-country-ro,RO,ROU,ROM,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
368,Russia,flag-country-ru,RU,RUS,RUS,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
462,Saudi Arabia,flag-country-sa,SA,SAU,KSA,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
449,Scotland,extra-scotland,NULL,SCO,SCO,halfyear,1,0,2025-05-24 06:40:45,2026-06-15 17:21:02
|
|
||||||
428,Serbia,flag-country-rs,RS,SRB,SRB,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
391,Slovakia,flag-country-sk,SK,SVK,SVK,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
441,Slovenia,flag-country-si,SI,SVN,SLO,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
680,South America,extra-world,NULL,NULL,RSOAM,NULL,0,0,2026-02-24 16:28:34,2026-02-24 16:28:34
|
|
||||||
465,South America Cup,extra-world,NULL,NULL,SACUP,NULL,0,0,2026-02-24 16:28:34,2026-02-24 16:28:34
|
|
||||||
437,South Korea,flag-country-kr,KR,KOR,KOR,fullyear,1,0,NULL,2026-06-15 17:25:12
|
|
||||||
438,Spain,flag-country-es,ES,ESP,SPA,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
410,Sweden,flag-country-se,SE,SWE,SWE,fullyear,1,0,NULL,2026-06-15 15:45:31
|
|
||||||
451,Switzerland,flag-country-ch,CH,CHE,SWI,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
405,Turkey,flag-country-tr,TR,TUR,TUR,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
452,Ukraine,flag-country-ua,UA,UKR,UKR,halfyear,1,0,NULL,2026-06-15 17:21:02
|
|
||||||
1,World,extra-world,NULL,NULL,NULL,NULL,0,0,NULL,NULL
|
|
||||||
531,World Club Cup,NULL,NULL,NULL,WCLUB,NULL,0,0,2026-02-24 16:28:34,2026-02-24 16:28:34
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,880 +0,0 @@
|
|||||||
ARG1;Aldosivi;36836;Aldosivi;aldosivi
|
|
||||||
ARG1;Argentinos Juniors;3216;Argentinos Juniors;argentinos-juniors
|
|
||||||
ARG1;Atletico Tucuman;36833;Atletico Tucuman;atletico-tucuman
|
|
||||||
ARG1;Banfield;3219;Banfield;banfield
|
|
||||||
ARG1;Barracas Central;65668;Barracas Central;barracas-central
|
|
||||||
ARG1;Belgrano;3203;Belgrano;belgrano
|
|
||||||
ARG1;Boca Juniors;3202;Boca Juniors;boca-juniors
|
|
||||||
ARG1;Central Cordoba;65676;Central Córdoba;central-cordoba
|
|
||||||
ARG1;Defensa y Justicia;36839;Defensa y Justicia;defensa-y-justicia
|
|
||||||
ARG1;Deportivo Riestra;189723;Deportivo Riestra;deportivo-riestra
|
|
||||||
ARG1;Estudiantes;3206;Estudiantes de La Plata;estudiantes-de-la-plata
|
|
||||||
ARG1;Estudiantes Rio Cuarto;266694;Estudiantes de Río Cuarto;estudiantes-de-rio-cuarto
|
|
||||||
ARG1;Gimnasia LP;3205;Gimnasia y Esgrima;gimnasia-y-esgrima
|
|
||||||
ARG1;Gimnasia Mendoza;188441;Gimnasia y Esgrima Mendoza;gimnasia-y-esgrima-mendoza
|
|
||||||
ARG1;Huracan;7629;CA Huracan;ca-huracan
|
|
||||||
ARG1;Independiente;3209;Independiente;independiente
|
|
||||||
ARG1;Independiente Rivadavia;36842;Independiente Rivadavia;independiente-rivadavia
|
|
||||||
ARG1;Instituto Cordoba;4937;Instituto Córdoba;instituto-cordoba
|
|
||||||
ARG1;Lanus;3218;Lanús;lanus
|
|
||||||
ARG1;Newell's Old Boys;3212;Newell's Old Boys;newells-old-boys
|
|
||||||
ARG1;Platense;36837;Platense;platense
|
|
||||||
ARG1;Racing Club;3215;Racing Club;racing-club
|
|
||||||
ARG1;River Plate;3211;River Plate;river-plate
|
|
||||||
ARG1;Rosario Central;3217;Rosario Central;rosario-central
|
|
||||||
ARG1;San Lorenzo;3201;San Lorenzo;san-lorenzo
|
|
||||||
ARG1;Sarmiento;42338;Sarmiento;sarmiento
|
|
||||||
ARG1;Talleres;3210;Talleres;talleres
|
|
||||||
ARG1;Tigre;7628;Tigre;tigre
|
|
||||||
ARG1;Union Santa Fe;3204;Unión de Santa Fe;union-de-santa-fe
|
|
||||||
ARG1;Velez Sarsfield;3208;Velez Sarsfield;velez-sarsfield
|
|
||||||
AUS1;Adelaide United;2946;Adelaide United;adelaide-united
|
|
||||||
AUS1;Auckland ;800224;Auckland FC;auckland-fc
|
|
||||||
AUS1;Brisbane Roar;5968;Brisbane Roar;brisbane-roar
|
|
||||||
AUS1;Central Coast Mariners;5966;Central Coast Mariners;central-coast-mariners
|
|
||||||
AUS1;Macarthur;371682;Macarthur FC;macarthur-fc
|
|
||||||
AUS1;Melbourne City;42210;Melbourne City;melbourne-city
|
|
||||||
AUS1;Melbourne Victory;5970;Melbourne Victory;melbourne-victory
|
|
||||||
AUS1;Newcastle Jets;2934;Newcastle Jets;newcastle-jets
|
|
||||||
AUS1;Perth Glory;2945;Perth Glory;perth-glory
|
|
||||||
AUS1;Sydney;5971;Sydney FC;sydney-fc
|
|
||||||
AUS1;Wellington Phoenix;7568;Wellington Phoenix;wellington-phoenix
|
|
||||||
AUS1;Western Sidney Wanderers;72926;Western Sydney Wanderers;western-sydney-wanderers
|
|
||||||
AUT1;Altach;4856;SC Rheindorf Altach;sc-rheindorf-altach
|
|
||||||
AUT1;Austria Lustenau;2062;Austria Lustenau;austria-lustenau
|
|
||||||
AUT1;Austria Wien;2203;Austria Wien;austria-wien
|
|
||||||
AUT1;Grazer;2052;Grazer AK 1902;grazer-ak-1902
|
|
||||||
AUT1;Hartberg;2075;TSV Hartberg;tsv-hartberg
|
|
||||||
AUT1;LASK Linz;2058;LASK;lask
|
|
||||||
AUT1;Rapid Wien;2055;Rapid Wien;rapid-wien
|
|
||||||
AUT1;Ried;2049;SV Ried;sv-ried
|
|
||||||
AUT1;Salzburg;2046;Red Bull Salzburg;red-bull-salzburg
|
|
||||||
AUT1;Sturm Graz;2051;SK Sturm Graz;sk-sturm-graz
|
|
||||||
AUT1;Tirol Innsbruck;5405;WSG Swarovski Tirol;wsg-swarovski-tirol
|
|
||||||
AUT1;Wolfsberger;2076;Wolfsberger AC;wolfsberger-ac
|
|
||||||
BEL1;Anderlecht;2900;RSC Anderlecht;rsc-anderlecht
|
|
||||||
BEL1;Antwerp;2889;Royal Antwerp FC;royal-antwerp-fc
|
|
||||||
BEL1;Beveren;4859;SK Beveren;sk-beveren
|
|
||||||
BEL1;Cercle Brugge;2929;Cercle Brugge;cercle-brugge
|
|
||||||
BEL1;Charleroi;2898;RC Sporting Charleroi;rc-sporting-charleroi
|
|
||||||
BEL1;Club Brugge;2888;Club Brugge;club-brugge
|
|
||||||
BEL1;Genk;2890;KRC Genk;krc-genk
|
|
||||||
BEL1;Gent;2903;KAA Gent;kaa-gent
|
|
||||||
BEL1;Kortrijk;4858;KV Kortrijk;kv-kortrijk
|
|
||||||
BEL1;La Louviere;368506;RAAL La Louvière;raal-la-louviere
|
|
||||||
BEL1;Lommel;5046;Lommel SK;lommel-sk
|
|
||||||
BEL1;Mechelen;5044;KV Mechelen;kv-mechelen
|
|
||||||
BEL1;OH Leuven;2918;Oud-Heverlee Leuven;oud-heverlee-leuven
|
|
||||||
BEL1;Sint Truiden;2895;Sint-Truidense VV;sint-truidense-vv
|
|
||||||
BEL1;Standard Liege;2901;Standard Liege;standard-liege
|
|
||||||
BEL1;Union Saint Gilloise;4860;Royale Union Saint-Gilloise;royale-union-saint-gilloise
|
|
||||||
BEL1;Westerlo;2893;KVC Westerlo;kvc-westerlo
|
|
||||||
BEL1;Zulte Waregem;2933;SV Zulte Waregem;sv-zulte-waregem
|
|
||||||
BOL1;Always Ready;268083;Club Always Ready;club-always-ready
|
|
||||||
BOL1;Blooming;6968;Blooming;blooming
|
|
||||||
BOL1;Bolivar;7059;Bolívar;bolivar
|
|
||||||
BOL1;Independiente Petrolero;372975;Club Independiente;independiente-petrolero
|
|
||||||
BRA1;Atletico MG;1977;Atletico Mineiro;atletico-mineiro
|
|
||||||
BRA1;Atletico PR;1967;Athletico Paranaense;athletico-paranaense
|
|
||||||
BRA1;Bahia;1955;Bahia;bahia
|
|
||||||
BRA1;Botafogo;1958;Botafogo;botafogo
|
|
||||||
BRA1;Bragantino;1999;RB Bragantino;red-bull-bragantino
|
|
||||||
BRA1;Chapecoense;21845;Chapecoense;chapecoense
|
|
||||||
BRA1;Corinthians;1957;Corinthians;corinthians
|
|
||||||
BRA1;Coritiba;1982;Coritiba;coritiba
|
|
||||||
BRA1;Cruzeiro;1954;Cruzeiro;cruzeiro
|
|
||||||
BRA1;Flamengo;5981;Flamengo;flamengo
|
|
||||||
BRA1;Fluminense;1961;Fluminense;fluminense
|
|
||||||
BRA1;Gremio;5926;Gremio;gremio
|
|
||||||
BRA1;Internacional;1966;Internacional;internacional
|
|
||||||
BRA1;Mirassol;21982;Mirassol;mirassol
|
|
||||||
BRA1;Palmeiras;1963;Palmeiras;palmeiras
|
|
||||||
BRA1;Remo;2012;Remo;remo
|
|
||||||
BRA1;Santos;1968;Santos;santos
|
|
||||||
BRA1;Sao Paulo;1981;Sao Paulo;sao-paulo
|
|
||||||
BRA1;Vasco da Gama;1974;Vasco da Gama;vasco-da-gama
|
|
||||||
BRA1;Vitoria;1962;Vitória;vitoria
|
|
||||||
BUL1;Arda;274971;Arda Kardzhali;arda-kardzhali
|
|
||||||
BUL1;Botev Plovdiv;5241;Botev Plovdiv;botev-plovdiv
|
|
||||||
BUL1;Botev Vratsa;36938;Botev Vratsa;botev-vratsa
|
|
||||||
BUL1;Cherno More;3280;Cherno More Varna;cherno-more-varna
|
|
||||||
BUL1;CSKA 1948 Sofia;252080;FC CSKA 1948 Sofia;fc-cska-1948-sofia
|
|
||||||
BUL1;CSKA Sofia;3275;CSKA Sofia;cska-sofia
|
|
||||||
BUL1;Dunav Ruse;3286;Dunav Ruse;dunav-ruse
|
|
||||||
BUL1;Levski Sofia;3273;Levski Sofia;levski-sofia
|
|
||||||
BUL1;Lokomotiv Plovdiv;3272;Lokomotiv Plovdiv;lokomotiv-plovdiv
|
|
||||||
BUL1;Lokomotiv Sofia;3277;Lokomotiv Sofia;lokomotiv-sofia
|
|
||||||
BUL1;Ludogorets;43840;Ludogorets Razgrad;ludogorets-razgrad
|
|
||||||
BUL1;Septemvri Sofia;201203;FK Septemvri Sofia;fk-septemvri-sofia
|
|
||||||
BUL1;Slavia Sofia;3274;Slavia Sofia;slavia-sofia
|
|
||||||
BUL1;Spartak Varna;3278;FK Spartak Varna;fk-spartak-varna
|
|
||||||
CHI1;Audax Italiano;3162;Audax Italiano;audax-italiano
|
|
||||||
CHI1;Coquimbo Unido;3165;Coquimbo Unido;coquimbo-unido
|
|
||||||
CHI1;O'Higgins;3163;O'Higgins;ohiggins
|
|
||||||
CHI1;Palestino;3157;Palestino;palestino
|
|
||||||
CHI1;UC Chile;3151;Universidad Católica;universidad-catolica
|
|
||||||
CHN1;Beijing Guoan;3376;Beijing Sinobo Guoan;beijing-sinobo-guoan
|
|
||||||
CHN1;Chengdu Rongcheng;221241;Chengdu Rongcheng;chengdu-rongcheng
|
|
||||||
CHN1;Chongqing Tonglianglong;474989;Chongqing Tonglianglong FC;chongqing-tonglianglong-fc
|
|
||||||
CHN1;Dalian Yingbo;474992;Dalian Yingbo FC;dalian-young-boy-fc
|
|
||||||
CHN1;Henan Songshan;34692;Henan Jianye;henan-jianye
|
|
||||||
CHN1;Liaoning Tieren;221240;Liaoning Tieren FC;liaoning-shenyang-urban
|
|
||||||
CHN1;Qingdao Hainiu;34695;Qingdao Hainiu;qingdao-hainiu
|
|
||||||
CHN1;Qingdao West Coast;369532;Qingdao West Coast;qingdao-west-coast
|
|
||||||
CHN1;Shandong Taishan;3371;Shandong Luneng Taishan;shandong-luneng-taishan
|
|
||||||
CHN1;Shanghai Port;41537;Shanghai Port;shanghai-port
|
|
||||||
CHN1;Shanghai Shenhua;3373;Shanghai Greenland Shenhua;shanghai-greenland-shenhua
|
|
||||||
CHN1;Shenzhen Peng City;281331;Shenzhen City;shenzhen-city
|
|
||||||
CHN1;Tianjin Tigers;3367;Tianjin Tigers;tianjin-tigers
|
|
||||||
CHN1;Wuhan Three Towns;295152;Wuhan Three Towns;wuhan-three-towns
|
|
||||||
CHN1;Yunnan Yukun;474991;Yunnan Yukun;yunnan-yukun
|
|
||||||
CHN1;Zhejiang Professional;34697;Zhejiang;zhejiang
|
|
||||||
COL1;Aguilas Doradas;48244;Rionegro Águilas Doradas;rionegro-aguilas-doradas
|
|
||||||
COL1;Alianza FC;504899;Alianza Valledupar FC;alianza-futbol-club
|
|
||||||
COL1;America de Cali;6102;América de Cali;america-de-cali
|
|
||||||
COL1;Atletico Bucaramanga;6103;Atlético Bucaramanga;atletico-bucaramanga
|
|
||||||
COL1;Atletico Nacional;6106;Atlético Nacional;atletico-nacional
|
|
||||||
COL1;Boyaca Chico;6107;Boyacá Chicó FC;boyaca-chico-fc
|
|
||||||
COL1;Deportes Tolima;6111;Deportes Tolima;deportes-tolima
|
|
||||||
COL1;Deportivo Cali;6112;Deportivo Cali;deportivo-cali
|
|
||||||
COL1;Deportivo Cucuta;6108;Cúcuta Deportivo;cucuta-deportivo
|
|
||||||
COL1;Deportivo Pasto;6113;Deportivo Pasto;deportivo-pasto
|
|
||||||
COL1;Deportivo Pereira;6109;Deportivo Pereira;deportivo-pereira
|
|
||||||
COL1;Fortaleza CEIF;89368;Fortaleza CEIF;fortaleza-ceif
|
|
||||||
COL1;Independiente Medellin;6115;Independiente Medellín;independiente-medellin
|
|
||||||
COL1;Independiente Santa Fe;6116;Independiente Santa Fe;independiente-santa-fe
|
|
||||||
COL1;Inter Bogota;1164534;Internacional de Bogota;internacional-de-bogota
|
|
||||||
COL1;Jaguares de Cordoba;89370;Jaguares de Córdoba;jaguares-de-cordoba
|
|
||||||
COL1;Junior FC;6105;Junior Barranquilla;junior-barranquilla
|
|
||||||
COL1;Llaneros;89374;Llaneros FC;llaneros-fc
|
|
||||||
COL1;Millonarios;6117;Millonarios;millonarios
|
|
||||||
COL1;Once Caldas;6118;Once Caldas;once-caldas
|
|
||||||
CRO1;Dinamo Zagreb;2032;GNK Dinamo Zagreb;gnk-dinamo-zagreb
|
|
||||||
CRO1;Hajduk Split;2036;HNK Hajduk Split;hnk-hajduk-split
|
|
||||||
CRO1;Istra;25529;NK Istra 1961;nk-istra-1961
|
|
||||||
CRO1;Lokomotiva Zagreb;36246;NK Lokomotiva Zagreb;nk-lokomotiva-zagreb
|
|
||||||
CRO1;Osijek;2040;NK Osijek;nk-osijek
|
|
||||||
CRO1;Rijeka;2039;HNK Rijeka;hnk-rijeka
|
|
||||||
CRO1;Rudes;35226;NK Rudeš;nk-rudes
|
|
||||||
CRO1;Slaven Koprivnica;2042;NK Slaven Belupo;nk-slaven-belupo
|
|
||||||
CRO1;Varazdin;231380;NK Varaždin;nk-varazdin
|
|
||||||
CRO1;Velika Gorica;43917;HNK Gorica;hnk-gorica
|
|
||||||
CZE1;Artis Brno;35264;SK Artis Brno;sk-lisen
|
|
||||||
CZE1;Banik Ostrava;2204;Baník Ostrava;banik-ostrava
|
|
||||||
CZE1;Bohemians Praha;6064;Bohemians Praha 1905;bohemians-praha-1905
|
|
||||||
CZE1;Hradec Kralove;2217;FC Hradec Kralove;fc-hradec-kralove
|
|
||||||
CZE1;Jablonec;2205;FK Jablonec;fk-jablonec
|
|
||||||
CZE1;Mlada Boleslav;2224;Mlada Boleslav;mlada-boleslav
|
|
||||||
CZE1;Pardubice;2230;Pardubice;pardubice
|
|
||||||
CZE1;Sigma Olomouc;2207;SK Sigma Olomouc;sk-sigma-olomouc
|
|
||||||
CZE1;Slavia Praha;2216;Slavia Praha;slavia-praha
|
|
||||||
CZE1;Slovacko;4871;1. FC Slovacko;1-fc-slovacko
|
|
||||||
CZE1;Slovan Liberec;2219;Slovan Liberec;slovan-liberec
|
|
||||||
CZE1;Sparta Praha;2218;Sparta Praha;sparta-praha
|
|
||||||
CZE1;Teplice;2208;FK Teplice;fk-teplice
|
|
||||||
CZE1;Viktoria Plzen;4502;Viktoria Plzeň;viktoria-plzen
|
|
||||||
CZE1;Zbrojovka Brno;2210;FC Zbrojovka Brno;fc-zbrojovka-brno
|
|
||||||
CZE1;Zlin;2220;Fastav Zlín;fastav-zlin
|
|
||||||
DEN1;AGF Aarhus;1291;AGF;agf
|
|
||||||
DEN1;Brondby;1281;Brøndby IF;brondby-if
|
|
||||||
DEN1;Horsens;1297;AC Horsens;ac-horsens
|
|
||||||
DEN1;Kobenhavn;1284;FC København;fc-kobenhavn
|
|
||||||
DEN1;Lyngby;1756;Lyngby BK;lyngby-bk
|
|
||||||
DEN1;Midtjylland;1289;FC Midtjylland;fc-midtjylland
|
|
||||||
DEN1;Nordsjaelland;1292;FC Nordsjælland;fc-nordsjaelland
|
|
||||||
DEN1;OB Odense;1286;OB;ob
|
|
||||||
DEN1;Randers;1301;Randers FC;randers-fc
|
|
||||||
DEN1;Silkeborg;1285;Silkeborg;silkeborg
|
|
||||||
DEN1;Sonderjyske;1295;SønderjyskE;sonderjyske
|
|
||||||
DEN1;Viborg;1288;Viborg FF;viborg-ff
|
|
||||||
ECU1;Barcelona Guayaquil;5250;Barcelona SC Guayaquil;barcelona-sc
|
|
||||||
ECU1;Deportivo Cuenca;5251;Deportivo Cuenca;deportivo-cuenca
|
|
||||||
ECU1;Independiente Del Valle;39723;Independiente del Valle;independiente-del-valle
|
|
||||||
ECU1;LDU Quito;5257;LDU;ldu
|
|
||||||
ECU1;Macara;6001;Macará;macara
|
|
||||||
ENG1;Arsenal;42;Arsenal;arsenal
|
|
||||||
ENG1;Aston Villa;40;Aston Villa;aston-villa
|
|
||||||
ENG1;Bournemouth;60;Bournemouth;bournemouth
|
|
||||||
ENG1;Brentford;50;Brentford;brentford
|
|
||||||
ENG1;Brighton & Hove;30;Brighton & Hove Albion;brighton-hove-albion
|
|
||||||
ENG1;Chelsea;38;Chelsea;chelsea
|
|
||||||
ENG1;Coventry;11;Coventry City;coventry-city
|
|
||||||
ENG1;Crystal Palace;7;Crystal Palace;crystal-palace
|
|
||||||
ENG1;Everton;48;Everton;everton
|
|
||||||
ENG1;Fulham;43;Fulham;fulham
|
|
||||||
ENG1;Hull;96;Hull City;hull-city
|
|
||||||
ENG1;Ipswich;32;Ipswich Town;ipswich-town
|
|
||||||
ENG1;Leeds;34;Leeds United;leeds-united
|
|
||||||
ENG1;Liverpool;44;Liverpool;liverpool
|
|
||||||
ENG1;Manchester City;17;Manchester City;manchester-city
|
|
||||||
ENG1;Manchester United;35;Manchester United;manchester-united
|
|
||||||
ENG1;Newcastle;39;Newcastle United;newcastle-united
|
|
||||||
ENG1;Nottingham;14;Nottingham Forest;nottingham-forest
|
|
||||||
ENG1;Sunderland;41;Sunderland;sunderland
|
|
||||||
ENG1;Tottenham;33;Tottenham;tottenham
|
|
||||||
ENG2;Birmingham;9;Birmingham City;birmingham-city
|
|
||||||
ENG2;Blackburn;46;Blackburn Rovers;blackburn-rovers
|
|
||||||
ENG2;Bolton;5;Bolton Wanderers;bolton-wanderers
|
|
||||||
ENG2;Bristol City;58;Bristol City;bristol-city
|
|
||||||
ENG2;Burnley;6;Burnley;burnley
|
|
||||||
ENG2;Cardiff;61;Cardiff City;cardiff-city
|
|
||||||
ENG2;Charlton;47;Charlton Athletic;charlton-athletic
|
|
||||||
ENG2;Derby;27;Derby County;derby-county
|
|
||||||
ENG2;Lincoln;92;Lincoln City;lincoln-city
|
|
||||||
ENG2;Middlesbrough;36;Middlesbrough;middlesbrough
|
|
||||||
ENG2;Millwall;25;Millwall;millwall
|
|
||||||
ENG2;Norwich;263;Norwich City;norwich-city
|
|
||||||
ENG2;Portsmouth;2;Portsmouth;portsmouth
|
|
||||||
ENG2;Preston;21;Preston North End;preston-north-end
|
|
||||||
ENG2;QPR;1;Queens Park Rangers;queens-park-rangers
|
|
||||||
ENG2;Sheffield United;15;Sheffield United;sheffield-united
|
|
||||||
ENG2;Southampton;45;Southampton;southampton
|
|
||||||
ENG2;Stoke;29;Stoke City;stoke-city
|
|
||||||
ENG2;Swansea;74;Swansea City;swansea-city
|
|
||||||
ENG2;Watford;24;Watford;watford
|
|
||||||
ENG2;West Bromwich;8;West Bromwich Albion;west-bromwich-albion
|
|
||||||
ENG2;West Ham;37;West Ham United;west-ham-united
|
|
||||||
ENG2;Wolverhampton;3;Wolverhampton;wolverhampton
|
|
||||||
ENG2;Wrexham;64;Wrexham;wrexham
|
|
||||||
ENG3;Barnsley;23;Barnsley;barnsley
|
|
||||||
ENG3;Blackpool;67;Blackpool;blackpool
|
|
||||||
ENG3;Bradford City;22;Bradford City;bradford-city
|
|
||||||
ENG3;Bromley;180;Bromley;bromley
|
|
||||||
ENG3;Burton;134;Burton Albion;burton-albion
|
|
||||||
ENG3;Cambridge United;63;Cambridge United;cambridge-united
|
|
||||||
ENG3;Doncaster;84;Doncaster Rovers;doncaster-rovers
|
|
||||||
ENG3;Huddersfield;59;Huddersfield Town;huddersfield-town
|
|
||||||
ENG3;Leicester;31;Leicester City;leicester-city
|
|
||||||
ENG3;Leyton Orient;83;Leyton Orient;leyton-orient
|
|
||||||
ENG3;Luton;72;Luton Town;luton-town
|
|
||||||
ENG3;Mansfield;70;Mansfield Town;mansfield-town
|
|
||||||
ENG3;Milton Keynes;4;Milton Keynes Dons;milton-keynes-dons
|
|
||||||
ENG3;Notts County;56;Notts County;notts-county
|
|
||||||
ENG3;Oxford United;95;Oxford United;oxford-united
|
|
||||||
ENG3;Peterborough;54;Peterborough United;peterborough-united
|
|
||||||
ENG3;Plymouth;71;Plymouth Argyle;plymouth-argyle
|
|
||||||
ENG3;Reading;28;Reading;reading
|
|
||||||
ENG3;Sheffield Wednesday;12;Sheffield Wednesday;sheffield-wednesday
|
|
||||||
ENG3;Stevenage;133;Stevenage;stevenage
|
|
||||||
ENG3;Stockport;10;Stockport County;stockport-county
|
|
||||||
ENG3;Wigan;49;Wigan Athletic;wigan-athletic
|
|
||||||
ENG3;Wimbledon;23957;AFC Wimbledon;afc-wimbledon
|
|
||||||
ENG3;Wycombe;62;Wycombe Wanderers;wycombe-wanderers
|
|
||||||
ENG4;Accrington;187;Accrington Stanley;accrington-stanley
|
|
||||||
ENG4;Barnet;77;Barnet;barnet
|
|
||||||
ENG4;Bristol Rovers;76;Bristol Rovers;bristol-rovers
|
|
||||||
ENG4;Cheltenham;69;Cheltenham Town;cheltenham-town
|
|
||||||
ENG4;Chesterfield;68;Chesterfield;chesterfield
|
|
||||||
ENG4;Colchester;66;Colchester United;colchester-united
|
|
||||||
ENG4;Crawley;4875;Crawley Town;crawley-town
|
|
||||||
ENG4;Crewe;19;Crewe Alexandra;crewe-alexandra
|
|
||||||
ENG4;Exeter;86;Exeter City;exeter-city
|
|
||||||
ENG4;Fleetwood;23959;Fleetwood Town;fleetwood-town
|
|
||||||
ENG4;Gillingham;20;Gillingham;gillingham
|
|
||||||
ENG4;Grimsby;18;Grimsby Town;grimsby-town
|
|
||||||
ENG4;Newport;79;Newport County;newport-county
|
|
||||||
ENG4;Northampton;57;Northampton Town;northampton-town
|
|
||||||
ENG4;Oldham;65;Oldham Athletic;oldham-athletic
|
|
||||||
ENG4;Port Vale;55;Port Vale;port-vale
|
|
||||||
ENG4;Rochdale;103;Rochdale;rochdale
|
|
||||||
ENG4;Rotherham;13;Rotherham United;rotherham-united
|
|
||||||
ENG4;Salford;37998;Salford City;salford-city
|
|
||||||
ENG4;Shrewsbury;82;Shrewsbury Town;shrewsbury-town
|
|
||||||
ENG4;Swindon;53;Swindon Town;swindon-town
|
|
||||||
ENG4;Tranmere;51;Tranmere Rovers;tranmere-rovers
|
|
||||||
ENG4;Walsall;26;Walsall;walsall
|
|
||||||
ENG4;York City;73;York City;york-city
|
|
||||||
FIN1;Gnistan;2271;Gnistan;gnistan
|
|
||||||
FIN1;HJK;2242;HJK Helsinki;hjk-helsinki
|
|
||||||
FIN1;Ilves;22386;Ilves Tampere;ilves-tampere
|
|
||||||
FIN1;Inter Turku;2247;Inter Turku;inter-turku
|
|
||||||
FIN1;Jaro;2252;FF Jaro;ff-jaro
|
|
||||||
FIN1;KuPS;2244;KuPS Kuopio;kups-kuopio
|
|
||||||
FIN1;Lahti;2249;FC Lahti;fc-lahti
|
|
||||||
FIN1;Mariehamn;5058;IFK Mariehamn;ifk-mariehamn
|
|
||||||
FIN1;Oulu;5114;AC Oulu;ac-oulu
|
|
||||||
FIN1;SJK;22395;SJK Seinajoki;sjk-seinajoki
|
|
||||||
FIN1;TPS;2254;TPS Turku;tps-turku
|
|
||||||
FIN1;VPS;2246;VPS;vps
|
|
||||||
FRA1;Angers;1684;Angers;angers
|
|
||||||
FRA1;Auxerre;1646;AJ Auxerre;aj-auxerre
|
|
||||||
FRA1;Brest;1715;Stade Brestois 29;stade-brestois-29
|
|
||||||
FRA1;Le Havre;1662;Le Havre;le-havre
|
|
||||||
FRA1;Le Mans;1672;Le Mans;le-mans
|
|
||||||
FRA1;Lens;1648;RC Lens;rc-lens
|
|
||||||
FRA1;Lille;1643;Lille OSC;lille-osc
|
|
||||||
FRA1;Lorient;1656;Lorient;lorient
|
|
||||||
FRA1;Lyon;1649;Olympique Lyonnais;olympique-lyonnais
|
|
||||||
FRA1;Marseille;1641;Olympique de Marseille;olympique-de-marseille
|
|
||||||
FRA1;Monaco;1653;AS Monaco;as-monaco
|
|
||||||
FRA1;Nice;1661;OGC Nice;ogc-nice
|
|
||||||
FRA1;Paris;6070;Paris FC;paris-fc
|
|
||||||
FRA1;PSG;1644;Paris Saint-Germain;paris-saint-germain
|
|
||||||
FRA1;Rennes;1658;Stade Rennais;stade-rennais
|
|
||||||
FRA1;Strasbourg;1659;Strasbourg;strasbourg
|
|
||||||
FRA1;Toulouse;1681;Toulouse;toulouse
|
|
||||||
FRA1;Troyes;1652;Troyes;troyes
|
|
||||||
FRA2;Annecy;210894;Annecy FC;annecy-fc
|
|
||||||
FRA2;Boulogne;1711;US Boulogne Côte-d'Opale;us-boulogne-cote-dopale
|
|
||||||
FRA2;Clermont;1680;Clermont Foot 63;clermont-foot-63
|
|
||||||
FRA2;Dijon;1686;Dijon;dijon
|
|
||||||
FRA2;Dunkerque;6918;Dunkerque;dunkerque
|
|
||||||
FRA2;Grenoble;1671;Grenoble;grenoble
|
|
||||||
FRA2;Guingamp;1654;Guingamp;guingamp
|
|
||||||
FRA2;Laval;1673;Stade Lavallois;stade-lavallois
|
|
||||||
FRA2;Metz;1651;Metz;metz
|
|
||||||
FRA2;Montpellier;1642;Montpellier;montpellier
|
|
||||||
FRA2;Nancy;1675;Nancy;nancy
|
|
||||||
FRA2;Nantes;1647;FC Nantes;fc-nantes
|
|
||||||
FRA2;Pau;1685;Pau FC;pau-fc
|
|
||||||
FRA2;Red Star;52874;Red Star FC;red-star-fc
|
|
||||||
FRA2;Reims;1682;Stade de Reims;stade-de-reims
|
|
||||||
FRA2;Rodez;6925;Rodez AF;rodez-af
|
|
||||||
FRA2;Saint Etienne;1678;Saint-Étienne;saint-etienne
|
|
||||||
FRA2;Sochaux;1657;Sochaux;sochaux
|
|
||||||
GER1;Augsburg;2600;Augsburg;augsburg
|
|
||||||
GER1;Bayern Munchen;2672;Bayern München;bayern-munchen
|
|
||||||
GER1;Dortmund;2673;Borussia Dortmund;borussia-dortmund
|
|
||||||
GER1;Eintracht Frankfurt;2674;Eintracht Frankfurt;eintracht-frankfurt
|
|
||||||
GER1;Elversberg;2598;SV 07 Elversberg;sv-07-elversberg
|
|
||||||
GER1;Freiburg;2538;Freiburg;freiburg
|
|
||||||
GER1;Hamburger;2676;Hamburger SV;hamburger-sv
|
|
||||||
GER1;Hoffenheim;2569;1899 Hoffenheim;1899-hoffenheim
|
|
||||||
GER1;Koln;2671;1. FC Köln;1-fc-koln
|
|
||||||
GER1;Leipzig;36360;RB Leipzig;rb-leipzig
|
|
||||||
GER1;Leverkusen;2681;Bayer 04 Leverkusen;bayer-04-leverkusen
|
|
||||||
GER1;Mainz;2556;1. FSV Mainz 05;1-fsv-mainz-05
|
|
||||||
GER1;Monchengladbach;2527;Borussia M'gladbach;borussia-mgladbach
|
|
||||||
GER1;Paderborn;2561;SC Paderborn 07;sc-paderborn-07
|
|
||||||
GER1;Schalke;2530;FC Schalke 04;fc-schalke-04
|
|
||||||
GER1;Stuttgart;2677;VfB Stuttgart;vfb-stuttgart
|
|
||||||
GER1;Union Berlin;2547;1. FC Union Berlin;1-fc-union-berlin
|
|
||||||
GER1;Werder Bremen;2534;Werder Bremen;werder-bremen
|
|
||||||
GER2;Arminia Bielefeld;2540;Arminia Bielefeld;arminia-bielefeld
|
|
||||||
GER2;Bochum;2542;VfL Bochum;vfl-bochum
|
|
||||||
GER2;Darmstadt;2576;Darmstadt 98;darmstadt-98
|
|
||||||
GER2;Dynamo Dresden;2595;Dynamo Dresden;dynamo-dresden
|
|
||||||
GER2;Eintracht Braunschweig;2557;Eintracht Braunschweig;eintracht-braunschweig
|
|
||||||
GER2;Energie Cottbus;2532;Energie Cottbus;energie-cottbus
|
|
||||||
GER2;Greuther Furth;2551;SpVgg Greuther Fürth;spvgg-greuther-furth
|
|
||||||
GER2;Hannover;2541;Hannover 96;hannover-96
|
|
||||||
GER2;Heidenheim;5885;1. FC Heidenheim;1-fc-heidenheim
|
|
||||||
GER2;Hertha;2528;Hertha BSC;hertha-bsc
|
|
||||||
GER2;Holstein Kiel;2573;Holstein Kiel;holstein-kiel
|
|
||||||
GER2;Kaiserslautern;2675;1. FC Kaiserslautern;1-fc-kaiserslautern
|
|
||||||
GER2;Karlsruher;2553;Karlsruher SC;karlsruher-sc
|
|
||||||
GER2;Magdeburg;2591;1. FC Magdeburg;1-fc-magdeburg
|
|
||||||
GER2;Nurnberg;2523;1. FC Nürnberg;1-fc-nurnberg
|
|
||||||
GER2;Osnabruck;2581;VfL Osnabrück;vfl-osnabruck
|
|
||||||
GER2;St. Pauli;2526;FC St. Pauli;fc-st-pauli
|
|
||||||
GER2;Wolfsburg;2524;Wolfsburg;wolfsburg
|
|
||||||
GRE1;AEK Athens;3250;AEK Athens;aek-athens
|
|
||||||
GRE1;Aris;3252;Aris Thessaloniki;aris-thessaloniki
|
|
||||||
GRE1;Asteras Tripolis;6342;Asteras Tripolis;asteras-tripolis
|
|
||||||
GRE1;Atromitos;5062;Atromitos Athens;atromitos-athens
|
|
||||||
GRE1;Iraklis;0;---;---
|
|
||||||
GRE1;Kalamata;412056;PS Kalamata;pae-ps-kalamata
|
|
||||||
GRE1;Kifisia;120224;A.E. Kifisia FC;ae-kifisia-fc
|
|
||||||
GRE1;Levadiakos;5063;Levadiakos;levadiakos
|
|
||||||
GRE1;OFI;3241;OFI Crete;ofi-crete
|
|
||||||
GRE1;Olympiakos;3245;Olympiacos;olympiacos
|
|
||||||
GRE1;Panaitolikos;7004;Panetolikos;panetolikos
|
|
||||||
GRE1;Panathinaikos;3248;Panathinaikos;panathinaikos
|
|
||||||
GRE1;PAOK;3251;PAOK;paok
|
|
||||||
GRE1;Volos;267459;Volos NFC;volos-nfc
|
|
||||||
HUN1;Debrecen;1921;Debreceni VSC;debreceni-vsc
|
|
||||||
HUN1;Ferencvaros;1925;Ferencvarosi TC;ferencvarosi-tc
|
|
||||||
HUN1;Gyori ETO;1923;ETO FC Győr;eto-fc-gyor
|
|
||||||
HUN1;Honved;1916;Budapest Honved;budapest-honved
|
|
||||||
HUN1;Kisvarda;25397;Kisvarda Master Good;kisvarda-fc
|
|
||||||
HUN1;MTK;1915;MTK Budapest;mtk-budapest
|
|
||||||
HUN1;Nyiregyhaza;5124;Nyiregyháza Spartacus;nyiregyhaza-spartacus
|
|
||||||
HUN1;Paksi;6059;Paksi;paksi
|
|
||||||
HUN1;Puskas;25596;Puskas Akademia;puskas-akademia
|
|
||||||
HUN1;Ujpest;1924;Újpest;ujpest
|
|
||||||
HUN1;Vasas;1919;Vasas;vasas
|
|
||||||
HUN1;Zalaegerszegi;1922;Zalaegerszegi TE;zalaegerszegi-te
|
|
||||||
ISL1;Akranes;1898;ÍA Akranes;ia-akranes
|
|
||||||
ISL1;Akureyri;1904;KA Akureyri;ka-akureyri
|
|
||||||
ISL1;Breidablik;1901;Breiðablik Kópavogur;breidablik-kopavogur
|
|
||||||
ISL1;Fram;1893;Fram Reykjavík;fram-reykjavik
|
|
||||||
ISL1;Hafnarfjardar;1894;FH Hafnarfjörður;fh-hafnarfjordur
|
|
||||||
ISL1;Keflavik;1900;Keflavík IF;keflavik-if
|
|
||||||
ISL1;KR Reykjavik;1902;KR Reykjavík;kr-reykjavik
|
|
||||||
ISL1;Stjarnan;1912;Stjarnan Garðabær;stjarnan-gardabaer
|
|
||||||
ISL1;Thor Akureyri;1903;Þór Akureyri;thor-akureyri
|
|
||||||
ISL1;Valur;1899;Valur Reykjavík;valur-reykjavik
|
|
||||||
ISL1;Vestmannaeyja;1895;ÍBV;ibv
|
|
||||||
ISL1;Vikingur Reykjavik;1908;Víkingur Reykjavík;vikingur-reykjavik
|
|
||||||
IRL1;Bohemian Dublin;3173;Bohemian;bohemian
|
|
||||||
IRL1;Derry;3170;Derry City;derry-city
|
|
||||||
IRL1;Drogheda;3180;Drogheda United;drogheda-united
|
|
||||||
IRL1;Dundalk;3179;Dundalk;dundalk
|
|
||||||
IRL1;Galway;137382;Galway United;galway-united
|
|
||||||
IRL1;Shamrock Rovers;3177;Shamrock Rovers;shamrock-rovers
|
|
||||||
IRL1;Shelbourne;3174;Shelbourne;shelbourne
|
|
||||||
IRL1;Sligo Rovers;3190;Sligo Rovers;sligo-rovers
|
|
||||||
IRL1;St Patrick's;3169;St. Patrick's Athletic;st-patricks-athletic
|
|
||||||
IRL1;Waterford;3194;Waterford;waterford
|
|
||||||
ITA1;Atalanta;2686;Atalanta;atalanta
|
|
||||||
ITA1;Bologna;2685;Bologna;bologna
|
|
||||||
ITA1;Cagliari;2719;Cagliari;cagliari
|
|
||||||
ITA1;Como;2704;Como;como
|
|
||||||
ITA1;Fiorentina;2693;Fiorentina;fiorentina
|
|
||||||
ITA1;Frosinone;2801;Frosinone;frosinone
|
|
||||||
ITA1;Genoa;2713;Genoa;genoa
|
|
||||||
ITA1;Internazionale;2697;Inter;inter
|
|
||||||
ITA1;Juventus;2687;Juventus;juventus
|
|
||||||
ITA1;Lazio;2699;Lazio;lazio
|
|
||||||
ITA1;Lecce;2689;Lecce;lecce
|
|
||||||
ITA1;Milan;2692;Milan;milan
|
|
||||||
ITA1;Monza;2729;Monza;monza
|
|
||||||
ITA1;Napoli;2714;Napoli;napoli
|
|
||||||
ITA1;Parma;2690;Parma;parma
|
|
||||||
ITA1;Roma;2702;Roma;roma
|
|
||||||
ITA1;Sassuolo;2793;Sassuolo;sassuolo
|
|
||||||
ITA1;Torino;2696;Torino;torino
|
|
||||||
ITA1;Udinese;2695;Udinese;udinese
|
|
||||||
ITA1;Venezia;2688;Venezia;venezia
|
|
||||||
ITA2;Arezzo;2731;Arezzo;arezzo
|
|
||||||
ITA2;Ascoli;2707;Ascoli;ascoli
|
|
||||||
ITA2;Avellino;2730;Avellino;avellino
|
|
||||||
ITA2;Benevento;2759;Benevento;benevento
|
|
||||||
ITA2;Carrarese;2745;Carrarese;carrarese
|
|
||||||
ITA2;Catanzaro;2796;Catanzaro;catanzaro
|
|
||||||
ITA2;Cesena;2742;Cesena;cesena
|
|
||||||
ITA2;Cremonese;2761;Cremonese;cremonese
|
|
||||||
ITA2;Empoli;2705;Empoli;empoli
|
|
||||||
ITA2;Entella;43680;Virtus Entella;virtus-entella
|
|
||||||
ITA2;Juve Stabia;5324;Juve Stabia;juve-stabia
|
|
||||||
ITA2;Mantova;2770;Mantova;mantova
|
|
||||||
ITA2;Modena;2706;Modena;modena
|
|
||||||
ITA2;Padova;2741;Padova;padova
|
|
||||||
ITA2;Palermo;2715;Palermo;palermo
|
|
||||||
ITA2;Pisa;2737;Pisa;pisa
|
|
||||||
ITA2;Sampdoria;2711;Sampdoria;sampdoria
|
|
||||||
ITA2;Sudtirol;2760;Südtirol;sudtirol
|
|
||||||
ITA2;Verona;2701;Hellas Verona;hellas-verona
|
|
||||||
ITA2;Vicenza;2722;L.R. Vicenza;lr-vicenza
|
|
||||||
JPN1;Avispa Fukuoka;3143;Avispa Fukuoka;avispa-fukuoka
|
|
||||||
JPN1;Cerezo Osaka;3141;Cerezo Osaka;cerezo-osaka
|
|
||||||
JPN1;Fagiano Okayama;34034;Fagiano Okayama;fagiano-okayama
|
|
||||||
JPN1;Gamba Osaka;3138;Gamba Osaka;gamba-osaka
|
|
||||||
JPN1;JEF United;3144;JEF United Chiba;jef-united-chiba
|
|
||||||
JPN1;Kashima Antlers;3134;Kashima Antlers;kashima-antlers
|
|
||||||
JPN1;Kashiwa Reysol;3140;Kashiwa Reysol;kashiwa-reysol
|
|
||||||
JPN1;Kawasaki Frontale;5127;Kawasaki Frontale;kawasaki-frontale
|
|
||||||
JPN1;Kyoto Sanga;3149;Kyoto Sanga FC;kyoto-sanga-fc
|
|
||||||
JPN1;Machida Zelvia;44409;Machida Zelvia;machida-zelvia
|
|
||||||
JPN1;Mito Hollyhock;21901;Mito Hollyhock;mito-hollyhock
|
|
||||||
JPN1;Nagoya Grampus;3136;Nagoya Grampus Eight;nagoya-grampus-eight
|
|
||||||
JPN1;Sanfrecce Hiroshima;3135;Sanfrecce Hiroshima;sanfrecce-hiroshima
|
|
||||||
JPN1;Shimizu S Pulse;3133;Shimizu S-Pulse;shimizu-s-pulse
|
|
||||||
JPN1;Tokyo FC;3147;FC Tokyo;fc-tokyo
|
|
||||||
JPN1;Tokyo Verdy;3139;Tokyo Verdy;tokyo-verdy
|
|
||||||
JPN1;Urawa Reds;3145;Urawa Red Diamonds;urawa-red-diamonds
|
|
||||||
JPN1;Varen Nagasaki;38154;V-Varen Nagasaki;v-varen-nagasaki
|
|
||||||
JPN1;Vissel Kobe;3146;Vissel Kobe;vissel-kobe
|
|
||||||
JPN1;Yokohama F. Marinos;3137;Yokohama F. Marinos;yokohama-f-marinos
|
|
||||||
MEX1;Atlante;1943;Atlante FC;atlante-fc
|
|
||||||
MEX1;Atlas;1949;Atlas;atlas
|
|
||||||
MEX1;Atletico San Luis;1950;Atletico de San Luis;atletico-de-san-luis
|
|
||||||
MEX1;Club America;1939;Club America;club-america
|
|
||||||
MEX1;Club Guadalajara;1938;CD Guadalajara;cd-guadalajara
|
|
||||||
MEX1;Club Necaxa;1944;Club Necaxa;club-necaxa
|
|
||||||
MEX1;Cruz Azul;1947;Cruz Azul;cruz-azul
|
|
||||||
MEX1;Juarez;201624;Juarez FC;juarez-fc
|
|
||||||
MEX1;Leon;36534;Club León;club-leon
|
|
||||||
MEX1;Monterrey;1932;Monterrey;monterrey
|
|
||||||
MEX1;Pachuca;1936;Pachuca;pachuca
|
|
||||||
MEX1;Puebla;1941;Puebla;puebla
|
|
||||||
MEX1;Pumas UNAM;1933;Pumas UNAM;pumas-unam
|
|
||||||
MEX1;Queretaro;1951;Queretaro;queretaro
|
|
||||||
MEX1;Santos Laguna;1948;Santos Laguna;santos-laguna
|
|
||||||
MEX1;Tigres UANL;1940;Tigres UANL;tigres-uanl
|
|
||||||
MEX1;Tijuana;36525;Club Tijuana;club-tijuana
|
|
||||||
MEX1;Toluca;1931;Toluca;toluca
|
|
||||||
NED1;Ajax;2953;Ajax;ajax
|
|
||||||
NED1;AZ Alkmaar;2950;AZ Alkmaar;az-alkmaar
|
|
||||||
NED1;Cambuur;2970;SC Cambuur;sc-cambuur
|
|
||||||
NED1;Den Haag;2966;ADO Den Haag;ado-den-haag
|
|
||||||
NED1;Excelsior;2967;Excelsior;excelsior
|
|
||||||
NED1;Feyenoord;2959;Feyenoord;feyenoord
|
|
||||||
NED1;Fortuna Sittard;2957;Fortuna Sittard;fortuna-sittard
|
|
||||||
NED1;Go Ahead Eagles;2979;Go Ahead Eagles;go-ahead-eagles
|
|
||||||
NED1;Groningen;2951;Groningen;groningen
|
|
||||||
NED1;Heerenveen;2964;Heerenveen;heerenveen
|
|
||||||
NED1;NEC Nijmegen;2962;NEC Nijmegen;nec-nijmegen
|
|
||||||
NED1;PSV;2952;PSV Eindhoven;psv-eindhoven
|
|
||||||
NED1;Sparta Rotterdam;2960;Sparta Rotterdam;sparta-rotterdam
|
|
||||||
NED1;Telstar;2972;SC Telstar;sc-telstar
|
|
||||||
NED1;Twente;2955;FC Twente;fc-twente
|
|
||||||
NED1;Utrecht;2948;FC Utrecht;fc-utrecht
|
|
||||||
NED1;Willem II;2961;Willem II Tilburg;willem-ii-tilburg
|
|
||||||
NED1;Zwolle;2971;PEC Zwolle;pec-zwolle
|
|
||||||
NED2;Almere;2990;Almere City FC;almere-city-fc
|
|
||||||
NED2;De Graafschap;2949;De Graafschap;de-graafschap
|
|
||||||
NED2;Den Bosch;2963;FC Den Bosch;fc-den-bosch
|
|
||||||
NED2;Dordrecht;2973;FC Dordrecht;fc-dordrecht
|
|
||||||
NED2;Eindhoven;2994;FC Eindhoven;fc-eindhoven
|
|
||||||
NED2;Emmen;2965;FC Emmen;fc-emmen
|
|
||||||
NED2;Helmond;2974;Helmond Sport;helmond-sport
|
|
||||||
NED2;Heracles;2977;Heracles Almelo;heracles-almelo
|
|
||||||
NED2;Jong Ajax;46160;Jong Ajax;jong-ajax
|
|
||||||
NED2;Jong AZ;46161;Jong AZ Alkmaar;jong-az-alkmaar
|
|
||||||
NED2;Jong PSV;46168;Jong PSV Eindhoven;jong-psv-eindhoven
|
|
||||||
NED2;Jong Utrecht;53067;Jong FC Utrecht;jong-fc-utrecht
|
|
||||||
NED2;MVV Maastricht;2976;MVV Maastricht;mvv-maastricht
|
|
||||||
NED2;NAC Breda;2947;NAC Breda;nac-breda
|
|
||||||
NED2;Oss;2978;TOP Oss;top-oss
|
|
||||||
NED2;RKC Waalwijk;2956;RKC Waalwijk;rkc-waalwijk
|
|
||||||
NED2;Roda;2954;Roda JC Kerkrade;roda-jc-kerkrade
|
|
||||||
NED2;Vitesse;2958;Vitesse;vitesse
|
|
||||||
NED2;Volendam;2968;Volendam;volendam
|
|
||||||
NED2;VVV Venlo;2980;VVV-Venlo;vvv-venlo
|
|
||||||
NOR1;Aalesund;677;Aalesunds FK;aalesunds-fk
|
|
||||||
NOR1;Bodo/Glimt;656;Bodø/Glimt;bodoglimt
|
|
||||||
NOR1;Brann;1159;SK Brann;sk-brann
|
|
||||||
NOR1;Fredrikstad;687;Fredrikstad FK;fredrikstad-fk
|
|
||||||
NOR1;Ham Kam;666;HamKam;hamkam
|
|
||||||
NOR1;KFUM Oslo;786;KFUM Oslo;kfum-oslo
|
|
||||||
NOR1;Kristiansund;957;Kristiansund BK;kristiansund-bk
|
|
||||||
NOR1;Lillestrom;664;Lillestrøm SK;lillestrom-sk
|
|
||||||
NOR1;Molde;661;Molde FK;molde-fk
|
|
||||||
NOR1;Rosenborg;1161;Rosenborg BK;rosenborg-bk
|
|
||||||
NOR1;Sandefjord;676;Sandefjord Fotball;sandefjord-fotball
|
|
||||||
NOR1;Sarpsborg;822;Sarpsborg 08;sarpsborg-08
|
|
||||||
NOR1;Start;667;IK Start;ik-start
|
|
||||||
NOR1;Tromso;660;Tromsø IL;tromso-il
|
|
||||||
NOR1;Valerenga;1165;Valerenga IF;valerenga-if
|
|
||||||
NOR1;Viking;1164;Viking FK;viking-fk
|
|
||||||
PAR1;Cerro Porteno;5991;Cerro Porteño;cerro-porteno
|
|
||||||
PAR1;Libertad Asuncion;5996;Libertad;libertad
|
|
||||||
PAR1;Olimpia Asuncion;5997;Olimpia;olimpia
|
|
||||||
PAR1;Recoleta;292595;Recoleta FC;deportivo-recoleta
|
|
||||||
PER1;AD Tarma;335557;Asociación Deportiva Tarma;asociacion-deportiva-tarma
|
|
||||||
PER1;Alianza Atletico;2307;Alianza Atlético de Sullana;alianza-atletico-de-sullana
|
|
||||||
PER1;Alianza Lima;2311;Alianza Lima;alianza-lima
|
|
||||||
PER1;Atletico Grau;282538;Club Atlético Grau;club-atletico-grau
|
|
||||||
PER1;Cienciano;2301;Cienciano;cienciano
|
|
||||||
PER1;Comerciantes Unidos;213609;Comerciantes Unidos;comerciantes-unidos
|
|
||||||
PER1;Cusco FC;63760;Cusco FC;cusco-fc
|
|
||||||
PER1;Deportivo Garcilaso;458584;Deportivo Garcilaso;deportivo-garcilaso
|
|
||||||
PER1;FC Cajamarca;1082002;FC Cajamarca;fc-cajamarca
|
|
||||||
PER1;Juan Pablo II;511206;ADC Juan Pablo II;adc-juan-pablo-ii
|
|
||||||
PER1;Los Chankas;252254;Los Chankas CYC;los-chankas-cyc
|
|
||||||
PER1;Melgar;2308;Melgar;melgar
|
|
||||||
PER1;Moquegua;492848;CD Moquegua;ucv-de-moquegua
|
|
||||||
PER1;Sport Boys;2312;Sport Boys;sport-boys
|
|
||||||
PER1;Sport Huancayo;33895;Sport Huancayo;sport-huancayo
|
|
||||||
PER1;Sporting Cristal;2302;Club Sporting Cristal;club-sporting-cristal
|
|
||||||
PER1;Universitario de Deportes;2305;Universitario;universitario
|
|
||||||
PER1;UTC Cajamarca;87854;Universidad Técnica de Cajamarca;universidad-tecnica-de-cajamarca
|
|
||||||
POL1;Cracovia Krakow;4901;KS Cracovia;ks-cracovia-krakow
|
|
||||||
POL1;GKS Katowice;3112;GKS Katowice;gks-katowice
|
|
||||||
POL1;Gornik Zabrze;3110;Górnik Zabrze;gornik-zabrze
|
|
||||||
POL1;Jagiellonia Bialystok;7691;Jagiellonia Białystok;jagiellonia-bialystok
|
|
||||||
POL1;Korona Kielce;5065;MKS Korona Kielce;mks-korona-kielce
|
|
||||||
POL1;Lech Poznan;3121;Lech Poznań;lech-poznan
|
|
||||||
POL1;Legia Warszawa;3106;Legia Warszawa;legia-warszawa
|
|
||||||
POL1;Motor Lublin;7915;Motor Lublin;motor-lublin
|
|
||||||
POL1;Piast Gliwice;7918;Piast Gliwice;piast-gliwice
|
|
||||||
POL1;Pogon Szczecin;3117;Pogoń Szczecin;pogon-szczecin
|
|
||||||
POL1;Radomiak Radom;7295;RKS Radomiak Radom;rks-radomiak-radom
|
|
||||||
POL1;Rakow Czestochowa;35268;Raków Częstochowa;rakow-czestochowa
|
|
||||||
POL1;Slask Wroclaw;3108;Śląsk Wrocław;slask-wroclaw
|
|
||||||
POL1;Widzew Lodz;3115;Widzew Łódź;widzew-lodz
|
|
||||||
POL1;Wieczysta Krakow;334956;Wieczysta Kraków;wieczysta-krakow
|
|
||||||
POL1;Wisla Krakow;3111;Wisła Kraków;wisla-krakow
|
|
||||||
POL1;Wisla Plock;3122;Wisła Płock;wisla-plock
|
|
||||||
POL1;Zaglebie Lubin;3113;Zagłębie Lubin;zaglebie-lubin
|
|
||||||
POR1;Academico Viseu;3022;Academico Viseu;academico-viseu
|
|
||||||
POR1;Alverca;190328;FC Alverca;fc-alverca
|
|
||||||
POR1;Arouca;25777;Arouca;arouca
|
|
||||||
POR1;Benfica;3006;SL Benfica;sl-benfica
|
|
||||||
POR1;Casa Pia;36365;Casa Pia;casa-pia
|
|
||||||
POR1;Estoril;4500;Estoril Praia;estoril-praia
|
|
||||||
POR1;Estrela;3035;CF Estrela da Amadora;cf-estrela-da-amadora
|
|
||||||
POR1;Famalicao;49531;FC Famalicao;fc-famalicao
|
|
||||||
POR1;Gil Vicente;3010;Gil Vicente FC;gil-vicente-fc
|
|
||||||
POR1;Maritimo;3007;Marítimo;maritimo
|
|
||||||
POR1;Moreirense;3014;Moreirense;moreirense
|
|
||||||
POR1;Nacional Madeira;3013;CD Nacional;cd-nacional
|
|
||||||
POR1;Porto;3002;FC Porto;fc-porto
|
|
||||||
POR1;Rio Ave;3036;Rio Ave;rio-ave
|
|
||||||
POR1;Santa Clara;3011;CD Santa Clara;cd-santa-clara
|
|
||||||
POR1;Sporting Braga;2999;Sporting Braga;sporting-braga
|
|
||||||
POR1;Sporting CP;3001;Sporting CP;sporting-cp
|
|
||||||
POR1;Vitoria Guimaraes;3009;Vitória de Guimaraes;vitoria-de-guimaraes
|
|
||||||
POR2;Academica Coimbra;3015;Academica Coimbra;academica-coimbra
|
|
||||||
POR2;Amarante;207139;Amarante FC;amarante-fc
|
|
||||||
POR2;Avs;483088;AVS - Futebol SAD;avs-futebol-sad
|
|
||||||
POR2;Benfica II;74465;SL Benfica B;sl-benfica-b
|
|
||||||
POR2;Chaves;3025;GD Chaves;gd-chaves
|
|
||||||
POR2;Farense;2998;SC Farense;sc-farense
|
|
||||||
POR2;Feirense;4501;Feirense;feirense
|
|
||||||
POR2;Felgueiras;3030;Felgueiras;felgueiras
|
|
||||||
POR2;Leixoes;3018;Leixões SC;leixoes-sc
|
|
||||||
POR2;Lusitania de Lourosa;35174;Lusitânia Lourosa;lusitania-lourosa
|
|
||||||
POR2;Penafiel;3017;Penafiel;penafiel
|
|
||||||
POR2;Portimonense;3026;Portimonense;portimonense
|
|
||||||
POR2;Porto II;74469;FC Porto B;fc-porto-b
|
|
||||||
POR2;Sporting CP II;74467;Sporting CP B;sporting-cp-b
|
|
||||||
POR2;Tondela;38396;Tondela;tondela
|
|
||||||
POR2;Torreense;25787;Torreense;torreense
|
|
||||||
POR2;Uniao Leiria;3000;União Leiria;uniao-leiria
|
|
||||||
POR2;Vizela;5136;FC Vizela;fc-vizela
|
|
||||||
ROU1;Arges Pitesti;116221;FC Argeş Piteşti;fc-arges-pitesti
|
|
||||||
ROU1;Botosani;24798;FC Botoșani;fc-botosani
|
|
||||||
ROU1;CFR Cluj;5287;CFR Cluj;cfr-cluj
|
|
||||||
ROU1;Corvinul Hunedoara;148278;FC Corvinul Hunedoara;fc-corvinul-hunedoara
|
|
||||||
ROU1;Dinamo Bucuresti;3292;Dinamo București;dinamo-bucuresti
|
|
||||||
ROU1;Farul Constanta;3294;Farul Constanța;farul-constanta
|
|
||||||
ROU1;Miercurea Ciuc;283972;FK Csíkszereda Miercurea Ciuc;fk-csikszereda-miercurea-ciuc
|
|
||||||
ROU1;Otelul Galati;3291;SC Oțelul Galați;sc-otelul-galati
|
|
||||||
ROU1;Petrolul Ploiesti;25856;FC Petrolul Ploieşti;fc-petrolul-ploiesti
|
|
||||||
ROU1;Rapid Bucuresti;295403;FC Rapid București;fc-rapid-bucuresti
|
|
||||||
ROU1;Sepsi Sfantu Gheorghe;189789;Sepsi OSK;sepsi-osk
|
|
||||||
ROU1;Steaua Bucuresti;3301;FCSB;fcsb
|
|
||||||
ROU1;Universitatea Cluj;7734;FC Universitatea Cluj;fc-universitatea-cluj
|
|
||||||
ROU1;Universitatea Craiova;116223;Universitatea Craiova;universitatea-craiova
|
|
||||||
ROU1;UTA Arad;204657;UTA Arad;uta-arad
|
|
||||||
ROU1;Voluntari;44255;FC Voluntari;fc-voluntari
|
|
||||||
RUS1;Akhmat Grozny;5131;Akhmat Grozny;akhmat-grozny
|
|
||||||
RUS1;Akron;285689;Akron Togliatti;akron-togliatti
|
|
||||||
RUS1;Baltika;7517;Baltika Kaliningrad;baltika-kaliningrad
|
|
||||||
RUS1;CSKA Moskva;2325;CSKA Moscow;cska-moscow
|
|
||||||
RUS1;Dinamo Moskva;2315;Dynamo Moscow;dynamo-moscow
|
|
||||||
RUS1;Dynamo Makhachkala;362016;Dinamo Makhachkala;dinamo-makhachkala
|
|
||||||
RUS1;Fakel;2317;Fakel Voronezh;fakel-voronezh
|
|
||||||
RUS1;Gazovik Orenburg;24118;Orenburg;orenburg
|
|
||||||
RUS1;Krasnodar;34425;FC Krasnodar;fc-krasnodar
|
|
||||||
RUS1;Krylya Sovetov;2322;Krylya Sovetov Samara;krylya-sovetov-samara
|
|
||||||
RUS1;Lokomotiv Moskva;2320;Lokomotiv Moscow;lokomotiv-moscow
|
|
||||||
RUS1;Rodina Moskva;322699;Rodina Moscow;rodina-moscow
|
|
||||||
RUS1;Rostov;2326;FC Rostov;fc-rostov
|
|
||||||
RUS1;Rubin Kazan;2333;Rubin Kazan;rubin-kazan
|
|
||||||
RUS1;Spartak Moskva;2323;Spartak Moscow;spartak-moscow
|
|
||||||
RUS1;Zenit Sankt Peterburg;2321;Zenit St. Petersburg;zenit-st-petersburg
|
|
||||||
KSA1;Abha;168090;Abha;abha
|
|
||||||
KSA1;Al Ahli Jeddah;34469;Al-Ahli Saudi;al-ahli-saudi
|
|
||||||
KSA1;Al Diriyah;853574;Al Diriyah;al-diraiyah
|
|
||||||
KSA1;Al Faisaly;56035;Al Faisaly;al-faisaly
|
|
||||||
KSA1;Al Fateh;56023;Al-Fateh;al-fateh
|
|
||||||
KSA1;Al Feiha;168094;Al-Fayha;al-fayha
|
|
||||||
KSA1;Al Hazm;168086;Al Hazem;al-hazem
|
|
||||||
KSA1;Al Hilal;21895;Al-Hilal Saudi;al-hilal-saudi
|
|
||||||
KSA1;Al Ittifaq;34318;Al-Ettifaq;al-ettifaq
|
|
||||||
KSA1;Al Ittihad;34315;Al-Ittihad;al-ittihad
|
|
||||||
KSA1;Al Khaleej;167228;Al-Khaleej;al-khaleej
|
|
||||||
KSA1;Al Kholood;269199;Al Kholood;al-kholood
|
|
||||||
KSA1;Al Nassr;23400;Al-Nassr;al-nassr
|
|
||||||
KSA1;Al Qadsiah;56027;Al-Qadisiyah;al-qadisiyah
|
|
||||||
KSA1;Al Riyadh;168088;Al Riyadh;al-riyadh
|
|
||||||
KSA1;Al Shabab;34313;Al-Shabab;al-shabab
|
|
||||||
KSA1;Al Taawon;56021;Al-Taawoun;al-taawoun
|
|
||||||
KSA1;Neom;530631;Neom SC;neom-sc
|
|
||||||
SCO1;Aberdeen;2355;Aberdeen;aberdeen
|
|
||||||
SCO1;Celtic;2352;Celtic;celtic
|
|
||||||
SCO1;Dundee;2357;Dundee FC;dundee-fc
|
|
||||||
SCO1;Dundee United;2349;Dundee United;dundee-united
|
|
||||||
SCO1;Falkirk;2363;Falkirk FC;falkirk-fc
|
|
||||||
SCO1;Heart of Midlothian;2353;Heart of Midlothian;heart-of-midlothian
|
|
||||||
SCO1;Hibernian;2354;Hibernian;hibernian
|
|
||||||
SCO1;Kilmarnock;2347;Kilmarnock;kilmarnock
|
|
||||||
SCO1;Motherwell;2346;Motherwell;motherwell
|
|
||||||
SCO1;Rangers Glasgow;2351;Rangers;rangers
|
|
||||||
SCO1;St. Johnstone;2348;St. Johnstone;st-johnstone
|
|
||||||
SCO1;St. Mirren;2359;St. Mirren;st-mirren
|
|
||||||
SRB1;Crvena Zvezda;5149;FK Crvena zvezda;fk-crvena-zvezda
|
|
||||||
SRB1;Cukaricki;5148;FK Čukaricki;fk-cukaricki
|
|
||||||
SRB1;IMT Beograd;308176;FK IMT;fk-imt
|
|
||||||
SRB1;Macva Sabac;56019;FK Macva Šabac;fk-macva-sabac
|
|
||||||
SRB1;Mladost Lucani;7771;FK Mladost Lucani;fk-mladost-lucani
|
|
||||||
SRB1;Novi Pazar;25736;FK Novi Pazar;fk-novi-pazar
|
|
||||||
SRB1;OFK Beograd;5153;OFK Beograd;ofk-beograd
|
|
||||||
SRB1;Partizan Beograd;5152;FK Partizan;fk-partizan
|
|
||||||
SRB1;Radnicki Kragujevac;43981;FK Radnicki 1923;fk-radnicki-1923
|
|
||||||
SRB1;Radnicki Nis;25737;FK Radnicki Niš;fk-radnicki-nis
|
|
||||||
SRB1;Radnik Surdulica;111127;FK Radnik Surdulica;fk-radnik-surdulica
|
|
||||||
SRB1;Vojvodina;5150;FK Vojvodina;fk-vojvodina
|
|
||||||
SRB1;Zeleznicar Pancevo;282203;FK Železničar Pančevo;fk-zeleznicar-pancevo
|
|
||||||
SRB1;Zemun;5157;FK Zemun;fk-zemun
|
|
||||||
SVK1;Dukla Banska Bystrica;4503;Dukla Banska Bystrica;dukla-banska-bystrica
|
|
||||||
SVK1;Dunajska Streda;23833;DAC Dunajska Streda;dac-dunajska-streda
|
|
||||||
SVK1;Komarno;189813;KFC Komárno;kfc-komarno
|
|
||||||
SVK1;Kosice;168476;FC Košice;fc-kosice
|
|
||||||
SVK1;Podbrezova;7887;FK Železiarne Podbrezova;fk-zeleziarne-podbrezova
|
|
||||||
SVK1;Ruzomberok;2397;MFK Ružomberok;mfk-ruzomberok
|
|
||||||
SVK1;Skalica;111061;MFK Skalica;mfk-skalica
|
|
||||||
SVK1;Slovan Bratislava;2404;Slovan Bratislava;slovan-bratislava
|
|
||||||
SVK1;Spartak Trnava;2406;Spartak Trnava;spartak-trnava
|
|
||||||
SVK1;Trencin;2398;AS Trencín;as-trencin
|
|
||||||
SVK1;Zemplin Michalovce;7885;MFK Zemplín Michalovce;mfk-zemplin-michalovce
|
|
||||||
SVK1;Zilina;2402;MŠK Žilina;msk-zilina
|
|
||||||
SVN1;Aluminij;2424;NK Aluminij Kidricevo;nk-aluminij-kidricevo
|
|
||||||
SVN1;Bravo Publikum;261800;AŠK Bravo;ask-bravo
|
|
||||||
SVN1;Brinje Grosuplje;274937;Brinje Grosuplje;brinje-grosuplje
|
|
||||||
SVN1;Celje;2413;NK Celje;nk-celje
|
|
||||||
SVN1;Koper;2417;FC Luka Koper;fc-luka-koper
|
|
||||||
SVN1;Maribor;2420;NK Maribor;nk-maribor
|
|
||||||
SVN1;Mura;213357;NŠ Mura;ns-mura
|
|
||||||
SVN1;Nafta;2430;NK Nafta Lendava 1903;nk-nafta-lendava-1903
|
|
||||||
SVN1;Olimpija Ljubljana;2416;NK Olimpija Ljubljana;nk-olimpija-ljubljana
|
|
||||||
SVN1;Radomlje;37737;Kalcer Radomlje;kalcer-radomlje
|
|
||||||
KOR1;Anyang;32675;FC Anyang;fc-anyang
|
|
||||||
KOR1;Bucheon;92539;Bucheon FC 1995;bucheon-fc-1995
|
|
||||||
KOR1;Daejeon Citizen;7645;Daejeon Hana Citizen;daejeon-hana-citizen
|
|
||||||
KOR1;Gangwon;34220;Gangwon FC;gangwon-fc
|
|
||||||
KOR1;Gwangju;48912;Gwangju FC;gwangju-fc
|
|
||||||
KOR1;Incheon;7648;Incheon United;incheon-united
|
|
||||||
KOR1;Jeju;7649;Jeju United;jeju-united
|
|
||||||
KOR1;Jeonbuk Motors;6908;Jeonbuk Hyundai Motors;jeonbuk-hyundai-motors
|
|
||||||
KOR1;Pohang Steelers;7650;Pohang Steelers;pohang-steelers
|
|
||||||
KOR1;Sangju Sangmu;7647;Sangju Sangmu;sangju-sangmu
|
|
||||||
KOR1;Seoul;7646;FC Seoul;fc-seoul
|
|
||||||
KOR1;Ulsan;7653;Ulsan Hyundai;ulsan-hyundai
|
|
||||||
ESP1;Alaves;2885;Deportivo Alaves;deportivo-alaves
|
|
||||||
ESP1;Athletic Bilbao;2825;Athletic Bilbao;athletic-bilbao
|
|
||||||
ESP1;Atletico Madrid;2836;Atletico Madrid;atletico-madrid
|
|
||||||
ESP1;Barcelona;2817;Barcelona;barcelona
|
|
||||||
ESP1;Betis;2816;Real Betis;real-betis
|
|
||||||
ESP1;Celta Vigo;2821;Celta Vigo;celta-vigo
|
|
||||||
ESP1;Deportivo La Coruna;2832;Deportivo La Coruña;deportivo-la-coruna
|
|
||||||
ESP1;Elche;2846;Elche CF;elche-cf
|
|
||||||
ESP1;Espanyol;2814;Espanyol;espanyol
|
|
||||||
ESP1;Getafe;2859;Getafe;getafe
|
|
||||||
ESP1;Levante;2849;Levante;levante
|
|
||||||
ESP1;Malaga;2830;Malaga;malaga
|
|
||||||
ESP1;Osasuna;2820;Osasuna;osasuna
|
|
||||||
ESP1;Racing Santander;2835;Racing de Santander;racing-de-santander
|
|
||||||
ESP1;Rayo Vallecano;2818;Rayo Vallecano;rayo-vallecano
|
|
||||||
ESP1;Real Madrid;2829;Real Madrid;real-madrid
|
|
||||||
ESP1;Real Sociedad;2824;Real Sociedad;real-sociedad
|
|
||||||
ESP1;Sevilla;2833;Sevilla;sevilla
|
|
||||||
ESP1;Valencia;2828;Valencia;valencia
|
|
||||||
ESP1;Villarreal;2819;Villarreal;villarreal
|
|
||||||
ESP2;Albacete;2848;Albacete Balompie;albacete-balompie
|
|
||||||
ESP2;Almeria;2858;Almería;almeria
|
|
||||||
ESP2;Andorra CF;324871;FC Andorra;fc-andorra
|
|
||||||
ESP2;Burgos;2854;Burgos;burgos
|
|
||||||
ESP2;Cadiz;4488;Cadiz;cadiz
|
|
||||||
ESP2;Castellon;5067;CD Castellón;cd-castellon
|
|
||||||
ESP2;Celta Vigo II;24336;Celta Fortuna;celta-vigo-b
|
|
||||||
ESP2;Ceuta;2869;AD Ceuta;ad-ceuta
|
|
||||||
ESP2;Cordoba;2850;Córdoba;cordoba
|
|
||||||
ESP2;Eibar;2839;Eibar;eibar
|
|
||||||
ESP2;Eldense;47321;CD Eldense;cd-eldense
|
|
||||||
ESP2;Gijon;2852;Sporting Gijón;sporting-gijon
|
|
||||||
ESP2;Girona;24264;Girona;girona
|
|
||||||
ESP2;Granada;33779;Granada;granada
|
|
||||||
ESP2;Las Palmas;6577;Las Palmas;las-palmas
|
|
||||||
ESP2;Leganes;2845;Leganes;leganes
|
|
||||||
ESP2;Mallorca;2826;RCD Mallorca;rcd-mallorca
|
|
||||||
ESP2;Oviedo;2851;Real Oviedo;real-oviedo
|
|
||||||
ESP2;Real Sociedad II;24360;Real Sociedad B;real-sociedad-b
|
|
||||||
ESP2;Sabadell;24335;CE Sabadell;ce-sabadell
|
|
||||||
ESP2;Tenerife;2822;Tenerife;tenerife
|
|
||||||
ESP2;Valladolid;2831;Real Valladolid;real-valladolid
|
|
||||||
SWE1;AIK;1764;AIK;aik
|
|
||||||
SWE1;Brommapojkarna;1787;IF Brommapojkarna;if-brommapojkarna
|
|
||||||
SWE1;Degerfors;1807;Degerfors IF;degerfors-if
|
|
||||||
SWE1;Djurgarden;1759;Djurgardens IF;djurgardens-if
|
|
||||||
SWE1;Elfsborg;1762;IF Elfsborg;if-elfsborg
|
|
||||||
SWE1;GAIS;1786;GAIS Göteborg;gais-goteborg
|
|
||||||
SWE1;Goteborg;1761;IFK Göteborg;ifk-goteborg
|
|
||||||
SWE1;Hacken;1760;BK Hacken;bk-hacken
|
|
||||||
SWE1;Halmstad;1767;Halmstads BK;halmstads-bk
|
|
||||||
SWE1;Hammarby;1758;Hammarby IF;hammarby-if
|
|
||||||
SWE1;Kalmar;1891;Kalmar FF;kalmar-ff
|
|
||||||
SWE1;Malmo;1892;Malmö FF;malmo-ff
|
|
||||||
SWE1;Mjallby;1783;Mjallby AIF;mjallby-aif
|
|
||||||
SWE1;Orgryte;1766;Örgryte IS;orgryte-is
|
|
||||||
SWE1;Sirius;1793;IK Sirius;ik-sirius
|
|
||||||
SWE1;Vasteras;1775;Västerås SK;vasteras-sk
|
|
||||||
SUI1;Basel;2501;FC Basel;fc-basel
|
|
||||||
SUI1;Grasshopper;2449;Grasshopper Club Zürich;grasshopper-club-zurich
|
|
||||||
SUI1;Lausanne;2446;FC Lausanne-Sport;fc-lausanne-sport
|
|
||||||
SUI1;Lugano;2443;FC Lugano;fc-lugano
|
|
||||||
SUI1;Luzern;2453;FC Luzern;fc-luzern
|
|
||||||
SUI1;Servette;2448;Servette;servette
|
|
||||||
SUI1;Sion;2452;FC Sion;fc-sion
|
|
||||||
SUI1;St. Gallen;2442;FC St. Gallen 1879;fc-st-gallen-1879
|
|
||||||
SUI1;Thun;2454;FC Thun;fc-thun
|
|
||||||
SUI1;Vaduz;2463;FC Vaduz;fc-vaduz
|
|
||||||
SUI1;Young Boys;2445;Young Boys;young-boys
|
|
||||||
SUI1;Zurich;2450;FC Zürich;fc-zurich
|
|
||||||
TUR1;Alanyaspor;6362;Alanyaspor;alanyaspor
|
|
||||||
TUR1;Amedspor;207011;Amed Sportif Faaliyetler;amed-sportif-faaliyetler
|
|
||||||
TUR1;Basaksehir;3086;Başakşehir F.K.;medipol-basaksehir
|
|
||||||
TUR1;Besiktas;3050;Beşiktaş;besiktas
|
|
||||||
TUR1;Caykur Rizespor;3064;Çaykur Rizespor;caykur-rizespor
|
|
||||||
TUR1;Corum;77629;Çorum FK;corum-fk
|
|
||||||
TUR1;Erzurumspor;55603;BB Erzurumspor;bb-erzurumspor
|
|
||||||
TUR1;Eyupspor;7040;Eyüpspor;eyupspor
|
|
||||||
TUR1;Fenerbahce;3052;Fenerbahce;fenerbahce
|
|
||||||
TUR1;Galatasaray;3061;Galatasaray;galatasaray
|
|
||||||
TUR1;Gaziantep BB;5138;Gaziantep FK;gaziantep-fk
|
|
||||||
TUR1;Genclerbirligi;7802;Genclerbirliği;genclerbirligi
|
|
||||||
TUR1;Goztepe;3054;Göztepe;goztepe-sk
|
|
||||||
TUR1;Kasimpasa;6063;Kasımpaşa;kasimpasa
|
|
||||||
TUR1;Kocaelispor;3065;Kocaelispor;kocaelispor
|
|
||||||
TUR1;Konyaspor;3085;Konyaspor;konyaspor
|
|
||||||
TUR1;Samsunspor;3053;Samsunspor;samsunspor
|
|
||||||
TUR1;Trabzonspor;3051;Trabzonspor;trabzonspor
|
|
||||||
UKR1;Bukovyna;43336;Bukovyna Chernivtsi;bukovyna-chernivtsi
|
|
||||||
UKR1;Chornomorets;3310;Chornomorets Odesa;chornomorets-odesa
|
|
||||||
UKR1;Dynamo Kyiv;3305;Dynamo Kyiv;dynamo-kyiv
|
|
||||||
UKR1;Epitsentr;323552;FC Epicentr Dunaivtsi;fc-epicentr-dunaivtsi
|
|
||||||
UKR1;FC Kharkiv;266889;FC Kharkiv;metalist-1925
|
|
||||||
UKR1;Hirnyk Kryvbas;294048;FC Kryvbas Kryvyi Rih;fc-kryvbas-kryvyi-rih
|
|
||||||
UKR1;Karpaty;3316;Karpaty Lviv;karpaty-lviv
|
|
||||||
UKR1;Kolos Kovalivka;200776;Kolos Kovalivka;kolos-kovalivka
|
|
||||||
UKR1;Kudrivka;316055;Kudrivka;kudrivka-irpin
|
|
||||||
UKR1;Livyi Bereh;388209;FC Livyi Bereh Kyiv;fc-livyi-bereh-kyiv
|
|
||||||
UKR1;LNZ Cherkasy;284427;LNZ Cherkasy;lnz-cherkasy
|
|
||||||
UKR1;Obolon Kyiv;138564;Obolon Kyiv;obolon-kyiv
|
|
||||||
UKR1;Polissya;258536;Polissya Zhytomyr;polissya-zhytomyr
|
|
||||||
UKR1;Shakhtar Donetsk;3313;Shakhtar Donetsk;shakhtar-donetsk
|
|
||||||
UKR1;Veres Rivne;200773;Veres Rivne;veres-rivne
|
|
||||||
UKR1;Zorya;5987;Zorya Luhansk;zorya-luhansk
|
|
||||||
URU1;Boston River;174970;Boston River;boston-river
|
|
||||||
URU1;Juventud de Las Piedras;3224;Juventud de Las Piedras;juventud-de-las-piedras
|
|
||||||
URU1;Montevideo City Torque;174972;Montevideo City Torque;montevideo-city-torque
|
|
||||||
URU1;Nacional Montevideo;3230;Nacional;club-nacional-de-football
|
|
||||||
URU1;Penarol;3227;Peñarol;penarol
|
|
||||||
USA1;Atlanta United;243211;Atlanta United FC;atlanta-united
|
|
||||||
USA1;Austin FC;377973;Austin FC;austin-fc
|
|
||||||
USA1;Charlotte FC;404108;Charlotte FC;charlotte-fc
|
|
||||||
USA1;Chicago Fire;2505;Chicago Fire;chicago-fire
|
|
||||||
USA1;Cincinnati FC;215167;FC Cincinnati;fc-cincinnati
|
|
||||||
USA1;Colorado Rapids;2510;Colorado Rapids;colorado-rapids
|
|
||||||
USA1;Columbus Crew;2504;Columbus Crew;columbus-crew
|
|
||||||
USA1;Dallas FC;2512;FC Dallas;fc-dallas
|
|
||||||
USA1;DC United;2502;DC United;dc-united
|
|
||||||
USA1;Houston Dynamo;2508;Houston Dynamo;houston-dynamo
|
|
||||||
USA1;Inter Miami;337602;Inter Miami CF;inter-miami-cf
|
|
||||||
USA1;Los Angeles FC;274650;Los Angeles FC;los-angeles-fc
|
|
||||||
USA1;Los Angeles Galaxy;2513;LA Galaxy;la-galaxy
|
|
||||||
USA1;Minnesota United;41618;Minnesota United FC;minnesota-united
|
|
||||||
USA1;Montreal Impact;22006;Impact Montreal;impact-montreal
|
|
||||||
USA1;Nashville SC;337612;Nashville SC;nashville-sc
|
|
||||||
USA1;New England Revolution;2511;New England Revolution;new-england-revolution
|
|
||||||
USA1;New York City;187643;New York City FC;new-york-city-fc
|
|
||||||
USA1;New York RB;2506;New York Red Bulls;new-york-red-bulls
|
|
||||||
USA1;Orlando City;52237;Orlando City SC;orlando-city
|
|
||||||
USA1;Philadelphia Union;39833;Philadelphia Union;philadelphia-union
|
|
||||||
USA1;Portland Timbers;22007;Portland Timbers;portland-timbers
|
|
||||||
USA1;Real Salt Lake;5133;Real Salt Lake;real-salt-lake
|
|
||||||
USA1;San Diego;1043961;San Diego FC;san-diego-fc
|
|
||||||
USA1;San Jose Earthquakes;21825;San Jose Earthquakes;san-jose-earthquakes
|
|
||||||
USA1;Seattle Sounders;22009;Seattle Sounders;seattle-sounders
|
|
||||||
USA1;Sporting Kansas City;2509;Sporting Kansas City;sporting-kansas-city
|
|
||||||
USA1;St. Louis City;407803;Saint Louis City SC;saint-louis-city-sc
|
|
||||||
USA1;Toronto FC;7080;Toronto FC;toronto-fc
|
|
||||||
USA1;Vancouver Whitecaps;22010;Vancouver Whitecaps;vancouver-whitecaps
|
|
||||||
VEN1;Academia Puerto Cabello;230725;Academia Puerto Cabello;academia-puerto-cabello
|
|
||||||
VEN1;Carabobo;6229;Carabobo FC;carabobo
|
|
||||||
VEN1;Caracas FC;6230;Caracas F.C.;caracas-fc
|
|
||||||
VEN1;Deportivo La Guaira;36437;Deportivo La Guaira;deportivo-la-guaira
|
|
||||||
VEN1;Universidad Central;249952;Universidad Central;ucv-fc
|
|
||||||
|
Binary file not shown.
Whitespace-only changes.
@@ -1,86 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
|
||||||
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\CurlSofa;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\Sleeper;
|
|
||||||
use App\Console\Commands\Nuh;
|
|
||||||
use App\Models\SofaScoreRosa;
|
|
||||||
use App\Models\SofaScoreRosaTournament;
|
|
||||||
use App\Models\SofaScoreTournament;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
|
|
||||||
class TournamentTeams
|
|
||||||
{
|
|
||||||
public static function get()
|
|
||||||
{
|
|
||||||
$debug = Nuh::$options['d'] ?? 0;
|
|
||||||
|
|
||||||
$tournaments_counter = 0;
|
|
||||||
|
|
||||||
$teams_counter = 0;
|
|
||||||
|
|
||||||
$tournaments = SofaScoreTournament::with('sofascore_category')->where('enabled', 1)->get();
|
|
||||||
|
|
||||||
SofaScoreRosa::query()->update(['grapped' => 0]);
|
|
||||||
SofaScoreRosaTournament::query()->update(['grapped' => 0]);
|
|
||||||
|
|
||||||
foreach ($tournaments as $tournament) {
|
|
||||||
|
|
||||||
$tournaments_counter++;
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note("$tournaments_counter Tournament: $tournament->name", 'bb');
|
|
||||||
}
|
|
||||||
|
|
||||||
$url = Nuh::$options['base_url'] . "api/v1/unique-tournament/$tournament->tournament_id/seasons";
|
|
||||||
|
|
||||||
Sleeper::rand(1);
|
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
|
||||||
|
|
||||||
$season_id = $data['seasons'][0]['id'];
|
|
||||||
|
|
||||||
$url = Nuh::$options['base_url'] . "api/v1/unique-tournament/$tournament->tournament_id/season/$season_id/standings/total";
|
|
||||||
|
|
||||||
Sleeper::rand();
|
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
|
||||||
|
|
||||||
if (isset($data['standings'])) {
|
|
||||||
foreach ($data['standings'][0]['rows'] as $row) {
|
|
||||||
$teams_counter++;
|
|
||||||
|
|
||||||
$ss_team_id = $row['team']['id'];
|
|
||||||
$name = $row['team']['name'];
|
|
||||||
$country_id = $tournament->sofascore_category->country_id;
|
|
||||||
|
|
||||||
SofaScoreRosa::updateOrCreate([
|
|
||||||
'sport_id' => $tournament->sport_id,
|
|
||||||
'ss_team_id' => (int) $ss_team_id,
|
|
||||||
], [
|
|
||||||
'country_id' => (int) $country_id,
|
|
||||||
'ss_team_name' => $name,
|
|
||||||
'grapped' => 1,
|
|
||||||
'disabled' => 0,
|
|
||||||
]);
|
|
||||||
SofaScoreRosaTournament::updateOrCreate([
|
|
||||||
'ss_tournament_id' => (int) $tournament->tournament_id,
|
|
||||||
'ss_team_id' => (int) $ss_team_id,
|
|
||||||
], [
|
|
||||||
'grapped' => 1,
|
|
||||||
'disabled' => 0,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SofaScoreRosa::where('grapped', 0)->update(['disabled' => 1]);
|
|
||||||
SofaScoreRosaTournament::where('grapped', 0)->update(['disabled' => 1]);
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note("summe tournaments: $tournaments_counter", 'p');
|
|
||||||
Notice::note("summe teams: $teams_counter", 'p');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
|
||||||
|
|
||||||
use App\Traits\Sofascore\GrappingSofascore;
|
|
||||||
use Illuminate\Console\Command;
|
|
||||||
|
|
||||||
class GrapperDaily extends Command
|
|
||||||
{
|
|
||||||
use GrappingSofascore;
|
|
||||||
|
|
||||||
protected $signature = 'grp:daily {--d} {--r} {--f}';
|
|
||||||
|
|
||||||
protected $description = 'grap sofascore daily';
|
|
||||||
|
|
||||||
public function handleGrapper(): void
|
|
||||||
{
|
|
||||||
$this->runGrapper();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -38,7 +38,7 @@ class GenerateAlarms
|
|||||||
foreach ($client->sport as $sport_id) {
|
foreach ($client->sport as $sport_id) {
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('Sport: ' . $sport_id, 'b');
|
Notice::note('Sport: '.$sport_id, 'b');
|
||||||
}
|
}
|
||||||
|
|
||||||
$multilines = AlarmMultilineSetting::get($sport_id);
|
$multilines = AlarmMultilineSetting::get($sport_id);
|
||||||
@@ -51,14 +51,16 @@ class GenerateAlarms
|
|||||||
|
|
||||||
$res = EventBookmaker::with('event')->where('bookmaker_id', $client_bookmaker_id)->where('sport_id', $sport_id)->get();
|
$res = EventBookmaker::with('event')->where('bookmaker_id', $client_bookmaker_id)->where('sport_id', $sport_id)->get();
|
||||||
|
|
||||||
if ($debug) {
|
// $res = EventBookmaker::with('event')->where('bookmaker_id', $client_bookmaker_id)->whereHas('event', function (Builder $query) {
|
||||||
Notice::note('Event: ' . \count($res), 'b');
|
// $query->whereNotNull('starttime')
|
||||||
}
|
// ->where('starttime', '>', now());
|
||||||
|
// })->get();
|
||||||
|
|
||||||
// $res = EventBookmaker::where('event_id', 14597944)->where('bookmaker_id', $client_bookmaker_id)->where('sport_id', $sport_id)->get();
|
// $res = EventBookmaker::where('event_id', 14597944)->where('bookmaker_id', $client_bookmaker_id)->where('sport_id', $sport_id)->get();
|
||||||
|
|
||||||
foreach ($res as $event) {
|
foreach ($res as $event) {
|
||||||
|
|
||||||
if ($event->event->starttime > now()) {
|
if ($event?->event?->starttime > now()) {
|
||||||
|
|
||||||
foreach ($multilines as $multiline_id => $multiline) {
|
foreach ($multilines as $multiline_id => $multiline) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
|
||||||
|
|
||||||
use App\Traits\UpdateHelper;
|
|
||||||
use Illuminate\Console\Command;
|
|
||||||
|
|
||||||
class Upd extends Command
|
|
||||||
{
|
|
||||||
use UpdateHelper;
|
|
||||||
|
|
||||||
protected $signature = 'update:player {--d}';
|
|
||||||
|
|
||||||
protected $description = 'update ss_player_seasons';
|
|
||||||
|
|
||||||
public function handleUpdate(int $playerCount): void
|
|
||||||
{
|
|
||||||
// Have fun running imports here
|
|
||||||
// Examples can be found in the ImportHelper trait
|
|
||||||
$this->updatePlayers($playerCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports;
|
||||||
|
|
||||||
|
use Maatwebsite\Excel\Concerns\FromArray;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||||
|
|
||||||
|
class OddsExporter implements FromArray, WithHeadings
|
||||||
|
{
|
||||||
|
protected array $data;
|
||||||
|
|
||||||
|
public function __construct(array $data)
|
||||||
|
{
|
||||||
|
$this->data = $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Übergibt die flachen Zeilendaten an Excel
|
||||||
|
public function array(): array
|
||||||
|
{
|
||||||
|
return $this->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Definiert die Kopfzeile im Excel-Sheet
|
||||||
|
public function headings(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'Match Id',
|
||||||
|
'BetsApi Id',
|
||||||
|
'Betradar Id',
|
||||||
|
'Bet365 Id',
|
||||||
|
'Starttime',
|
||||||
|
'Sport Id',
|
||||||
|
'Group Id',
|
||||||
|
'Group',
|
||||||
|
'Home Id',
|
||||||
|
'Home',
|
||||||
|
'Away Id',
|
||||||
|
'Away',
|
||||||
|
'Book Id',
|
||||||
|
'Book',
|
||||||
|
'One',
|
||||||
|
'X',
|
||||||
|
'Two',
|
||||||
|
'Book Id To',
|
||||||
|
'Book To',
|
||||||
|
'Over',
|
||||||
|
'Under',
|
||||||
|
'Total',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
-5
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreCategories;
|
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreCategories;
|
||||||
|
|
||||||
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Pages\CreateSofaScoreCategory;
|
|
||||||
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Pages\EditSofaScoreCategory;
|
|
||||||
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Pages\ListSofaScoreCategories;
|
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Pages\ListSofaScoreCategories;
|
||||||
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Schemas\SofaScoreCategoryForm;
|
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Schemas\SofaScoreCategoryForm;
|
||||||
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Tables\SofaScoreCategoriesTable;
|
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Tables\SofaScoreCategoriesTable;
|
||||||
@@ -23,11 +21,12 @@ class SofaScoreCategoryResource extends Resource
|
|||||||
protected static ?int $navigationSort = 13;
|
protected static ?int $navigationSort = 13;
|
||||||
|
|
||||||
protected static string|UnitEnum|null $navigationGroup = 'Statistiko';
|
protected static string|UnitEnum|null $navigationGroup = 'Statistiko';
|
||||||
protected static ?string $recordTitleAttribute = 'SS Countries';
|
|
||||||
|
|
||||||
protected static ?string $navigationLabel = 'SS Countries';
|
protected static ?string $recordTitleAttribute = 'Countries';
|
||||||
|
|
||||||
protected static ?string $modelLabel = 'SS Countries';
|
protected static ?string $navigationLabel = 'Countries';
|
||||||
|
|
||||||
|
protected static ?string $modelLabel = 'Countries';
|
||||||
|
|
||||||
public static function form(Schema $schema): Schema
|
public static function form(Schema $schema): Schema
|
||||||
{
|
{
|
||||||
|
|||||||
+9
-47
@@ -2,12 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreRosas\Tables;
|
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreRosas\Tables;
|
||||||
|
|
||||||
use App\Models\SofaScoreRosaTournament;
|
use Filament\Forms\Components\Toggle;
|
||||||
use App\Models\SofaScoreTournament;
|
|
||||||
use App\Models\Sport;
|
|
||||||
use Filament\Forms\Components\Select;
|
|
||||||
use Filament\Schemas\Components\Utilities\Get;
|
|
||||||
use Filament\Tables\Columns\TextColumn;
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Tables\Columns\ToggleColumn;
|
||||||
use Filament\Tables\Enums\FiltersLayout;
|
use Filament\Tables\Enums\FiltersLayout;
|
||||||
use Filament\Tables\Filters\Filter;
|
use Filament\Tables\Filters\Filter;
|
||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
@@ -20,59 +17,24 @@ class SofaScoreRosasTable
|
|||||||
return $table
|
return $table
|
||||||
->defaultPaginationPageOption(50)
|
->defaultPaginationPageOption(50)
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('ss_team_id')->label('SSId')->badge()->width('1rem')
|
TextColumn::make('ss_team_id')->label('SofaId')->badge()->width('1rem')
|
||||||
->sortable(),
|
|
||||||
TextColumn::make('sofascore_category.name')->label('Country')
|
|
||||||
->sortable(),
|
|
||||||
TextColumn::make('tournament_rosa.tournament.name')->label('Tournament')
|
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
TextColumn::make('cc'),
|
||||||
TextColumn::make('ss_team_name')->label('Name')
|
TextColumn::make('ss_team_name')->label('Name')
|
||||||
->searchable()
|
->searchable()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
TextColumn::make('updated_at')->dateTime('Y-m-d H:i:s')
|
ToggleColumn::make('is_active'),
|
||||||
->sortable()
|
|
||||||
|
|
||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
Filter::make('filters')
|
Filter::make('filters')
|
||||||
->columns(3)->columnSpan(3)
|
->columns(7)->columnSpan(7)
|
||||||
->schema([
|
->schema([
|
||||||
Select::make('sport_id')
|
Toggle::make('is_active')->label('In Statistiko')->default(1),
|
||||||
->default(1)
|
|
||||||
->selectablePlaceholder(false)
|
|
||||||
->label('Sport')
|
|
||||||
->options(Sport::where('is_active', 1)->pluck('name', 'id'))
|
|
||||||
->afterStateUpdated(function (callable $set) {
|
|
||||||
$set('ss_tournament_id', null);
|
|
||||||
})
|
|
||||||
->live(),
|
|
||||||
Select::make('ss_tournament_id')
|
|
||||||
// ->default(23)
|
|
||||||
->label('Tournament')
|
|
||||||
->selectablePlaceholder(true)
|
|
||||||
->options(function (Get $get) {
|
|
||||||
$res = SofaScoreTournament::with('sofascore_category')->where('enabled', 1)->where('sport_id', $get('sport_id'))->get();
|
|
||||||
$return = [];
|
|
||||||
foreach ($res as $value) {
|
|
||||||
$return[$value->tournament_id] = $value->sofascore_category->name . ' - ' . $value->name;
|
|
||||||
}
|
|
||||||
asort($return);
|
|
||||||
|
|
||||||
return $return;
|
|
||||||
})
|
|
||||||
->live(),
|
|
||||||
])
|
])
|
||||||
->query(function (Builder $query, array $data): Builder {
|
->query(function (Builder $query, array $data): Builder {
|
||||||
return $query->when(
|
return $query->when(
|
||||||
$data['sport_id'],
|
$data['is_active'],
|
||||||
fn(Builder $query, $sport_id) => $query->where('sport_id', $sport_id)
|
fn (Builder $query, $is_active) => $query->where('is_active', $is_active)
|
||||||
)->when(
|
|
||||||
$data['ss_tournament_id'],
|
|
||||||
function (Builder $query, $ss_tournament_id) {
|
|
||||||
$ss_team_ids = SofaScoreRosaTournament::where('ss_tournament_id', $ss_tournament_id)->pluck('ss_team_id')->toArray();
|
|
||||||
|
|
||||||
$query->whereIn('ss_team_id', $ss_team_ids);
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
], layout: FiltersLayout::AboveContent)
|
], layout: FiltersLayout::AboveContent)
|
||||||
|
|||||||
+69
@@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\RelationManagers;
|
||||||
|
|
||||||
|
// use App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\SofaScoreTournamentResource;
|
||||||
|
|
||||||
|
use App\Filament\Clusters\StaticData\StaticDataCluster;
|
||||||
|
use App\Models\SofaScoreRosa;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Tables\Columns\ToggleColumn;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
|
||||||
|
class SofaScoreTournamentsTeamRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'rosa_tournament';
|
||||||
|
|
||||||
|
// protected static ?string $relatedResource = SofaScoreTournamentResource::class;
|
||||||
|
|
||||||
|
protected static ?string $cluster = StaticDataCluster::class;
|
||||||
|
|
||||||
|
protected static ?string $title = 'Tournament Teams';
|
||||||
|
|
||||||
|
protected static ?string $navigationLabel = 'Tournament Teams';
|
||||||
|
|
||||||
|
protected static ?string $modelLabel = 'Tournament Teams';
|
||||||
|
|
||||||
|
protected static ?string $pluralModelLabel = 'Tournament Teams';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Select::make('ss_team_id')
|
||||||
|
->searchable()
|
||||||
|
->label('Team')
|
||||||
|
->options(function () {
|
||||||
|
return SofaScoreRosa::query()->orderBy('ss_team_name')->pluck('ss_team_name', 'ss_team_id');
|
||||||
|
}),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('ss_tournament_id'),
|
||||||
|
TextColumn::make('tournament.name')->badge(),
|
||||||
|
TextColumn::make('ss_team_id'),
|
||||||
|
TextColumn::make('team.ss_team_name')->color('success'),
|
||||||
|
ToggleColumn::make('disabled'),
|
||||||
|
])
|
||||||
|
->striped()
|
||||||
|
->paginated(false)
|
||||||
|
->recordActions([
|
||||||
|
DeleteAction::make()
|
||||||
|
->iconButton(),
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
CreateAction::make('Add')
|
||||||
|
->label('Add Team')
|
||||||
|
->icon('phosphor-plus'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
+14
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments;
|
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments;
|
||||||
|
|
||||||
|
use App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\Pages\EditSofaScoreTournament;
|
||||||
use App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\Pages\ListSofaScoreTournaments;
|
use App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\Pages\ListSofaScoreTournaments;
|
||||||
|
use App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\RelationManagers\SofaScoreTournamentsTeamRelationManager;
|
||||||
use App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\Schemas\SofaScoreTournamentForm;
|
use App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\Schemas\SofaScoreTournamentForm;
|
||||||
use App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\Tables\SofaScoreTournamentsTable;
|
use App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\Tables\SofaScoreTournamentsTable;
|
||||||
use App\Filament\Clusters\StaticData\StaticDataCluster;
|
use App\Filament\Clusters\StaticData\StaticDataCluster;
|
||||||
@@ -27,6 +29,9 @@ class SofaScoreTournamentResource extends Resource
|
|||||||
|
|
||||||
protected static ?int $navigationSort = 2;
|
protected static ?int $navigationSort = 2;
|
||||||
|
|
||||||
|
// Choose where you want the submenu to appear:
|
||||||
|
// SubNavigationPosition::Start (Left Sidebar) or SubNavigationPosition::Top (Horizontal Tabs)
|
||||||
|
|
||||||
public static function form(Schema $schema): Schema
|
public static function form(Schema $schema): Schema
|
||||||
{
|
{
|
||||||
return SofaScoreTournamentForm::configure($schema);
|
return SofaScoreTournamentForm::configure($schema);
|
||||||
@@ -59,6 +64,15 @@ class SofaScoreTournamentResource extends Resource
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'index' => ListSofaScoreTournaments::route('/'),
|
'index' => ListSofaScoreTournaments::route('/'),
|
||||||
|
'edit' => EditSofaScoreTournament::route('/{record}/edit'),
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
SofaScoreTournamentsTeamRelationManager::class,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+23
-122
@@ -2,12 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\Tables;
|
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\Tables;
|
||||||
|
|
||||||
use App\Models\SofaScoreCategory;
|
use Filament\Actions\EditAction;
|
||||||
use App\Models\SofaScoreTournament;
|
|
||||||
use App\Models\Sport;
|
|
||||||
use Filament\Forms\Components\Select;
|
|
||||||
use Filament\Forms\Components\Toggle;
|
use Filament\Forms\Components\Toggle;
|
||||||
use Filament\Schemas\Components\Utilities\Get;
|
|
||||||
use Filament\Support\Enums\IconSize;
|
use Filament\Support\Enums\IconSize;
|
||||||
use Filament\Tables\Columns\IconColumn;
|
use Filament\Tables\Columns\IconColumn;
|
||||||
use Filament\Tables\Columns\TextColumn;
|
use Filament\Tables\Columns\TextColumn;
|
||||||
@@ -16,7 +12,6 @@ use Filament\Tables\Enums\FiltersLayout;
|
|||||||
use Filament\Tables\Filters\Filter;
|
use Filament\Tables\Filters\Filter;
|
||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
// use Illuminate\Database\Eloquent\Collection;
|
|
||||||
|
|
||||||
class SofaScoreTournamentsTable
|
class SofaScoreTournamentsTable
|
||||||
{
|
{
|
||||||
@@ -28,10 +23,10 @@ class SofaScoreTournamentsTable
|
|||||||
->label('')
|
->label('')
|
||||||
->grow(false)
|
->grow(false)
|
||||||
->width(30)
|
->width(30)
|
||||||
->color(fn($record) => $record->sport->color)
|
->color(fn ($record) => $record->sport->color)
|
||||||
->icon(fn($record) => $record->sport->icon)
|
->icon(fn ($record) => $record->sport->icon)
|
||||||
->size(IconSize::Medium)
|
->size(IconSize::Medium)
|
||||||
->tooltip(fn($record) => $record->id)
|
->tooltip(fn ($record) => $record->id)
|
||||||
->visibleFrom('lg'),
|
->visibleFrom('lg'),
|
||||||
TextColumn::make('sport.name')
|
TextColumn::make('sport.name')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
@@ -41,9 +36,20 @@ class SofaScoreTournamentsTable
|
|||||||
->searchable(),
|
->searchable(),
|
||||||
TextColumn::make('sofascore_category.name')
|
TextColumn::make('sofascore_category.name')
|
||||||
->label('Country')
|
->label('Country')
|
||||||
->icon(fn($record) => $record->sofascore_category->flag)
|
->searchable()
|
||||||
|
->icon(fn ($record) => $record->sofascore_category->flag)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
TextColumn::make('name')->searchable()->sortable(),
|
// TextInputColumn::make('ss_liga_code')
|
||||||
|
// ->label('SofaScore Liga Code')
|
||||||
|
// ->searchable()
|
||||||
|
// ->sortable(),
|
||||||
|
TextColumn::make('name')
|
||||||
|
->searchable()
|
||||||
|
->sortable(),
|
||||||
|
// ToggleColumn::make('major')
|
||||||
|
// ->tooltip('Grapping Rose')
|
||||||
|
// ->alignCenter()
|
||||||
|
// ->sortable(),
|
||||||
ToggleColumn::make('enabled')
|
ToggleColumn::make('enabled')
|
||||||
->label('In Statistiko')
|
->label('In Statistiko')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
@@ -53,124 +59,19 @@ class SofaScoreTournamentsTable
|
|||||||
Filter::make('filters')
|
Filter::make('filters')
|
||||||
->columns(7)->columnSpan(7)
|
->columns(7)->columnSpan(7)
|
||||||
->schema([
|
->schema([
|
||||||
Select::make('sport_id')
|
|
||||||
->default(1)
|
|
||||||
->selectablePlaceholder(false)
|
|
||||||
->label('Sport')
|
|
||||||
->options(Sport::where('is_active', 1)->pluck('name', 'id'))
|
|
||||||
->afterStateUpdated(function (callable $set) {
|
|
||||||
$set('sofa_score_category_id', null);
|
|
||||||
})
|
|
||||||
->live(),
|
|
||||||
Select::make('sofa_score_category_id')
|
|
||||||
->searchable()
|
|
||||||
->multiple()
|
|
||||||
->columnSpan(2)
|
|
||||||
->label('Categorie')
|
|
||||||
->options(function (Get $get) {
|
|
||||||
$res = SofaScoreTournament::where('sport_id', $get('sport_id'))
|
|
||||||
->groupBy('sofa_score_category_id')
|
|
||||||
->pluck('sofa_score_category_id')
|
|
||||||
->toArray();
|
|
||||||
|
|
||||||
return SofaScoreCategory::query()->whereIn('id', $res)->orderBy('name')->pluck('name', 'id');
|
|
||||||
})
|
|
||||||
->live(),
|
|
||||||
Toggle::make('enabled')->label('In Statistiko')->default(1),
|
Toggle::make('enabled')->label('In Statistiko')->default(1),
|
||||||
])
|
])
|
||||||
->query(function (Builder $query, array $data): Builder {
|
->query(function (Builder $query, array $data): Builder {
|
||||||
return $query->when(
|
return $query->when(
|
||||||
$data['sport_id'],
|
|
||||||
fn(Builder $query, $sport_id) => $query->where('sport_id', $sport_id)
|
|
||||||
)->when(
|
|
||||||
$data['enabled'],
|
$data['enabled'],
|
||||||
fn(Builder $query, $enabled) => $query->where('enabled', $enabled)
|
fn (Builder $query, $enabled) => $query->where('enabled', $enabled)
|
||||||
)->when(
|
|
||||||
$data['sofa_score_category_id'],
|
|
||||||
function (Builder $query, $sofa_score_category_id) {
|
|
||||||
if (is_array($sofa_score_category_id)) {
|
|
||||||
$query->whereIn('sofa_score_category_id', $sofa_score_category_id);
|
|
||||||
} else {
|
|
||||||
$query->where('sofa_score_category_id', $sofa_score_category_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// )->when(
|
|
||||||
// $data['filter-grapping'],
|
|
||||||
// function (Builder $query, $filtergrapping) {
|
|
||||||
// switch ($filtergrapping) {
|
|
||||||
// case 'active':
|
|
||||||
// $query->where('enabled', 1);
|
|
||||||
// break;
|
|
||||||
// case 'disabled':
|
|
||||||
// $query->where('enabled', 0);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// )->when(
|
|
||||||
// $data['filter-disabled'],
|
|
||||||
// function (Builder $query, $filterdisabled) {
|
|
||||||
// switch ($filterdisabled) {
|
|
||||||
// case 'enabled':
|
|
||||||
// $query->where('enabled', 1);
|
|
||||||
// break;
|
|
||||||
// case 'hidden':
|
|
||||||
// $query->where('disabled', 1);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
], layout: FiltersLayout::AboveContent)
|
], layout: FiltersLayout::AboveContent)
|
||||||
->deferFilters(false);
|
->deferFilters(false)
|
||||||
// ->toolbarActions([
|
->recordActions([
|
||||||
// BulkActionGroup::make([
|
EditAction::make()
|
||||||
// BulkAction::make('Enable selected')
|
->iconButton(),
|
||||||
// ->icon('phosphor-toggle-right-fill')
|
]);
|
||||||
// ->color('primary')
|
|
||||||
// ->action(function (Collection $records): void {
|
|
||||||
// foreach ($records as $record) {
|
|
||||||
// SofaScoreTournament::where('id', '=', $record->id)
|
|
||||||
// ->update(
|
|
||||||
// ['enabled' => 1]
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }),
|
|
||||||
// BulkAction::make('Disable selected')
|
|
||||||
// ->icon('phosphor-toggle-left-fill')
|
|
||||||
// ->color('gray')
|
|
||||||
// ->action(function (Collection $records): void {
|
|
||||||
// foreach ($records as $record) {
|
|
||||||
// SofaScoreTournament::where('id', '=', $record->id)
|
|
||||||
// ->update(
|
|
||||||
// ['enabled' => 0]
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }),
|
|
||||||
// ])->label('Grapping'),
|
|
||||||
// BulkActionGroup::make([
|
|
||||||
// BulkAction::make('Hide selected')
|
|
||||||
// ->icon('phosphor-toggle-right-fill')
|
|
||||||
// ->color('primary')
|
|
||||||
// ->action(function (Collection $records): void {
|
|
||||||
// foreach ($records as $record) {
|
|
||||||
// SofaScoreTournament::where('id', '=', $record->id)
|
|
||||||
// ->update(
|
|
||||||
// ['disabled' => 1]
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }),
|
|
||||||
// BulkAction::make('Show selected')
|
|
||||||
// ->icon('phosphor-toggle-left-fill')
|
|
||||||
// ->color('gray')
|
|
||||||
// ->action(function (Collection $records): void {
|
|
||||||
// foreach ($records as $record) {
|
|
||||||
// SofaScoreTournament::where('id', '=', $record->id)
|
|
||||||
// ->update(
|
|
||||||
// ['disabled' => 0]
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }),
|
|
||||||
// ])->label('Hidden'),
|
|
||||||
// ]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+3
-2
@@ -20,9 +20,9 @@ class StatistikoConfigResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $cluster = StaticDataCluster::class;
|
protected static ?string $cluster = StaticDataCluster::class;
|
||||||
|
|
||||||
protected static ?string $navigationLabel = 'Configurations';
|
protected static ?string $navigationLabel = 'Aspettativa';
|
||||||
|
|
||||||
protected static ?string $modelLabel = 'Configurations';
|
protected static ?string $modelLabel = 'Aspettativa';
|
||||||
|
|
||||||
protected static ?int $navigationSort = 15;
|
protected static ?int $navigationSort = 15;
|
||||||
|
|
||||||
@@ -42,6 +42,7 @@ class StatistikoConfigResource extends Resource
|
|||||||
'index' => ListStatistikoConfigs::route('/'),
|
'index' => ListStatistikoConfigs::route('/'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getNavigationBadge(): ?string
|
public static function getNavigationBadge(): ?string
|
||||||
{
|
{
|
||||||
return parent::getEloquentQuery()->count();
|
return parent::getEloquentQuery()->count();
|
||||||
|
|||||||
+15
-4
@@ -14,7 +14,7 @@ class StatistikoConfigsTable
|
|||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('group')->formatStateUsing(fn(string $state): string => match ($state) {
|
TextColumn::make('group')->formatStateUsing(fn (string $state): string => match ($state) {
|
||||||
'gls' => 'Goals',
|
'gls' => 'Goals',
|
||||||
'crn' => 'Corner',
|
'crn' => 'Corner',
|
||||||
'fls' => 'Fouls',
|
'fls' => 'Fouls',
|
||||||
@@ -22,20 +22,30 @@ class StatistikoConfigsTable
|
|||||||
'crd' => 'Cards',
|
'crd' => 'Cards',
|
||||||
'snt' => 'Shots On Target',
|
'snt' => 'Shots On Target',
|
||||||
'tsh' => 'Total Shots',
|
'tsh' => 'Total Shots',
|
||||||
|
'wfl' => 'Was Fouled',
|
||||||
|
'all' => 'Method B',
|
||||||
}),
|
}),
|
||||||
TextColumn::make('team')->badge()
|
TextColumn::make('team')->badge()
|
||||||
->color(fn(string $state): string => match ($state) {
|
->color(fn (string $state): string => match ($state) {
|
||||||
'home' => 'info',
|
'home' => 'info',
|
||||||
'away' => 'warning',
|
'away' => 'warning',
|
||||||
|
default => ''
|
||||||
}),
|
}),
|
||||||
TextColumn::make('varname')
|
TextColumn::make('varname')
|
||||||
->formatStateUsing(fn(string $state): string => strtoupper($state)),
|
->formatStateUsing(fn (string $state): string => strtoupper($state)),
|
||||||
TextInputColumn::make('value')
|
TextInputColumn::make('value')
|
||||||
->prefix('xx.x')
|
->prefix('xx.x')
|
||||||
->type('number')
|
->type('number')
|
||||||
->rules(['required', 'decimal:0.1,10']),
|
->rules(['required', 'decimal:0.1,10']),
|
||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
|
SelectFilter::make('type')
|
||||||
|
->label('Calculation')
|
||||||
|
->default('B')
|
||||||
|
->options([
|
||||||
|
'A' => 'Type A',
|
||||||
|
'B' => 'Type B',
|
||||||
|
]),
|
||||||
SelectFilter::make('group')
|
SelectFilter::make('group')
|
||||||
->options([
|
->options([
|
||||||
'gls' => 'Goals',
|
'gls' => 'Goals',
|
||||||
@@ -45,12 +55,13 @@ class StatistikoConfigsTable
|
|||||||
'crd' => 'Cards',
|
'crd' => 'Cards',
|
||||||
'snt' => 'Shots On Target',
|
'snt' => 'Shots On Target',
|
||||||
'tsh' => 'Total Shots',
|
'tsh' => 'Total Shots',
|
||||||
|
'wfl' => 'Was Fouled',
|
||||||
]),
|
]),
|
||||||
SelectFilter::make('team')
|
SelectFilter::make('team')
|
||||||
->options([
|
->options([
|
||||||
'home' => 'Home',
|
'home' => 'Home',
|
||||||
'away' => 'Away',
|
'away' => 'Away',
|
||||||
])
|
]),
|
||||||
], layout: FiltersLayout::AboveContent)
|
], layout: FiltersLayout::AboveContent)
|
||||||
->deferFilters(false);
|
->deferFilters(false);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -16,6 +16,8 @@ class StatistikoDetailResource extends Resource
|
|||||||
{
|
{
|
||||||
protected static ?string $model = StatistikoDetail::class;
|
protected static ?string $model = StatistikoDetail::class;
|
||||||
|
|
||||||
|
protected static bool $shouldRegisterNavigation = true;
|
||||||
|
|
||||||
protected static ?string $navigationLabel = 'Details';
|
protected static ?string $navigationLabel = 'Details';
|
||||||
|
|
||||||
protected static ?string $modelLabel = 'Details';
|
protected static ?string $modelLabel = 'Details';
|
||||||
|
|||||||
+22
-3
@@ -16,6 +16,15 @@ use Illuminate\Database\Eloquent\Builder;
|
|||||||
|
|
||||||
class StatistikoDetailsTable
|
class StatistikoDetailsTable
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Eingebettete Dokumente (Embeds): Falls Sie mal in einem verschachtelten MongoDB-Objekt suchen müssen (z. B. address.city),
|
||||||
|
* können Sie das in der $subQuery einfach in der Dot-Notation angeben:
|
||||||
|
* $subQuery->orWhere('address.city', 'regexp', '/' . $search . '/i').
|
||||||
|
*
|
||||||
|
* Indexierung: Da Regex-Suchen rechenintensiv sein können,
|
||||||
|
* lohnt es sich, bei wachsenden Datenmengen einen Index auf die durchsuchten Felder
|
||||||
|
* (wie name oder email) in Ihrer MongoDB zu legen.
|
||||||
|
*/
|
||||||
public static function configure(Table $table): Table
|
public static function configure(Table $table): Table
|
||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
@@ -26,11 +35,21 @@ class StatistikoDetailsTable
|
|||||||
->columns([
|
->columns([
|
||||||
Stack::make([
|
Stack::make([
|
||||||
ToggleColumn::make('is_active'),
|
ToggleColumn::make('is_active'),
|
||||||
TextColumn::make('player_name')->color('primary')->icon('phosphor-copy')->copyable()->searchable(),
|
TextColumn::make('player_name')
|
||||||
|
->color('primary')
|
||||||
|
->icon('phosphor-copy')
|
||||||
|
->copyable()
|
||||||
|
->searchable(query: function (Builder $query, string $search): Builder {
|
||||||
|
return $query->where(function (Builder $subQuery) use ($search) {
|
||||||
|
// MongoDB-sichere Regex-Suche über Name ODER E-Mail
|
||||||
|
$subQuery->where('player_name', 'regexp', '/'.$search.'/i')
|
||||||
|
->orWhere('player_name', 'regexp', '/'.$search.'/i');
|
||||||
|
});
|
||||||
|
}),
|
||||||
TextColumn::make('ss_player_id')
|
TextColumn::make('ss_player_id')
|
||||||
->color('success')->icon('phosphor-copy')->copyable()
|
->color('success')->icon('phosphor-copy')->copyable()
|
||||||
->searchable(
|
->searchable(
|
||||||
query: fn($query, $search) => $query->orWhere('ss_player_id', (int) $search)
|
query: fn ($query, $search) => $query->orWhere('ss_player_id', (int) $search)
|
||||||
),
|
),
|
||||||
TextColumn::make('positions.name')->badge()->color('warning')
|
TextColumn::make('positions.name')->badge()->color('warning')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
@@ -68,9 +87,9 @@ class StatistikoDetailsTable
|
|||||||
if (! $data['find_double']) {
|
if (! $data['find_double']) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'Find Double';
|
return 'Find Double';
|
||||||
}),
|
}),
|
||||||
|
|
||||||
], layout: FiltersLayout::AboveContent)
|
], layout: FiltersLayout::AboveContent)
|
||||||
->deferFilters(false)
|
->deferFilters(false)
|
||||||
->recordActions([
|
->recordActions([
|
||||||
|
|||||||
+17
-6
@@ -14,20 +14,31 @@ class StatistikoEventsForm
|
|||||||
->components([
|
->components([
|
||||||
DateTimePicker::make('starttime')->native(false),
|
DateTimePicker::make('starttime')->native(false),
|
||||||
TextInput::make('season'),
|
TextInput::make('season'),
|
||||||
|
|
||||||
TextInput::make('gls_h'),
|
TextInput::make('gls_h'),
|
||||||
TextInput::make('gls_a'),
|
TextInput::make('gls_a'),
|
||||||
TextInput::make('crn_h'),
|
|
||||||
TextInput::make('fls_h'),
|
|
||||||
TextInput::make('ofs_h'),
|
|
||||||
TextInput::make('snt_h'),
|
|
||||||
TextInput::make('tsh_h'),
|
|
||||||
TextInput::make('crd_h'),
|
|
||||||
TextInput::make('crn_a'),
|
TextInput::make('crn_a'),
|
||||||
|
TextInput::make('crn_h'),
|
||||||
|
|
||||||
|
TextInput::make('fls_h'),
|
||||||
TextInput::make('fls_a'),
|
TextInput::make('fls_a'),
|
||||||
|
|
||||||
|
TextInput::make('ofs_h'),
|
||||||
TextInput::make('ofs_a'),
|
TextInput::make('ofs_a'),
|
||||||
|
|
||||||
|
TextInput::make('snt_h'),
|
||||||
TextInput::make('snt_a'),
|
TextInput::make('snt_a'),
|
||||||
|
|
||||||
|
TextInput::make('tsh_h'),
|
||||||
TextInput::make('tsh_a'),
|
TextInput::make('tsh_a'),
|
||||||
|
|
||||||
|
TextInput::make('crd_h'),
|
||||||
TextInput::make('crd_a'),
|
TextInput::make('crd_a'),
|
||||||
|
|
||||||
|
TextInput::make('wfl_h'),
|
||||||
|
TextInput::make('wfl_a'),
|
||||||
|
|
||||||
TextInput::make('exp_home'),
|
TextInput::make('exp_home'),
|
||||||
TextInput::make('exp_away'),
|
TextInput::make('exp_away'),
|
||||||
TextInput::make('exp_handicap'),
|
TextInput::make('exp_handicap'),
|
||||||
|
|||||||
-1
@@ -8,7 +8,6 @@ use Filament\Actions\Action;
|
|||||||
use Filament\Actions\CreateAction;
|
use Filament\Actions\CreateAction;
|
||||||
use Filament\Resources\Pages\ListRecords;
|
use Filament\Resources\Pages\ListRecords;
|
||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
|
|
||||||
class ListStatistikoImports extends ListRecords
|
class ListStatistikoImports extends ListRecords
|
||||||
{
|
{
|
||||||
|
|||||||
+1
@@ -21,6 +21,7 @@ class StatistikoImportForm
|
|||||||
'player' => '<span class="text-pink-600">Player History</span>',
|
'player' => '<span class="text-pink-600">Player History</span>',
|
||||||
'fixtures' => '<span class="text-orange-500">Fixtures Upcoming</span>',
|
'fixtures' => '<span class="text-orange-500">Fixtures Upcoming</span>',
|
||||||
'events' => '<span class="text-green-500">Events History</span>',
|
'events' => '<span class="text-green-500">Events History</span>',
|
||||||
|
'teams_tornaments' => '<span class="text-fuchsia-500">Teams in Tornaments</span>',
|
||||||
]),
|
]),
|
||||||
|
|
||||||
FileUpload::make('file_name')
|
FileUpload::make('file_name')
|
||||||
|
|||||||
+3
-1
@@ -32,6 +32,7 @@ class StatistikoImportsTable
|
|||||||
'player' => '<span class="text-pink-600">Player History</span>',
|
'player' => '<span class="text-pink-600">Player History</span>',
|
||||||
'fixtures' => '<span class="text-orange-500">Fixtures Upcoming</span>',
|
'fixtures' => '<span class="text-orange-500">Fixtures Upcoming</span>',
|
||||||
'events' => '<span class="text-green-500">Events History</span>',
|
'events' => '<span class="text-green-500">Events History</span>',
|
||||||
|
'teams_tornaments' => '<span class="text-fuchsia-500">Teams in Tornaments</span>',
|
||||||
]),
|
]),
|
||||||
TextColumn::make('file_name_original')
|
TextColumn::make('file_name_original')
|
||||||
->sortable()
|
->sortable()
|
||||||
@@ -55,6 +56,7 @@ class StatistikoImportsTable
|
|||||||
'events' => 'Events',
|
'events' => 'Events',
|
||||||
'fixtures' => 'Fixtures',
|
'fixtures' => 'Fixtures',
|
||||||
'player' => 'Player',
|
'player' => 'Player',
|
||||||
|
'teams_tornaments' => 'Teams in Tornaments',
|
||||||
]),
|
]),
|
||||||
], layout: FiltersLayout::AboveContent)
|
], layout: FiltersLayout::AboveContent)
|
||||||
->filtersFormColumns(6)
|
->filtersFormColumns(6)
|
||||||
@@ -67,7 +69,7 @@ class StatistikoImportsTable
|
|||||||
->color('success')
|
->color('success')
|
||||||
->tooltip('Update or create')
|
->tooltip('Update or create')
|
||||||
->icon('phosphor-database')
|
->icon('phosphor-database')
|
||||||
->action(fn($record) => StatistikoImporter::run($record))
|
->action(fn ($record) => StatistikoImporter::run($record))
|
||||||
->successNotification(
|
->successNotification(
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->info()
|
->info()
|
||||||
|
|||||||
+223
-28
@@ -3,7 +3,7 @@
|
|||||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\Pages;
|
namespace App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\Pages;
|
||||||
|
|
||||||
use App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\StatistikoPlayerResource;
|
use App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\StatistikoPlayerResource;
|
||||||
use App\Filament\Exports\PlayerHistoryExporter;
|
use App\Filament\Exports\StatistikoPlayerExporter;
|
||||||
use App\Models\StatistikoPlayer;
|
use App\Models\StatistikoPlayer;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Filament\Actions\Action;
|
use Filament\Actions\Action;
|
||||||
@@ -12,6 +12,8 @@ use Filament\Actions\ExportAction;
|
|||||||
use Filament\Actions\Exports\Models\Export;
|
use Filament\Actions\Exports\Models\Export;
|
||||||
use Filament\Forms\Components\Select;
|
use Filament\Forms\Components\Select;
|
||||||
use Filament\Resources\Pages\ListRecords;
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||||
|
|
||||||
class ListStatistikoPlayers extends ListRecords
|
class ListStatistikoPlayers extends ListRecords
|
||||||
{
|
{
|
||||||
@@ -20,13 +22,223 @@ class ListStatistikoPlayers extends ListRecords
|
|||||||
protected function getHeaderActions(): array
|
protected function getHeaderActions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
ExportAction::make('download_players')
|
Action::make('stream_export')
|
||||||
->columnMapping(false)
|
->label('Export')
|
||||||
->chunkSize(1000)
|
->icon('heroicon-o-arrow-down-tray')
|
||||||
->exporter(PlayerHistoryExporter::class)
|
->action(function (): StreamedResponse {
|
||||||
->label('Download')
|
// Zeit- und Speicherlimits für diesen HTTP-Request aufheben
|
||||||
->fileName(fn(Export $export): string => 'player-history-' . date('d.m.Y-H.i') . "-{$export->getKey()}")
|
set_time_limit(0);
|
||||||
->icon('phosphor-download'),
|
ini_set('memory_limit', '512M');
|
||||||
|
|
||||||
|
return response()->streamDownload(function () {
|
||||||
|
$output = fopen('php://output', 'w');
|
||||||
|
|
||||||
|
// UTF-8 BOM für Excel (Umlaute-Fix)
|
||||||
|
fprintf($output, chr(0xEF).chr(0xBB).chr(0xBF));
|
||||||
|
|
||||||
|
fputcsv($output, [
|
||||||
|
'match_id',
|
||||||
|
'ss_player_id',
|
||||||
|
'tm_player_id',
|
||||||
|
'sport_id',
|
||||||
|
'activeteam_id',
|
||||||
|
'assists',
|
||||||
|
'bcc',
|
||||||
|
'bcm',
|
||||||
|
'blocked_shots',
|
||||||
|
'card_red',
|
||||||
|
'card_yellow',
|
||||||
|
'card_yellowred',
|
||||||
|
'clearance_off_line',
|
||||||
|
'clearances',
|
||||||
|
'cross_done',
|
||||||
|
'description_event_during_the_match',
|
||||||
|
'dispossessed',
|
||||||
|
'dribbled_past',
|
||||||
|
'dribbles_won',
|
||||||
|
'errors_lead_to_a_goal',
|
||||||
|
'errors_lead_to_a_shot',
|
||||||
|
'fouls',
|
||||||
|
'goals',
|
||||||
|
'good_high_claim',
|
||||||
|
'hit_woodwork',
|
||||||
|
'ingamepenalty_missed',
|
||||||
|
'interceptions',
|
||||||
|
'key_pass',
|
||||||
|
'last_man_tackle',
|
||||||
|
'lineup',
|
||||||
|
'long_balls',
|
||||||
|
'minute_event_during_the_match',
|
||||||
|
'minutes_played',
|
||||||
|
'offsides',
|
||||||
|
'own_goals',
|
||||||
|
'pass',
|
||||||
|
'penalty_committed',
|
||||||
|
'penalty_miss',
|
||||||
|
'penalty_save',
|
||||||
|
'penalty_won',
|
||||||
|
'penaltyshoutout_missed',
|
||||||
|
'penaltyshoutout_scored',
|
||||||
|
'player_position',
|
||||||
|
'playerrating_value',
|
||||||
|
'playersubstitute_id',
|
||||||
|
'possessions_lost',
|
||||||
|
'punches',
|
||||||
|
'runs_out',
|
||||||
|
'saves',
|
||||||
|
'saves_from_in_box',
|
||||||
|
'shots_blocked',
|
||||||
|
'shots_off_target',
|
||||||
|
'shots_on_target',
|
||||||
|
'subtype_event_during_the_match',
|
||||||
|
'total_aerial_duels',
|
||||||
|
'total_cross',
|
||||||
|
'total_dribbles',
|
||||||
|
'total_duels_aerial_won',
|
||||||
|
'total_ground_duels',
|
||||||
|
'total_ground_duels_won',
|
||||||
|
'total_long_balls',
|
||||||
|
'total_pass',
|
||||||
|
'total_runs_out',
|
||||||
|
'total_tackles',
|
||||||
|
'touches',
|
||||||
|
'type_event_during_the_match',
|
||||||
|
'updated_at',
|
||||||
|
'was_fouled',
|
||||||
|
]);
|
||||||
|
|
||||||
|
// 2. Abfrage definieren
|
||||||
|
$query = StatistikoPlayer::query()->orderBy('_id', 'asc');
|
||||||
|
|
||||||
|
// FALLS SIE NUR AB ZEILE 200.000 STARTEN WOLLEN:
|
||||||
|
// Nutzen Sie kein ->skip(). Wenn Sie die letzte MongoDB-_id aus
|
||||||
|
// Ihrem vorherigen erfolgreichen Export kennen (z.B. '654321...'),
|
||||||
|
// filtern Sie stattdessen performant so:
|
||||||
|
// $query->where('_id', '>', 'HIER_DIE_LETZTE_ERFOLGREICHE_ID_EINTRAGEN');
|
||||||
|
|
||||||
|
// 3. Daten ohne Chunk-Einschränkung direkt aus MongoDB streamen
|
||||||
|
$query->getQuery()
|
||||||
|
->options(['noCursorTimeout' => true])
|
||||||
|
->cursor()
|
||||||
|
->each(function ($row) use ($output) {
|
||||||
|
fputcsv($output, [
|
||||||
|
$row->match_id ?? '',
|
||||||
|
$row->ss_player_id ?? '',
|
||||||
|
$row->tm_player_id ?? '',
|
||||||
|
$row->sport_id ?? '',
|
||||||
|
$row->activeteam_id ?? '',
|
||||||
|
$row->assists ?? '',
|
||||||
|
$row->bcc ?? '',
|
||||||
|
$row->bcm ?? '',
|
||||||
|
$row->blocked_shots ?? '',
|
||||||
|
$row->card_red ?? '',
|
||||||
|
$row->card_yellow ?? '',
|
||||||
|
$row->card_yellowred ?? '',
|
||||||
|
$row->clearance_off_line ?? '',
|
||||||
|
$row->clearances ?? '',
|
||||||
|
$row->cross_done ?? '',
|
||||||
|
$row->description_event_during_the_match ?? '',
|
||||||
|
$row->dispossessed ?? '',
|
||||||
|
$row->dribbled_past ?? '',
|
||||||
|
$row->dribbles_won ?? '',
|
||||||
|
$row->errors_lead_to_a_goal ?? '',
|
||||||
|
$row->errors_lead_to_a_shot ?? '',
|
||||||
|
$row->fouls ?? '',
|
||||||
|
$row->goals ?? '',
|
||||||
|
$row->good_high_claim ?? '',
|
||||||
|
$row->hit_woodwork ?? '',
|
||||||
|
$row->ingamepenalty_missed ?? '',
|
||||||
|
$row->interceptions ?? '',
|
||||||
|
$row->key_pass ?? '',
|
||||||
|
$row->last_man_tackle ?? '',
|
||||||
|
$row->lineup ?? '',
|
||||||
|
$row->long_balls ?? '',
|
||||||
|
$row->minute_event_during_the_match ?? '',
|
||||||
|
$row->minutes_played ?? '',
|
||||||
|
$row->offsides ?? '',
|
||||||
|
$row->own_goals ?? '',
|
||||||
|
$row->pass ?? '',
|
||||||
|
$row->penalty_committed ?? '',
|
||||||
|
$row->penalty_miss ?? '',
|
||||||
|
$row->penalty_save ?? '',
|
||||||
|
$row->penalty_won ?? '',
|
||||||
|
$row->penaltyshoutout_missed ?? '',
|
||||||
|
$row->penaltyshoutout_scored ?? '',
|
||||||
|
$row->player_position ?? '',
|
||||||
|
$row->playerrating_value ?? '',
|
||||||
|
$row->playersubstitute_id ?? '',
|
||||||
|
$row->possessions_lost ?? '',
|
||||||
|
$row->punches ?? '',
|
||||||
|
$row->runs_out ?? '',
|
||||||
|
$row->saves ?? '',
|
||||||
|
$row->saves_from_in_box ?? '',
|
||||||
|
$row->shots_blocked ?? '',
|
||||||
|
$row->shots_off_target ?? '',
|
||||||
|
$row->shots_on_target ?? '',
|
||||||
|
$row->subtype_event_during_the_match ?? '',
|
||||||
|
$row->total_aerial_duels ?? '',
|
||||||
|
$row->total_cross ?? '',
|
||||||
|
$row->total_dribbles ?? '',
|
||||||
|
$row->total_duels_aerial_won ?? '',
|
||||||
|
$row->total_ground_duels ?? '',
|
||||||
|
$row->total_ground_duels_won ?? '',
|
||||||
|
$row->total_long_balls ?? '',
|
||||||
|
$row->total_pass ?? '',
|
||||||
|
$row->total_runs_out ?? '',
|
||||||
|
$row->total_tackles ?? '',
|
||||||
|
$row->touches ?? '',
|
||||||
|
$row->type_event_during_the_match ?? '',
|
||||||
|
$row->updated_at ?? '',
|
||||||
|
$row->was_fouled ?? '',
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
fclose($output);
|
||||||
|
}, 'player_history_clean_'.now()->format('Y-m-d').'.csv');
|
||||||
|
}),
|
||||||
|
// ExportAction::make('download_players')
|
||||||
|
// ->label('Export')
|
||||||
|
// ->icon('phosphor-download')
|
||||||
|
// ->columnMapping(false)
|
||||||
|
// ->chunkSize(2000)
|
||||||
|
// ->exporter(StatistikoPlayerExporter::class)
|
||||||
|
// ->fileName(function (Export $export): string {
|
||||||
|
// $options = $export->getOptions();
|
||||||
|
// switch ($options['limit']) {
|
||||||
|
// case '1':
|
||||||
|
// return 'player-history-0-200k-'.date('d.m.Y-H.i');
|
||||||
|
// case '2':
|
||||||
|
// return 'player-history-200k-400k-'.date('d.m.Y-H.i');
|
||||||
|
// case '3':
|
||||||
|
// return 'player-history-400k-600k-'.date('d.m.Y-H.i');
|
||||||
|
// case '4':
|
||||||
|
// return 'player-history-600k-800k-'.date('d.m.Y-H.i');
|
||||||
|
// case '5':
|
||||||
|
// return 'player-history-800k-1000k-'.date('d.m.Y-H.i');
|
||||||
|
// default:
|
||||||
|
// return 'player-history-all-'.date('d.m.Y-H.i');
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// ->modifyQueryUsing(function (Builder $query, array $options) {
|
||||||
|
// if (isset($options['limit'])) {
|
||||||
|
// switch ($options['limit']) {
|
||||||
|
// case '1':
|
||||||
|
// return $query->skip(0)->take(200000);
|
||||||
|
// case '2':
|
||||||
|
// return $query->skip(200000)->take(200000);
|
||||||
|
// case '3':
|
||||||
|
// return $query->skip(400000)->take(200000);
|
||||||
|
// case '4':
|
||||||
|
// return $query->skip(600000)->take(200000);
|
||||||
|
// case '5':
|
||||||
|
// return $query->skip(800000)->take(200000);
|
||||||
|
// default:
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return $query;
|
||||||
|
// }),
|
||||||
Action::make('count')
|
Action::make('count')
|
||||||
->color('gray')
|
->color('gray')
|
||||||
->tooltip('Count values from selected column')
|
->tooltip('Count values from selected column')
|
||||||
@@ -38,7 +250,7 @@ class ListStatistikoPlayers extends ListRecords
|
|||||||
'card_yellow' => 'card_yellow',
|
'card_yellow' => 'card_yellow',
|
||||||
'card_yellowred' => 'card_yellowred',
|
'card_yellowred' => 'card_yellowred',
|
||||||
'card_red' => 'card_red',
|
'card_red' => 'card_red',
|
||||||
])
|
]),
|
||||||
])
|
])
|
||||||
->action(function (array $data): void {
|
->action(function (array $data): void {
|
||||||
$players = StatistikoPlayer::where('ss_player_id', 1087079)->get();
|
$players = StatistikoPlayer::where('ss_player_id', 1087079)->get();
|
||||||
@@ -55,6 +267,7 @@ class ListStatistikoPlayers extends ListRecords
|
|||||||
->modalSubmitAction(false)
|
->modalSubmitAction(false)
|
||||||
->modalContent(function () {
|
->modalContent(function () {
|
||||||
$players = StatistikoPlayer::where('starttime', '<', new DateTime('-10 years'))->get();
|
$players = StatistikoPlayer::where('starttime', '<', new DateTime('-10 years'))->get();
|
||||||
|
|
||||||
return view('filament.pages.list-player-starttime', ['players' => $players]);
|
return view('filament.pages.list-player-starttime', ['players' => $players]);
|
||||||
}),
|
}),
|
||||||
Action::make('missing')
|
Action::make('missing')
|
||||||
@@ -65,26 +278,8 @@ class ListStatistikoPlayers extends ListRecords
|
|||||||
->icon('phosphor-magnifying-glass')
|
->icon('phosphor-magnifying-glass')
|
||||||
->modalContent(function () {
|
->modalContent(function () {
|
||||||
$players = StatistikoPlayer::doesntHave('details')->groupBy('ss_player_id')->get();
|
$players = StatistikoPlayer::doesntHave('details')->groupBy('ss_player_id')->get();
|
||||||
return view('filament.pages.list-missing-player', ['players' => $players]);
|
|
||||||
}),
|
|
||||||
Action::make('double')
|
|
||||||
->modalSubmitAction(false)
|
|
||||||
->icon('phosphor-magnifying-glass')
|
|
||||||
->color('gray')
|
|
||||||
->modalContent(function () {
|
|
||||||
$arr = [];
|
|
||||||
$doubles = [];
|
|
||||||
$events = StatistikoPlayer::query()->select('match_id', 'ss_player_id')->get()->toArray();
|
|
||||||
foreach ($events as $value) {
|
|
||||||
$match_id = $value['match_id'];
|
|
||||||
$player_id = $value['ss_player_id'];
|
|
||||||
|
|
||||||
if (isset($arr[$match_id]) && in_array($player_id, $arr[$match_id])) {
|
return view('filament.pages.list-missing-player', ['players' => $players]);
|
||||||
$doubles[] = ['match_id' => $match_id, 'player_id' => $player_id];
|
|
||||||
}
|
|
||||||
$arr[$match_id][] = $player_id;
|
|
||||||
}
|
|
||||||
return view('filament.pages.list-doubles-player', ['doubles' => $doubles]);
|
|
||||||
}),
|
}),
|
||||||
Action::make('truncate')
|
Action::make('truncate')
|
||||||
->icon('phosphor-trash')
|
->icon('phosphor-trash')
|
||||||
|
|||||||
+74
-50
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\Tables;
|
namespace App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\Tables;
|
||||||
|
|
||||||
use Filament\Actions\BulkActionGroup;
|
use App\Models\StatistikoEvent;
|
||||||
use Filament\Actions\DeleteAction;
|
use Filament\Actions\DeleteAction;
|
||||||
use Filament\Actions\DeleteBulkAction;
|
|
||||||
use Filament\Actions\EditAction;
|
use Filament\Actions\EditAction;
|
||||||
use Filament\Tables\Columns\TextColumn;
|
use Filament\Tables\Columns\TextColumn;
|
||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
@@ -15,74 +14,99 @@ class StatistikoPlayersTable
|
|||||||
public static function configure(Table $table): Table
|
public static function configure(Table $table): Table
|
||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
|
->searchable(false)
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('match_id')->color('info')->icon('phosphor-copy')->copyable()
|
TextColumn::make('match_id')
|
||||||
|
->color('info')
|
||||||
|
->icon('phosphor-copy')
|
||||||
|
->copyable()
|
||||||
->sortable()
|
->sortable()
|
||||||
->searchable(
|
->searchable(
|
||||||
query: fn($query, $search) => $query->orWhere('match_id', (int) $search)
|
isIndividual: true
|
||||||
),
|
),
|
||||||
TextColumn::make('ss_player_id')
|
TextColumn::make('ss_player_id')
|
||||||
->sortable()
|
->sortable()
|
||||||
->label('Player Id')
|
->label('Player Id')
|
||||||
->color('success')->icon('phosphor-copy')->copyable()
|
->color('success')
|
||||||
|
->icon('phosphor-copy')
|
||||||
|
->copyable()
|
||||||
->searchable(
|
->searchable(
|
||||||
query: fn($query, $search) => $query->orWhere('ss_player_id', (int) $search)
|
isIndividual: true,
|
||||||
),
|
),
|
||||||
TextColumn::make('details.player_name')->label('Player')->searchable()
|
TextColumn::make('details.player_name')
|
||||||
->tooltip(fn($record) => $record->details->full_name)
|
->label('Player')
|
||||||
->sortable(
|
->searchable(
|
||||||
query: fn(Builder $query) => $query->orderBy('details.player_name')
|
isIndividual: true,
|
||||||
|
isGlobal: false,
|
||||||
|
query: function (Builder $query, string $search): Builder {
|
||||||
|
// Wir springen in die verknüpfte MongoDB-Collection ab
|
||||||
|
return $query->whereHas('details', function (Builder $subQuery) use ($search) {
|
||||||
|
// Wichtig: Hier das Feld der FREMD-Collection durchsuchen (z.B. 'name')
|
||||||
|
$subQuery->where('player_name', 'regexp', '/'.$search.'/i');
|
||||||
|
});
|
||||||
|
}
|
||||||
),
|
),
|
||||||
TextColumn::make('event.home.ss_team_name')->color('primary')->searchable()
|
TextColumn::make('event.home.ss_team_name')
|
||||||
|
->color('primary')
|
||||||
->sortable(
|
->sortable(
|
||||||
query: fn(Builder $query) => $query->orderBy('event.home.ss_team_name')
|
query: fn (Builder $query) => $query->orderBy('event.home.ss_team_name')
|
||||||
|
)->searchable(
|
||||||
|
isIndividual: true,
|
||||||
|
isGlobal: false,
|
||||||
|
query: function (Builder $query, string $search): Builder {
|
||||||
|
|
||||||
|
// 1. SCHRITT: In MariaDB nach passenden User-IDs suchen
|
||||||
|
// Wir nutzen die normalen SQL-Features von MariaDB (LIKE)
|
||||||
|
$matchingTeamIds = StatistikoEvent::whereHas('home', function ($teamQuery) use ($search) {
|
||||||
|
$teamQuery->where('ss_team_name', 'LIKE', "%{$search}%");
|
||||||
|
})
|
||||||
|
->pluck('home_id') // Holt alle IDs der passenden User als flaches Array
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
// 2. SCHRITT: MongoDB filtern
|
||||||
|
// Wenn MariaDB keine Treffer hatte, erzwingen wir eine leere Tabelle
|
||||||
|
if (empty($matchingTeamIds)) {
|
||||||
|
return $query->where('_id', '=', null);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $query->whereHas('event', function (Builder $subQuery) use ($matchingTeamIds) {
|
||||||
|
$subQuery->whereIn('home_id', $matchingTeamIds);
|
||||||
|
});
|
||||||
|
}
|
||||||
),
|
),
|
||||||
TextColumn::make('event.away.ss_team_name')->searchable()->color('success')
|
TextColumn::make('event.away.ss_team_name')->color('success')
|
||||||
->sortable(
|
->sortable(
|
||||||
query: fn(Builder $query) => $query->orderBy('ss_team_name')
|
query: fn (Builder $query) => $query->orderBy('ss_team_name')
|
||||||
|
)->searchable(
|
||||||
|
isIndividual: true, // Einzelnes Suchfeld für diese Spalte
|
||||||
|
isGlobal: false, // Globales Suchfeld deaktiviert lassen
|
||||||
|
query: function (Builder $query, string $search): Builder {
|
||||||
|
|
||||||
|
// 1. SCHRITT: In MariaDB nach passenden User-IDs suchen
|
||||||
|
// Wir nutzen die normalen SQL-Features von MariaDB (LIKE)
|
||||||
|
$matchingTeamIds = StatistikoEvent::whereHas('away', function ($teamQuery) use ($search) {
|
||||||
|
$teamQuery->where('ss_team_name', 'LIKE', "%{$search}%");
|
||||||
|
})
|
||||||
|
->pluck('away_id') // Holt alle IDs der passenden User als flaches Array
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
// 2. SCHRITT: MongoDB filtern
|
||||||
|
// Wenn MariaDB keine Treffer hatte, erzwingen wir eine leere Tabelle
|
||||||
|
if (empty($matchingTeamIds)) {
|
||||||
|
return $query->where('_id', '=', null);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $query->whereHas('event', function (Builder $subQuery) use ($matchingTeamIds) {
|
||||||
|
$subQuery->whereIn('away_id', $matchingTeamIds);
|
||||||
|
});
|
||||||
|
}
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
// ->filters([
|
|
||||||
// Filter::make('player_filters')
|
|
||||||
// ->schema([
|
|
||||||
// Checkbox::make('find_double'),
|
|
||||||
// ])->query(function (Builder $query, array $data): Builder {
|
|
||||||
// return $query->when(
|
|
||||||
// $data['find_double'],
|
|
||||||
// function (Builder $query) {
|
|
||||||
// $arr = [];
|
|
||||||
// $events = StatistikoPlayer::query()->select('match_id', 'ss_player_id')->get()->toArray();
|
|
||||||
// foreach ($events as $value) {
|
|
||||||
// $match_id = $value['match_id'];
|
|
||||||
// $player_id = $value['ss_player_id'];
|
|
||||||
|
|
||||||
// if (isset($arr[$match_id]) && in_array($player_id, $arr[$match_id])) {
|
|
||||||
// return $query->where('match_id', $match_id)->where('ss_player_id', $player_id);
|
|
||||||
// }
|
|
||||||
// $arr[$match_id][] = $player_id;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return $query->where('match_id', 0);
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
// })->indicateUsing(function (array $data): ?string {
|
|
||||||
// if (! $data['find_double']) {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
// return 'Find Double';
|
|
||||||
// }),
|
|
||||||
|
|
||||||
// ], layout: FiltersLayout::AboveContent)
|
|
||||||
->emptyStateHeading('No player double in an event')
|
->emptyStateHeading('No player double in an event')
|
||||||
->deferFilters(false)
|
->deferFilters(false)
|
||||||
->recordActions([
|
->recordActions([
|
||||||
EditAction::make()->iconButton(),
|
EditAction::make()->iconButton(),
|
||||||
DeleteAction::make()->iconButton(),
|
DeleteAction::make()->iconButton(),
|
||||||
])
|
|
||||||
->toolbarActions([
|
|
||||||
BulkActionGroup::make([
|
|
||||||
DeleteBulkAction::make(),
|
|
||||||
]),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,6 +36,8 @@ class EventsHistoryExporter extends Exporter
|
|||||||
ExportColumn::make('tsh_a'),
|
ExportColumn::make('tsh_a'),
|
||||||
ExportColumn::make('crd_h'),
|
ExportColumn::make('crd_h'),
|
||||||
ExportColumn::make('crd_a'),
|
ExportColumn::make('crd_a'),
|
||||||
|
ExportColumn::make('wfl_h'),
|
||||||
|
ExportColumn::make('wfl_a'),
|
||||||
ExportColumn::make('exp_home'),
|
ExportColumn::make('exp_home'),
|
||||||
ExportColumn::make('exp_away'),
|
ExportColumn::make('exp_away'),
|
||||||
ExportColumn::make('exp_handicap'),
|
ExportColumn::make('exp_handicap'),
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Exports;
|
||||||
|
|
||||||
|
use App\Models\Event;
|
||||||
|
use Filament\Actions\Exports\ExportColumn;
|
||||||
|
use Filament\Actions\Exports\Exporter;
|
||||||
|
use Filament\Actions\Exports\Models\Export;
|
||||||
|
use Illuminate\Support\Number;
|
||||||
|
|
||||||
|
class MainMarketsExporter extends Exporter
|
||||||
|
{
|
||||||
|
protected static ?string $model = Event::class;
|
||||||
|
|
||||||
|
public static function getColumns(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
ExportColumn::make('id')
|
||||||
|
->label('TxOdds id'),
|
||||||
|
ExportColumn::make('betsapi_id'),
|
||||||
|
ExportColumn::make('betradar_id'),
|
||||||
|
ExportColumn::make('bet365_id'),
|
||||||
|
ExportColumn::make('starttime'),
|
||||||
|
ExportColumn::make('sport_id'),
|
||||||
|
ExportColumn::make('country_id'),
|
||||||
|
ExportColumn::make('country.name'),
|
||||||
|
ExportColumn::make('competition_group_id')
|
||||||
|
->label('Group id'),
|
||||||
|
ExportColumn::make('competition_group.name')
|
||||||
|
->label('Group'),
|
||||||
|
ExportColumn::make('home_id'),
|
||||||
|
ExportColumn::make('home.name'),
|
||||||
|
ExportColumn::make('away_id'),
|
||||||
|
ExportColumn::make('away.name'),
|
||||||
|
ExportColumn::make('odds_3ways.bookmaker_id'),
|
||||||
|
ExportColumn::make('odds_3ways.h3w'),
|
||||||
|
ExportColumn::make('odds_3ways.h3w')
|
||||||
|
->label('1'),
|
||||||
|
ExportColumn::make('odds_3ways.d3w')
|
||||||
|
->label('X'),
|
||||||
|
ExportColumn::make('odds_3ways.a3w')
|
||||||
|
->label('2'),
|
||||||
|
ExportColumn::make('odds_totals.over')
|
||||||
|
->label('Over'),
|
||||||
|
ExportColumn::make('odds_totals.under')
|
||||||
|
->label('Under'),
|
||||||
|
ExportColumn::make('odds_totals.total')
|
||||||
|
->label('Total'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getCompletedNotificationBody(Export $export): string
|
||||||
|
{
|
||||||
|
$body = 'Your event export has completed and '.Number::format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
|
||||||
|
|
||||||
|
if ($failedRowsCount = $export->getFailedRowsCount()) {
|
||||||
|
$body .= ' '.Number::format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $body;
|
||||||
|
}
|
||||||
|
}
|
||||||
+38
-3
@@ -2,15 +2,35 @@
|
|||||||
|
|
||||||
namespace App\Filament\Exports;
|
namespace App\Filament\Exports;
|
||||||
|
|
||||||
use App\Models\PlayerHistory;
|
use App\Models\StatistikoPlayer;
|
||||||
use Filament\Actions\Exports\ExportColumn;
|
use Filament\Actions\Exports\ExportColumn;
|
||||||
use Filament\Actions\Exports\Exporter;
|
use Filament\Actions\Exports\Exporter;
|
||||||
use Filament\Actions\Exports\Models\Export;
|
use Filament\Actions\Exports\Models\Export;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Support\Number;
|
use Illuminate\Support\Number;
|
||||||
|
|
||||||
class PlayerHistoryExporter extends Exporter
|
class StatistikoPlayerExporter extends Exporter
|
||||||
{
|
{
|
||||||
protected static ?string $model = PlayerHistory::class;
|
protected static ?string $model = StatistikoPlayer::class;
|
||||||
|
|
||||||
|
public static function getOptionsFormComponents(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Select::make('limit')
|
||||||
|
->label('Pakets for export')
|
||||||
|
->options([
|
||||||
|
'all' => 'all',
|
||||||
|
'1' => '0 - 200k',
|
||||||
|
'2' => '200k - 400k',
|
||||||
|
'3' => '400k - 600k',
|
||||||
|
'4' => '600k - 800k',
|
||||||
|
'5' => '800k - 1000k',
|
||||||
|
])
|
||||||
|
->default('all')
|
||||||
|
->required(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public static function getColumns(): array
|
public static function getColumns(): array
|
||||||
{
|
{
|
||||||
@@ -96,4 +116,19 @@ class PlayerHistoryExporter extends Exporter
|
|||||||
|
|
||||||
return $body;
|
return $body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function modifyQueryUsing(Builder $query): Builder
|
||||||
|
{
|
||||||
|
// Sortiert standardmäßig nach der MongoDB-internen ID vor,
|
||||||
|
// um eine konsistente Paginierung ohne chunkById-Fehler zu erzwingen
|
||||||
|
// 1. Sortierung für konsistente Chunks sicherstellen
|
||||||
|
$query->orderBy('_id', 'asc');
|
||||||
|
|
||||||
|
// 2. Den zugrundeliegenden MongoDB-Cursor anweisen, kein Timeout zu nutzen
|
||||||
|
$query->getQuery()->options([
|
||||||
|
'noCursorTimeout' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -9,10 +9,13 @@ use Spatie\SimpleExcel\SimpleExcelReader;
|
|||||||
|
|
||||||
class ImportDetails
|
class ImportDetails
|
||||||
{
|
{
|
||||||
|
public static $teams = [];
|
||||||
|
|
||||||
public static function run(string $filePath): void
|
public static function run(string $filePath): void
|
||||||
{
|
{
|
||||||
StatistikoDetail::query()->update(['last_import' => 'no']);
|
StatistikoDetail::query()->update(['last_import' => 'no']);
|
||||||
|
|
||||||
|
self::$teams = [];
|
||||||
SimpleExcelReader::create(storage_path('app/public/'.$filePath))
|
SimpleExcelReader::create(storage_path('app/public/'.$filePath))
|
||||||
->getRows()
|
->getRows()
|
||||||
->chunk(1000)
|
->chunk(1000)
|
||||||
@@ -20,12 +23,14 @@ class ImportDetails
|
|||||||
|
|
||||||
$collection = [];
|
$collection = [];
|
||||||
foreach ($chunk as $row) {
|
foreach ($chunk as $row) {
|
||||||
|
self::$teams[] = $row['ss_team_id'];
|
||||||
if ($row['player_name'] != '') {
|
if ($row['player_name'] != '') {
|
||||||
$row['is_active'] = 1;
|
$row['is_active'] = 1;
|
||||||
$row['last_import'] = 'yes';
|
$row['last_import'] = 'yes';
|
||||||
$row['birthdate'] = isset($row['birthday']) ? Carbon::parse($row['birthday'])->format('Y-m-d') : '';
|
$row['birthdate'] = isset($row['birthday']) ? Carbon::parse($row['birthday'])->format('Y-m-d') : '';
|
||||||
unset($row['birthday']);
|
unset($row['birthday']);
|
||||||
$row['last_update'] = Carbon::parse($row['last_update'])->format('Y-m-d H:i:s');
|
$row['last_update'] = Carbon::parse($row['last_update'])->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
$collection[] = $row;
|
$collection[] = $row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,9 +52,12 @@ class ImportDetails
|
|||||||
'last_update',
|
'last_update',
|
||||||
'is_active',
|
'is_active',
|
||||||
'last_import',
|
'last_import',
|
||||||
|
'betradar_player_id',
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
StatistikoDetail::where('last_import', 'no')->update(['is_active' => 0, 'ss_team_id' => 0]);
|
self::$teams = array_unique(self::$teams);
|
||||||
|
|
||||||
|
// StatistikoDetail::where('last_import', 'no')->whereIn('ss_team_id', self::$teams)->update(['is_active' => 0, 'ss_team_id' => 0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,7 @@ class ImportEvents
|
|||||||
{
|
{
|
||||||
$now = now()->format('Y-m-d H:i:s');
|
$now = now()->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
SimpleExcelReader::create(storage_path('app/public/' . $filePath))
|
SimpleExcelReader::create(storage_path('app/public/'.$filePath))
|
||||||
->getRows()
|
->getRows()
|
||||||
->chunk(1000)
|
->chunk(1000)
|
||||||
->each(function (LazyCollection $chunk) use ($now) {
|
->each(function (LazyCollection $chunk) use ($now) {
|
||||||
@@ -26,11 +26,11 @@ class ImportEvents
|
|||||||
* exp_home, exp_away, exp_handicap, exp_total
|
* exp_home, exp_away, exp_handicap, exp_total
|
||||||
*/
|
*/
|
||||||
if (
|
if (
|
||||||
(float) $row[21] != 0
|
(float) $row[23] != 0
|
||||||
&& (float) $row[22] != 0
|
|
||||||
&& (float) $row[23] != 0
|
|
||||||
&& (float) $row[24] != 0
|
&& (float) $row[24] != 0
|
||||||
&& (string) $row[25] != ''
|
&& (float) $row[25] != 0
|
||||||
|
&& (float) $row[26] != 0
|
||||||
|
&& (string) $row[27] != ''
|
||||||
) {
|
) {
|
||||||
|
|
||||||
StatistikoEvent::updateOrCreate(
|
StatistikoEvent::updateOrCreate(
|
||||||
@@ -58,11 +58,13 @@ class ImportEvents
|
|||||||
'tsh_a' => (int) $row[18],
|
'tsh_a' => (int) $row[18],
|
||||||
'crd_h' => (int) $row[19],
|
'crd_h' => (int) $row[19],
|
||||||
'crd_a' => (int) $row[20],
|
'crd_a' => (int) $row[20],
|
||||||
'exp_home' => (float) $row[21],
|
'wfl_h' => (int) $row[21],
|
||||||
'exp_away' => (float) $row[22],
|
'wfl_a' => (int) $row[22],
|
||||||
'exp_handicap' => (float) $row[23],
|
'exp_home' => (float) $row[23],
|
||||||
'exp_total' => (float) $row[24],
|
'exp_away' => (float) $row[24],
|
||||||
'result_code' => (string) $row[25], // w, d, l
|
'exp_handicap' => (float) $row[25],
|
||||||
|
'exp_total' => (float) $row[26],
|
||||||
|
'result_code' => (string) $row[27], // w, d, l
|
||||||
'created_at' => $now,
|
'created_at' => $now,
|
||||||
'updated_at' => $now,
|
'updated_at' => $now,
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class ImportFixtures
|
|||||||
{
|
{
|
||||||
public static function run(string $filePath): void
|
public static function run(string $filePath): void
|
||||||
{
|
{
|
||||||
SimpleExcelReader::create(storage_path('app/public/' . $filePath))
|
SimpleExcelReader::create(storage_path('app/public/'.$filePath))
|
||||||
->getRows()
|
->getRows()
|
||||||
->chunk(200)
|
->chunk(200)
|
||||||
->each(function (LazyCollection $chunk) {
|
->each(function (LazyCollection $chunk) {
|
||||||
@@ -25,11 +25,13 @@ class ImportFixtures
|
|||||||
1 => 87
|
1 => 87
|
||||||
2 => 3614
|
2 => 3614
|
||||||
3 => 1491
|
3 => 1491
|
||||||
4 => DateTimeImmutable @1777334400 {#2722 ▶}
|
4 => DateTime
|
||||||
5 => 0.90433699503783
|
5 => 0.90433699503783
|
||||||
6 => 1.035168989838
|
6 => 1.035168989838
|
||||||
|
7 => betradar_id
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (\count($row) == 8) {
|
||||||
StatisticFixtures::updateOrCreate(
|
StatisticFixtures::updateOrCreate(
|
||||||
[
|
[
|
||||||
'sport_id' => (int) $row[0],
|
'sport_id' => (int) $row[0],
|
||||||
@@ -38,9 +40,14 @@ class ImportFixtures
|
|||||||
'away_id' => (int) $row[3],
|
'away_id' => (int) $row[3],
|
||||||
'starttime' => Carbon::parse($row[4])->toDateTimeString(),
|
'starttime' => Carbon::parse($row[4])->toDateTimeString(),
|
||||||
],
|
],
|
||||||
['exp_home' => (float) $row[5], 'exp_away' => (float) $row[6]]
|
[
|
||||||
|
'exp_home' => (float) $row[5],
|
||||||
|
'exp_away' => (float) $row[6],
|
||||||
|
'betradar_id' => (int) $row[7],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Imports\Helper;
|
||||||
|
|
||||||
|
use App\Models\SofaScoreRosaTournament;
|
||||||
|
use Illuminate\Support\LazyCollection;
|
||||||
|
use Spatie\SimpleExcel\SimpleExcelReader;
|
||||||
|
|
||||||
|
class ImportTeamsTournaments
|
||||||
|
{
|
||||||
|
public static $active_tournament = [];
|
||||||
|
|
||||||
|
public static function run(string $filePath): void
|
||||||
|
{
|
||||||
|
SofaScoreRosaTournament::query()->update(['in_update' => 0]);
|
||||||
|
|
||||||
|
SimpleExcelReader::create(storage_path('app/public/'.$filePath))
|
||||||
|
->getRows()
|
||||||
|
->chunk(100)
|
||||||
|
->each(function (LazyCollection $chunk) {
|
||||||
|
|
||||||
|
foreach ($chunk as $row) {
|
||||||
|
|
||||||
|
$row = array_values($row);
|
||||||
|
|
||||||
|
$ss_tournament_id = (int) $row[0];
|
||||||
|
|
||||||
|
$ss_team_id = (int) $row[1];
|
||||||
|
|
||||||
|
if ($ss_tournament_id && $ss_team_id) {
|
||||||
|
|
||||||
|
self::$active_tournament[] = $row[0];
|
||||||
|
|
||||||
|
SofaScoreRosaTournament::updateOrCreate(
|
||||||
|
['ss_tournament_id' => $ss_tournament_id, 'ss_team_id' => $ss_team_id],
|
||||||
|
['in_update' => 1]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$tournaments = array_unique(self::$active_tournament);
|
||||||
|
|
||||||
|
SofaScoreRosaTournament::where('in_update', 0)->whereIn('ss_tournament_id', $tournaments)->delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ use App\Filament\Imports\Helper\ImportDetails;
|
|||||||
use App\Filament\Imports\Helper\ImportEvents;
|
use App\Filament\Imports\Helper\ImportEvents;
|
||||||
use App\Filament\Imports\Helper\ImportFixtures;
|
use App\Filament\Imports\Helper\ImportFixtures;
|
||||||
use App\Filament\Imports\Helper\ImportPlayer;
|
use App\Filament\Imports\Helper\ImportPlayer;
|
||||||
|
use App\Filament\Imports\Helper\ImportTeamsTournaments;
|
||||||
use App\Models\StatistikoImport;
|
use App\Models\StatistikoImport;
|
||||||
|
|
||||||
class StatistikoImporter
|
class StatistikoImporter
|
||||||
@@ -44,6 +45,10 @@ class StatistikoImporter
|
|||||||
case 'player':
|
case 'player':
|
||||||
ImportPlayer::run($filePath);
|
ImportPlayer::run($filePath);
|
||||||
break;
|
break;
|
||||||
|
case 'teams_tornaments':
|
||||||
|
ImportTeamsTournaments::run($filePath);
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StatistikoImport::query()->where('id', $record->id)->update(['has_run' => 1]);
|
StatistikoImport::query()->where('id', $record->id)->update(['has_run' => 1]);
|
||||||
|
|||||||
+198
-105
@@ -11,6 +11,9 @@ use App\Models\SofaScoreRosa;
|
|||||||
use App\Models\SsLineupMemory;
|
use App\Models\SsLineupMemory;
|
||||||
use App\Models\StatisticFixtures;
|
use App\Models\StatisticFixtures;
|
||||||
use BackedEnum;
|
use BackedEnum;
|
||||||
|
use Filament\Actions\Action;
|
||||||
|
use Filament\Forms\Components\DatePicker;
|
||||||
|
use Filament\Forms\Components\Radio;
|
||||||
use Filament\Forms\Components\Select;
|
use Filament\Forms\Components\Select;
|
||||||
use Filament\Forms\Concerns\InteractsWithForms;
|
use Filament\Forms\Concerns\InteractsWithForms;
|
||||||
use Filament\Forms\Contracts\HasForms;
|
use Filament\Forms\Contracts\HasForms;
|
||||||
@@ -20,7 +23,6 @@ use Filament\Schemas\Components\Utilities\Get;
|
|||||||
use Filament\Schemas\Components\Utilities\Set;
|
use Filament\Schemas\Components\Utilities\Set;
|
||||||
use Filament\Schemas\Schema;
|
use Filament\Schemas\Schema;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
use Livewire\Attributes\On;
|
use Livewire\Attributes\On;
|
||||||
|
|
||||||
class PlayerProps extends Page implements HasForms
|
class PlayerProps extends Page implements HasForms
|
||||||
@@ -36,7 +38,7 @@ class PlayerProps extends Page implements HasForms
|
|||||||
->group(static::getNavigationGroup())
|
->group(static::getNavigationGroup())
|
||||||
->icon(static::getNavigationIcon())
|
->icon(static::getNavigationIcon())
|
||||||
->activeIcon(static::getActiveNavigationIcon())
|
->activeIcon(static::getActiveNavigationIcon())
|
||||||
->isActiveWhen(fn() => request()->routeIs(static::getRouteName()))
|
->isActiveWhen(fn () => request()->routeIs(static::getRouteName()))
|
||||||
->sort(static::getNavigationSort())
|
->sort(static::getNavigationSort())
|
||||||
->url(static::getUrl(), shouldOpenInNewTab: true), // 👈 Forces target="_blank"
|
->url(static::getUrl(), shouldOpenInNewTab: true), // 👈 Forces target="_blank"
|
||||||
];
|
];
|
||||||
@@ -83,113 +85,19 @@ class PlayerProps extends Page implements HasForms
|
|||||||
return $schema
|
return $schema
|
||||||
->columns(5)
|
->columns(5)
|
||||||
->components([
|
->components([
|
||||||
Select::make('cid')
|
$this->selectCountry(),
|
||||||
->live()
|
$this->selectLeague(),
|
||||||
->preload()
|
$this->selectMatch(),
|
||||||
->searchable(false)
|
$this->selectTeam(),
|
||||||
->prefixIconColor(fn(Get $get): string => $get('cid') ? 'success' : 'danger')
|
$this->selectLineup(),
|
||||||
->prefixIcon('phosphor-globe-fill')
|
$this->radioSeasonOrDate(),
|
||||||
->hiddenLabel()
|
$this->datePickerStartDate(),
|
||||||
->options(fn() => LoadSofaScoreCategory::load())
|
$this->datePickerEndDate(),
|
||||||
->placeholder('Country')
|
|
||||||
->afterStateUpdated(function (callable $set, $state) {
|
|
||||||
$set('lid', null);
|
|
||||||
$set('mid', null);
|
|
||||||
$set('tid', null);
|
|
||||||
$this->dispatch('clear-all');
|
|
||||||
}),
|
|
||||||
Select::make('lid')
|
|
||||||
->live()
|
|
||||||
->preload()
|
|
||||||
->prefixIconColor(fn(Get $get): string => $get('lid') ? 'success' : 'danger')
|
|
||||||
->prefixIcon('phosphor-trophy-fill')
|
|
||||||
->hiddenLabel()
|
|
||||||
->options(fn(Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('cid')))
|
|
||||||
->placeholder('League')
|
|
||||||
->afterStateUpdated(function (callable $set) {
|
|
||||||
$set('mid', null);
|
|
||||||
$set('tid', null);
|
|
||||||
$this->dispatch('clear-all');
|
|
||||||
}),
|
|
||||||
Select::make('mid')
|
|
||||||
->live()
|
|
||||||
->hiddenLabel()
|
|
||||||
->prefixIconColor(fn(Get $get): string => $get('mid') ? 'success' : 'danger')
|
|
||||||
->prefixIcon('phosphor-calendar-check-fill')
|
|
||||||
->options(function (Get $get) {
|
|
||||||
return LoadStatisticFixturesMatchOptions::load($get('lid'));
|
|
||||||
})
|
|
||||||
->afterStateUpdated(function (callable $set, $state) {
|
|
||||||
$set('tid', null);
|
|
||||||
if ($state) {
|
|
||||||
$this->dispatch('match-update', match_id: $state);
|
|
||||||
} else {
|
|
||||||
$this->dispatch('clear-all');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->placeholder('Events'),
|
|
||||||
|
|
||||||
Select::make('tid')
|
|
||||||
->live()
|
|
||||||
->hiddenLabel()
|
|
||||||
->prefixIconColor(fn(Get $get): string => $get('tid') ? 'success' : 'danger')
|
|
||||||
->prefixIcon('icon-player')
|
|
||||||
->options(function (Get $get) {
|
|
||||||
if ($get('mid')) {
|
|
||||||
$res = StatisticFixtures::where('id', $get('mid'))->first();
|
|
||||||
|
|
||||||
$arr = [];
|
|
||||||
if ($res) {
|
|
||||||
$arr[$res->home_id] = SofaScoreRosa::query()->where('ss_team_id', $res->home_id)->value('ss_team_name');
|
|
||||||
$arr[$res->away_id] = SofaScoreRosa::query()->where('ss_team_id', $res->away_id)->value('ss_team_name');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $arr;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->placeholder('Team')
|
|
||||||
->afterStateUpdated(function ($state, Set $set) {
|
|
||||||
if ($state) {
|
|
||||||
$this->dispatch('team-update', team_id: $state);
|
|
||||||
$tmp = SsLineupMemory::where('client_id', Auth::user()->client_id)->where('team_id', $state)->orderBy('created_at', 'desc')->first();
|
|
||||||
if ($tmp) {
|
|
||||||
$set('lineup', $tmp->lineup);
|
|
||||||
$this->dispatch('lineup-update', activeLineUp: $tmp->lineup);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
Select::make('lineup')
|
|
||||||
->live()
|
|
||||||
->hiddenLabel()
|
|
||||||
->allowHtml()
|
|
||||||
->native(false)
|
|
||||||
->selectablePlaceholder(false)
|
|
||||||
->prefixIconColor('info')
|
|
||||||
->prefixIcon('icon-soccerfield-fill')
|
|
||||||
->options(function () {
|
|
||||||
$res = $this->lineUpOptions();
|
|
||||||
$arr = [];
|
|
||||||
foreach ($res as $key => $value) {
|
|
||||||
if ($this->players && in_array($key, $this->clientLineUps)) {
|
|
||||||
$arr[$key] = $value . '<span class="text-blue-600"> has lineup</span>';
|
|
||||||
} else {
|
|
||||||
$arr[$key] = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $arr;
|
|
||||||
})
|
|
||||||
->placeholder('LineUp')
|
|
||||||
->searchable()
|
|
||||||
->default($this->activeLineUp)
|
|
||||||
->afterStateUpdated(function ($state) {
|
|
||||||
$this->dispatch('lineup-update', activeLineUp: $state);
|
|
||||||
}),
|
|
||||||
])->statePath('filterData');
|
])->statePath('filterData');
|
||||||
}
|
}
|
||||||
|
|
||||||
#[On('team-update')]
|
#[On('team-update')]
|
||||||
public function syncData(?int $team_id)
|
public function syncData($team_id)
|
||||||
{
|
{
|
||||||
if ($team_id) {
|
if ($team_id) {
|
||||||
$this->team_id = $team_id;
|
$this->team_id = $team_id;
|
||||||
@@ -206,6 +114,12 @@ class PlayerProps extends Page implements HasForms
|
|||||||
$this->players = $players;
|
$this->players = $players;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[On('update-lineup')]
|
||||||
|
public function updateLineup(string $lineup_name)
|
||||||
|
{
|
||||||
|
$this->filterData['lineup'] = $lineup_name;
|
||||||
|
}
|
||||||
|
|
||||||
protected function getFooterWidgets(): array
|
protected function getFooterWidgets(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -273,4 +187,183 @@ class PlayerProps extends Page implements HasForms
|
|||||||
'541+' => '541+',
|
'541+' => '541+',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function selectTeam(): Select
|
||||||
|
{
|
||||||
|
return Select::make('tid')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->prefixIconColor(fn (Get $get): string => $get('tid') ? 'success' : 'danger')
|
||||||
|
->prefixIcon('icon-player')
|
||||||
|
->options(function (Get $get) {
|
||||||
|
if ($get('mid')) {
|
||||||
|
$res = StatisticFixtures::where('id', $get('mid'))->first();
|
||||||
|
|
||||||
|
$arr = [];
|
||||||
|
if ($res) {
|
||||||
|
$arr[$res->home_id] = SofaScoreRosa::query()->where('ss_team_id', $res->home_id)->value('ss_team_name');
|
||||||
|
$arr[$res->away_id] = SofaScoreRosa::query()->where('ss_team_id', $res->away_id)->value('ss_team_name');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $arr;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->placeholder('Team')
|
||||||
|
->afterStateUpdated(function ($state, Set $set) {
|
||||||
|
if ($state) {
|
||||||
|
$this->dispatch('team-update', team_id: $state);
|
||||||
|
$tmp = SsLineupMemory::where('client_id', Auth::user()->client_id)->where('team_id', $state)->orderBy('created_at', 'desc')->first();
|
||||||
|
if ($tmp) {
|
||||||
|
$set('lineup', $tmp->lineup);
|
||||||
|
$this->dispatch('lineup-update', activeLineUp: $tmp->lineup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function selectLeague(): Select
|
||||||
|
{
|
||||||
|
return Select::make('lid')
|
||||||
|
->live()
|
||||||
|
->preload()
|
||||||
|
->prefixIconColor(fn (Get $get): string => $get('lid') ? 'success' : 'danger')
|
||||||
|
->prefixIcon('phosphor-trophy-fill')
|
||||||
|
->hiddenLabel()
|
||||||
|
->options(fn (Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('cid')))
|
||||||
|
->placeholder('League')
|
||||||
|
->afterStateUpdated(function (callable $set) {
|
||||||
|
$set('mid', null);
|
||||||
|
$set('tid', null);
|
||||||
|
$this->dispatch('clear-all');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function selectMatch(): Select
|
||||||
|
{
|
||||||
|
return Select::make('mid')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->prefixIconColor(fn (Get $get): string => $get('mid') ? 'success' : 'danger')
|
||||||
|
->prefixIcon('phosphor-calendar-check-fill')
|
||||||
|
->options(function (Get $get) {
|
||||||
|
return LoadStatisticFixturesMatchOptions::load($get('lid'));
|
||||||
|
})
|
||||||
|
->afterStateUpdated(function (callable $set, $state) {
|
||||||
|
$set('tid', null);
|
||||||
|
if ($state) {
|
||||||
|
$this->dispatch('match-update', match_id: $state);
|
||||||
|
} else {
|
||||||
|
$this->dispatch('clear-all');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->placeholder('Events');
|
||||||
|
}
|
||||||
|
|
||||||
|
private function selectLineup(): Select
|
||||||
|
{
|
||||||
|
return Select::make('lineup')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->allowHtml()
|
||||||
|
->native(false)
|
||||||
|
->selectablePlaceholder(false)
|
||||||
|
->prefixIconColor('info')
|
||||||
|
->prefixIcon('icon-soccerfield-fill')
|
||||||
|
->options(function () {
|
||||||
|
$res = $this->lineUpOptions();
|
||||||
|
$arr = [];
|
||||||
|
foreach ($res as $key => $value) {
|
||||||
|
$arr[$key] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $arr;
|
||||||
|
})
|
||||||
|
->placeholder('LineUp')
|
||||||
|
->searchable()
|
||||||
|
->default($this->activeLineUp)
|
||||||
|
->afterStateUpdated(function ($state) {
|
||||||
|
$this->dispatch('lineup-update', activeLineUp: $state);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function selectCountry(): Select
|
||||||
|
{
|
||||||
|
return Select::make('cid')
|
||||||
|
->live()
|
||||||
|
->preload()
|
||||||
|
->searchable(false)
|
||||||
|
->prefixIconColor(fn (Get $get): string => $get('cid') ? 'success' : 'danger')
|
||||||
|
->prefixIcon('phosphor-globe-fill')
|
||||||
|
->hiddenLabel()
|
||||||
|
->options(fn () => LoadSofaScoreCategory::load())
|
||||||
|
->placeholder('Country')
|
||||||
|
->afterStateUpdated(function (callable $set, $state) {
|
||||||
|
$set('lid', null);
|
||||||
|
$set('mid', null);
|
||||||
|
$set('tid', null);
|
||||||
|
$this->dispatch('clear-all');
|
||||||
|
$this->dispatch('season_mode-update', $state);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function radioSeasonOrDate(): Radio
|
||||||
|
{
|
||||||
|
return Radio::make('season_or_date')
|
||||||
|
->live()
|
||||||
|
->extraAttributes([
|
||||||
|
'class' => 'radio-statistic-group',
|
||||||
|
])
|
||||||
|
->columnSpan(2)
|
||||||
|
->inline()
|
||||||
|
->default('season')
|
||||||
|
->hiddenLabel()
|
||||||
|
->options([
|
||||||
|
'season' => 'Active Season',
|
||||||
|
'date' => 'Date',
|
||||||
|
])->afterStateUpdated(function ($state) {
|
||||||
|
$this->dispatch('season_or_date-update', season_or_date: $state);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function datePickerStartDate(): DatePicker
|
||||||
|
{
|
||||||
|
return DatePicker::make('start_date')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->hidden(fn (Get $get) => $get('season_or_date') == 'season')
|
||||||
|
->native(false)
|
||||||
|
->prefixIconColor(fn (Get $get): string => $get('start_date') ? 'success' : 'primary')
|
||||||
|
->prefixIcon('phosphor-calendar')
|
||||||
|
->prefix('Start')
|
||||||
|
->closeOnDateSelection()
|
||||||
|
->suffixAction(
|
||||||
|
Action::make('clear_start')
|
||||||
|
->icon('phosphor-x')
|
||||||
|
->color('gray')
|
||||||
|
->action(fn (Set $set) => $set('start_date', null))
|
||||||
|
)->afterStateUpdated(function ($state) {
|
||||||
|
$this->dispatch('start_date-update', start_date: $state);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function datePickerEndDate(): DatePicker
|
||||||
|
{
|
||||||
|
return DatePicker::make('end_date')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->hidden(fn (Get $get) => $get('season_or_date') == 'season')
|
||||||
|
->native(false)
|
||||||
|
->prefixIconColor(fn (Get $get): string => $get('end_date') ? 'success' : 'primary')
|
||||||
|
->prefixIcon('phosphor-calendar')
|
||||||
|
->prefix('End')
|
||||||
|
->closeOnDateSelection()
|
||||||
|
->suffixAction(
|
||||||
|
Action::make('clear_end')
|
||||||
|
->icon('phosphor-x')
|
||||||
|
->color('gray')
|
||||||
|
->action(fn (Set $set) => $set('end_date', null))
|
||||||
|
)->afterStateUpdated(function ($state) {
|
||||||
|
$this->dispatch('end_date-update', end_date: $state);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,14 +6,14 @@ use Illuminate\Support\Carbon;
|
|||||||
|
|
||||||
class GetSeason
|
class GetSeason
|
||||||
{
|
{
|
||||||
public static function load(?array $season, ?string $seasonmode)
|
public static function load(?array $season, ?string $season_mode)
|
||||||
{
|
{
|
||||||
if (! \is_array($season) || ! \count($season)) {
|
if (! \is_array($season) || ! \count($season)) {
|
||||||
|
|
||||||
$date = Carbon::now();
|
$date = Carbon::now();
|
||||||
|
|
||||||
$season = [];
|
$season = [];
|
||||||
if ($seasonmode == 'halfyear') {
|
if ($season_mode == 'halfyear') {
|
||||||
if ((int) date('m') > 7) {
|
if ((int) date('m') > 7) {
|
||||||
$season[] = (string) $date->format('y').'/'.$date->format('y') + 1;
|
$season[] = (string) $date->format('y').'/'.$date->format('y') + 1;
|
||||||
} else {
|
} else {
|
||||||
@@ -27,13 +27,13 @@ class GetSeason
|
|||||||
return $season;
|
return $season;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function active(?string $seasonmode)
|
public static function active(?string $season_mode)
|
||||||
{
|
{
|
||||||
|
|
||||||
$date = Carbon::now();
|
$date = Carbon::now();
|
||||||
|
|
||||||
$active_season = '';
|
$active_season = '';
|
||||||
if ($seasonmode == 'halfyear') {
|
if ($season_mode == 'halfyear') {
|
||||||
if ((int) date('m') > 7) {
|
if ((int) date('m') > 7) {
|
||||||
$active_season = (string) $date->format('y').'/'.$date->format('y') + 1;
|
$active_season = (string) $date->format('y').'/'.$date->format('y') + 1;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -3,20 +3,19 @@
|
|||||||
namespace App\Filament\Pages\Selections;
|
namespace App\Filament\Pages\Selections;
|
||||||
|
|
||||||
use App\Filament\Pages\Selections\Helper\GetSeason;
|
use App\Filament\Pages\Selections\Helper\GetSeason;
|
||||||
use App\Models\SofaScorePlayerPerSeason;
|
use App\Models\StatistikoDetail;
|
||||||
use App\Models\StatistikoEvent;
|
use App\Models\StatistikoEvent;
|
||||||
|
use App\Models\StatistikoPlayer;
|
||||||
|
|
||||||
class LoadPlayerSelection
|
class LoadPlayerSelection
|
||||||
{
|
{
|
||||||
public static function load(?int $team_id, ?string $team_position, ?int $sofascore_category_id, ?array $season, ?string $seasonmode)
|
public static function load(?array $arr)
|
||||||
{
|
{
|
||||||
$season = GetSeason::load($season, $seasonmode);
|
$team_id = $arr['team_id'];
|
||||||
|
|
||||||
// $hash = hash('crc32', $team_id.$team_position.$sofascore_category_id.serialize($season));
|
$team_position = $arr['team_position'];
|
||||||
// $cached_players = SofaScorePlayerCache::where('hash', $hash)->value('players');
|
|
||||||
// if ($cached_players) {
|
$season = GetSeason::load($arr['season'], $arr['season_mode']);
|
||||||
// return $cached_players;
|
|
||||||
// }
|
|
||||||
|
|
||||||
$matches = StatistikoEvent::whereIn('season', $season)
|
$matches = StatistikoEvent::whereIn('season', $season)
|
||||||
->where(function ($query) use ($team_id, $team_position) {
|
->where(function ($query) use ($team_id, $team_position) {
|
||||||
@@ -29,34 +28,49 @@ class LoadPlayerSelection
|
|||||||
return $query->where('home_id', '=', $team_id)
|
return $query->where('home_id', '=', $team_id)
|
||||||
->orWhere('away_id', '=', $team_id);
|
->orWhere('away_id', '=', $team_id);
|
||||||
}
|
}
|
||||||
})->pluck('match_id')->toArray();
|
})->get();
|
||||||
|
|
||||||
$matches_count = count($matches);
|
$matches_count = $matches->count();
|
||||||
|
|
||||||
$positions_map = LoadPositions::load();
|
$positions_map = LoadPositions::load();
|
||||||
|
$player_name_map = [];
|
||||||
$player = SofaScorePlayerPerSeason::with('details')->where('ss_team_id', $team_id)->whereIn('season', $season)->get();
|
$res = StatistikoDetail::where('ss_team_id', $team_id)->get();
|
||||||
|
foreach ($res as $val) {
|
||||||
// dd($player);
|
$player_name_map[$val->ss_player_id]['name'] = $val->player_name;
|
||||||
|
$player_name_map[$val->ss_player_id]['pos'] = $val->position;
|
||||||
|
$player_name_map[$val->ss_player_id]['foot'] = $val->preferred_foot;
|
||||||
|
}
|
||||||
|
|
||||||
$arr = [];
|
$arr = [];
|
||||||
foreach ($player as $val) {
|
foreach ($matches as $match) {
|
||||||
if ($val->details) {
|
$players = StatistikoPlayer::where('match_id', $match->match_id)->get();
|
||||||
$player_id = $val->ss_player_id;
|
foreach ($players as $val) {
|
||||||
if (! isset($arr[$player_id])) {
|
$ss_player_id = (int) $val->ss_player_id;
|
||||||
$arr[$player_id]['player_name'] = $val->details->player_name;
|
|
||||||
$arr[$player_id]['events_played_home'] = $val->events_played_home;
|
if (isset($player_name_map[$ss_player_id])) {
|
||||||
$arr[$player_id]['events_played_away'] = $val->events_played_away;
|
|
||||||
$arr[$player_id]['minutes_played_home'] = $val->minutes_played_home;
|
$activeteam_id = (int) $val->activeteam_id;
|
||||||
$arr[$player_id]['minutes_played_away'] = $val->minutes_played_away;
|
$minutes_played = (int) $val->minutes_played;
|
||||||
$arr[$player_id]['preferred_foot'] = $val->details->preferred_foot ?? '';
|
|
||||||
$arr[$player_id]['player_position'] = $val->details->position ?? '';
|
if (! isset($arr[$ss_player_id])) {
|
||||||
$arr[$player_id]['color_level'] = round($matches_count / 3);
|
self::array_template($arr, $ss_player_id);
|
||||||
} else {
|
$arr[$ss_player_id]['player_name'] = $player_name_map[$ss_player_id]['name'] ?? '';
|
||||||
$arr[$player_id]['events_played_home'] += $val->events_played_home;
|
$arr[$ss_player_id]['preferred_foot'] = $player_name_map[$ss_player_id]['foot'] ?? '';
|
||||||
$arr[$player_id]['events_played_away'] += $val->events_played_away;
|
$arr[$ss_player_id]['player_position'] = $player_name_map[$ss_player_id]['pos'] ?? '';
|
||||||
$arr[$player_id]['minutes_played_home'] += $val->minutes_played_home;
|
$arr[$ss_player_id]['color_level'] = round($matches_count / 3);
|
||||||
$arr[$player_id]['minutes_played_away'] += $val->minutes_played_away;
|
}
|
||||||
|
|
||||||
|
if ($activeteam_id == $match->home_id) {
|
||||||
|
$arr[$ss_player_id]['events_played_home'] += 1;
|
||||||
|
$arr[$ss_player_id]['minutes_played_home'] += $minutes_played;
|
||||||
|
$arr[$ss_player_id]['events_played_home'] += 1;
|
||||||
|
$arr[$ss_player_id]['minutes_played_home'] += $minutes_played;
|
||||||
|
} elseif ($activeteam_id == $match->away_id) {
|
||||||
|
$arr[$ss_player_id]['events_played_away'] += 1;
|
||||||
|
$arr[$ss_player_id]['minutes_played_away'] += $minutes_played;
|
||||||
|
$arr[$ss_player_id]['events_played_away'] += 1;
|
||||||
|
$arr[$ss_player_id]['minutes_played_away'] += $minutes_played;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -130,4 +144,16 @@ class LoadPlayerSelection
|
|||||||
|
|
||||||
return sprintf($format, $hours, $minutes);
|
return sprintf($format, $hours, $minutes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function array_template(array &$arr, int $ss_player_id)
|
||||||
|
{
|
||||||
|
$arr[$ss_player_id]['ss_player_id'] = 0;
|
||||||
|
$arr[$ss_player_id]['color_level'] = 0;
|
||||||
|
$arr[$ss_player_id]['preferred_foot'] = '';
|
||||||
|
$arr[$ss_player_id]['player_position'] = '';
|
||||||
|
$arr[$ss_player_id]['events_played_home'] = 0;
|
||||||
|
$arr[$ss_player_id]['events_played_away'] = 0;
|
||||||
|
$arr[$ss_player_id]['minutes_played_home'] = 0;
|
||||||
|
$arr[$ss_player_id]['minutes_played_away'] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,20 +7,21 @@ use Illuminate\Support\Carbon;
|
|||||||
|
|
||||||
class LoadSeasons
|
class LoadSeasons
|
||||||
{
|
{
|
||||||
public static function load($seasonmode)
|
public static function load(string $season_mode)
|
||||||
{
|
{
|
||||||
if (!$seasonmode) {
|
if (! $season_mode) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$season = [];
|
$season = [];
|
||||||
$period = CarbonPeriod::create(Carbon::now()->year(2024), '1 year', Carbon::now());
|
$period = CarbonPeriod::create(Carbon::now()->year(2024), '1 year', Carbon::now());
|
||||||
foreach ($period as $date) {
|
foreach ($period as $date) {
|
||||||
if ($seasonmode == 'halfyear') {
|
if ($season_mode == 'halfyear') {
|
||||||
if ((int) date('m') > 7)
|
if ((int) date('m') > 7) {
|
||||||
$tmp = $date->format('y') . '/' . $date->format('y') + 1;
|
$tmp = $date->format('y').'/'.$date->format('y') + 1;
|
||||||
else
|
} else {
|
||||||
$tmp = $date->format('y') - 1 . '/' . $date->format('y');
|
$tmp = $date->format('y') - 1 .'/'.$date->format('y');
|
||||||
|
}
|
||||||
$season[$tmp] = $tmp;
|
$season[$tmp] = $tmp;
|
||||||
} else {
|
} else {
|
||||||
$season[(string) $date->year] = (string) $date->year;
|
$season[(string) $date->year] = (string) $date->year;
|
||||||
|
|||||||
+441
-376
@@ -26,7 +26,7 @@ use Filament\Schemas\Components\Grid;
|
|||||||
use Filament\Schemas\Components\Utilities\Get;
|
use Filament\Schemas\Components\Utilities\Get;
|
||||||
use Filament\Schemas\Components\Utilities\Set;
|
use Filament\Schemas\Components\Utilities\Set;
|
||||||
use Filament\Schemas\Schema;
|
use Filament\Schemas\Schema;
|
||||||
use Filament\Support\Enums\Size;
|
use Filament\Support\Enums\Alignment;
|
||||||
use Filament\Support\RawJs;
|
use Filament\Support\RawJs;
|
||||||
use Illuminate\Contracts\Support\Htmlable;
|
use Illuminate\Contracts\Support\Htmlable;
|
||||||
use Illuminate\Support\HtmlString;
|
use Illuminate\Support\HtmlString;
|
||||||
@@ -37,6 +37,8 @@ class Statistic extends BaseDashboard
|
|||||||
|
|
||||||
protected static string|BackedEnum|null $navigationIcon = 'phosphor-chart-line-up';
|
protected static string|BackedEnum|null $navigationIcon = 'phosphor-chart-line-up';
|
||||||
|
|
||||||
|
protected ?Alignment $headerActionsAlignment = Alignment::End;
|
||||||
|
|
||||||
protected string $view = 'filament.pages.statistic';
|
protected string $view = 'filament.pages.statistic';
|
||||||
|
|
||||||
protected ?string $pollingInterval = null;
|
protected ?string $pollingInterval = null;
|
||||||
@@ -82,34 +84,33 @@ class Statistic extends BaseDashboard
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// protected function getHeaderActions(): array
|
/**
|
||||||
|
* Diese Methode liefert das Daten-Array für ALLE Widgets.
|
||||||
|
* Durch 'once()' läuft die Query pro Request exakt 1x.
|
||||||
|
*/
|
||||||
|
// public function getSharedWidgetData(): array
|
||||||
// {
|
// {
|
||||||
// return [
|
// return once(function () {
|
||||||
// Action::make('esc')
|
// $filters = $this->getFilters();
|
||||||
// ->label('Reset')
|
|
||||||
// ->icon('phosphor-x-circle')
|
// // Ihre MongoDB / Eloquent Query basierend auf den aktuellen Filtern
|
||||||
// ->color('gray')
|
// return Order::query()
|
||||||
// ->keyBindings(['esc'])
|
// ->when($filters['start_date'] ?? null, fn ($q, $date) => $q->where('created_at', '>=', $date))
|
||||||
// ->action('resetFilters'),
|
// ->when($filters['status'] ?? null, fn ($q, $status) => $q->where('status', $status))
|
||||||
// Action::make('openDispatcherBoard')
|
// ->selectRaw('count(*) as total_count, sum(total_price) as total_revenue, avg(total_price) as average_amount')
|
||||||
// ->modalHeading('')
|
// ->first()
|
||||||
// ->label('Calculate')
|
// ->toArray();
|
||||||
// ->icon('icon-player')
|
// });
|
||||||
// ->color(fn (): string => $this->filters['team_id'] ? 'primary' : 'gray')
|
|
||||||
// ->disabled(fn (): string => $this->filters['team_id'] ? false : true)
|
|
||||||
// ->slideOver()
|
|
||||||
// ->slideOverPosition(SlideOverPosition::Start)
|
|
||||||
// ->modalWidth(Width::Screen)
|
|
||||||
// ->modalSubmitAction(false)
|
|
||||||
// ->modalCancelAction(false)
|
|
||||||
// ->modalContent(fn (): View => view('livewire.board-dispatcher-modal-wrapper', ['filters' => $this->filters])),
|
|
||||||
// ];
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// // Im Widget -> Nutzt exakt dasselbe Array aus dem Speicher
|
||||||
|
// $sharedData = $this->getPage()->getSharedWidgetData();
|
||||||
|
|
||||||
public function filtersForm(Schema $schema): Schema
|
public function filtersForm(Schema $schema): Schema
|
||||||
{
|
{
|
||||||
return $schema
|
return $schema
|
||||||
->components([
|
->components([
|
||||||
|
// change sport TODO
|
||||||
// ToggleButtons::make('status')
|
// ToggleButtons::make('status')
|
||||||
// ->columnSpanFull()
|
// ->columnSpanFull()
|
||||||
// ->hiddenLabel()
|
// ->hiddenLabel()
|
||||||
@@ -131,369 +132,25 @@ class Statistic extends BaseDashboard
|
|||||||
Grid::make([
|
Grid::make([
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
'sm' => 2,
|
'sm' => 2,
|
||||||
'md' => 5,
|
'md' => 6,
|
||||||
])
|
])
|
||||||
->columnSpanFull()
|
->columnSpanFull()
|
||||||
->schema([
|
->schema([
|
||||||
Hidden::make('seasonmode'),
|
Hidden::make('season_mode'),
|
||||||
Select::make('sofascore_category_id')
|
$this->selectSofascoreCategoryId(),
|
||||||
->live()
|
$this->selectLeagueId(),
|
||||||
->preload()
|
$this->selectMatchId(),
|
||||||
->searchable(false)
|
$this->selectTeamId(),
|
||||||
->prefixIconColor(fn (Get $get): string => $get('sofascore_category_id') ? 'success' : 'danger')
|
$this->selectTeamPosition(),
|
||||||
->prefixIcon('phosphor-globe')
|
|
||||||
->hiddenLabel()
|
|
||||||
->options(fn () => LoadSofaScoreCategory::load())
|
|
||||||
->placeholder('Select Country')
|
|
||||||
->afterStateUpdated(function (callable $set, $state) {
|
|
||||||
$set('seasonmode', SofaScoreCategory::where('id', $state)->value('season_mode'));
|
|
||||||
$set('league_id', null);
|
|
||||||
$set('match_id', null);
|
|
||||||
$set('team_id', null);
|
|
||||||
$set('ss_player_id', null);
|
|
||||||
$set('season', null);
|
|
||||||
}),
|
|
||||||
Select::make('league_id')
|
|
||||||
->live()
|
|
||||||
->preload()
|
|
||||||
->prefixIconColor(fn (Get $get): string => $get('league_id') ? 'success' : 'danger')
|
|
||||||
->prefixIcon('phosphor-trophy')
|
|
||||||
->hiddenLabel()
|
|
||||||
->options(fn (Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id')))
|
|
||||||
->placeholder('Select League')
|
|
||||||
->afterStateUpdated(function (callable $set) {
|
|
||||||
$set('match_id', null);
|
|
||||||
$set('team_id', null);
|
|
||||||
$set('ss_player_id', null);
|
|
||||||
$this->dispatch('reset-tab');
|
|
||||||
}),
|
|
||||||
Select::make('match_id')
|
|
||||||
->live()
|
|
||||||
->hiddenLabel()
|
|
||||||
->columnSpan(fn (Get $get) => $get('similar_past_matches') != 'none' ? 2 : 1)
|
|
||||||
->prefixIconColor(fn (Get $get): string => $get('match_id') ? 'success' : 'danger')
|
|
||||||
->prefixIcon('phosphor-calendar-check')
|
|
||||||
->options(function (Get $get) {
|
|
||||||
return LoadStatisticFixturesMatchOptions::load($get('league_id'));
|
|
||||||
})
|
|
||||||
->afterStateUpdated(function (callable $set) {
|
|
||||||
$set('team_id', null);
|
|
||||||
$set('ss_player_id', null);
|
|
||||||
$this->dispatch('reset-tab');
|
|
||||||
})
|
|
||||||
->placeholder('Select Event'),
|
|
||||||
Action::make('esc')
|
|
||||||
->hiddenLabel()
|
|
||||||
->visible(fn (Get $get) => $get('similar_past_matches') != 'none')
|
|
||||||
->tooltip('Clear All (esc)')
|
|
||||||
->icon('phosphor-x-circle')
|
|
||||||
->color('danger')
|
|
||||||
->keyBindings(['esc'])
|
|
||||||
->size(Size::Medium)
|
|
||||||
->outlined()
|
|
||||||
->action('resetFilters'),
|
|
||||||
|
|
||||||
Select::make('team_id')
|
|
||||||
->live()
|
|
||||||
->hiddenLabel()
|
|
||||||
->prefixIconColor(function (Get $get): string {
|
|
||||||
if ($get('team_id')) {
|
|
||||||
return 'success';
|
|
||||||
} elseif ($get('similar_past_matches') != 'none') {
|
|
||||||
return 'gray';
|
|
||||||
} else {
|
|
||||||
return 'danger';
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->prefixIcon('phosphor-users')
|
|
||||||
->suffixAction(Action::make('reset')
|
|
||||||
->icon('phosphor-x-circle')
|
|
||||||
->tooltip('Clear Team')
|
|
||||||
->action(fn (callable $set) => $set('team_id', null))
|
|
||||||
->color(fn (Get $get): string => $get('team_id') != 0 ? 'danger' : 'gray'))
|
|
||||||
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
|
||||||
->options(function (Get $get) {
|
|
||||||
if ($get('match_id')) {
|
|
||||||
$res = StatisticFixtures::where('id', $get('match_id'))->first();
|
|
||||||
|
|
||||||
$arr = [];
|
|
||||||
if ($res) {
|
|
||||||
$arr[$res->home_id] = SofaScoreRosa::query()->where('ss_team_id', $res->home_id)->value('ss_team_name');
|
|
||||||
$arr[$res->away_id] = SofaScoreRosa::query()->where('ss_team_id', $res->away_id)->value('ss_team_name');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $arr;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->afterStateUpdated(function (callable $set) {
|
|
||||||
$set('ss_player_id', null);
|
|
||||||
$this->dispatch('reset-tab');
|
|
||||||
})
|
|
||||||
->placeholder('Select Team'),
|
|
||||||
]),
|
|
||||||
Grid::make([
|
|
||||||
'default' => 1,
|
|
||||||
'sm' => 3,
|
|
||||||
'md' => 5,
|
|
||||||
])
|
|
||||||
->columnSpanFull()
|
|
||||||
->schema([
|
|
||||||
Select::make('team_position')
|
|
||||||
->live()
|
|
||||||
->hiddenLabel()
|
|
||||||
->placeholder('Select Team Position')
|
|
||||||
->prefix('TP')
|
|
||||||
->prefixAction(
|
|
||||||
Action::make('iconInfo')
|
|
||||||
->color('success')
|
|
||||||
->icon('phosphor-question')
|
|
||||||
->tooltip(fn () => 'Team Position')
|
|
||||||
)
|
|
||||||
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
|
||||||
->default('all')
|
|
||||||
->selectablePlaceholder(false)
|
|
||||||
->options([
|
|
||||||
'all' => 'All',
|
|
||||||
'home' => 'Home',
|
|
||||||
'away' => 'Away',
|
|
||||||
])->afterStateUpdated(function (callable $set) {
|
|
||||||
$set('ss_player_id', null);
|
|
||||||
}),
|
|
||||||
Select::make('statistic_type')
|
|
||||||
->live()
|
|
||||||
->hiddenLabel()
|
|
||||||
->allowHtml()
|
|
||||||
->placeholder('Statistic Type')
|
|
||||||
->prefixIconColor('success')
|
|
||||||
->prefixIcon(function (Get $get) {
|
|
||||||
return match ($get('statistic_type')) {
|
|
||||||
'gls' => 'phosphor-soccer-ball',
|
|
||||||
'crn' => 'phosphor-angle',
|
|
||||||
'fls' => 'phosphor-first-aid-kit',
|
|
||||||
'ofs' => 'phosphor-arrow-fat-lines-right',
|
|
||||||
'crd' => 'phosphor-cards',
|
|
||||||
'snt' => 'phosphor-target',
|
|
||||||
'tsh' => 'phosphor-chart-polar',
|
|
||||||
default => 'phosphor-soccer-ball',
|
|
||||||
};
|
|
||||||
})
|
|
||||||
->default('gls')
|
|
||||||
->selectablePlaceholder(false)
|
|
||||||
->options([
|
|
||||||
'gls' => 'Goals',
|
|
||||||
'crn' => 'Corner',
|
|
||||||
'fls' => 'Fouls Commited',
|
|
||||||
'ofs' => 'Offside',
|
|
||||||
'crd' => 'Cards',
|
|
||||||
'snt' => 'Shots On Target',
|
|
||||||
'tsh' => 'Total Shots',
|
|
||||||
]),
|
|
||||||
|
|
||||||
/************************
|
|
||||||
* SMP
|
|
||||||
************************/
|
|
||||||
Select::make('similar_past_matches')
|
|
||||||
->live()
|
|
||||||
// ->columnSpan(2)
|
|
||||||
->hiddenLabel()
|
|
||||||
->hidden(fn (Get $get) => $get('team_id') != null)
|
|
||||||
->columnSpan(fn (Get $get) => $get('similar_past_matches') != 'none' ? 2 : 1)
|
|
||||||
->suffixAction(Action::make('reset')
|
|
||||||
->icon('phosphor-x-circle')
|
|
||||||
->tooltip('Clear SMP')
|
|
||||||
->action(fn (callable $set) => $set('similar_past_matches', 'none'))
|
|
||||||
->color(fn (Get $get): string => $get('similar_past_matches') != 'none' ? 'danger' : 'gray'))
|
|
||||||
->placeholder('Similar Past Matches')
|
|
||||||
->suffix(fn (Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('<div class="text-center w-24 font-bold rounded p-1 bg-blue-600 dark:bg-blue-700 text-white dark:text-gray-300">± '.$get('accuracy').'</div>') : '')
|
|
||||||
->prefix('SPM')
|
|
||||||
->prefixAction(
|
|
||||||
Action::make('iconInfo')
|
|
||||||
->icon('phosphor-question')
|
|
||||||
->color(fn (Get $get): string => $get('similar_past_matches') != 'none' ? 'success' : 'danger')
|
|
||||||
->tooltip(fn () => $this->tooltip_similar_past_matches())
|
|
||||||
)
|
|
||||||
->default('none')
|
|
||||||
->selectablePlaceholder(false)
|
|
||||||
->afterStateUpdated(function (callable $set) {
|
|
||||||
$set('ss_player_id', null);
|
|
||||||
$set('team_position', null);
|
|
||||||
$this->dispatch('reset-tab');
|
|
||||||
})
|
|
||||||
->options([
|
|
||||||
'none' => 'None',
|
|
||||||
'league' => 'League',
|
|
||||||
'all' => 'All Database',
|
|
||||||
]),
|
|
||||||
/************************
|
|
||||||
* SLIDER
|
|
||||||
************************/
|
|
||||||
Slider::make('accuracy')
|
|
||||||
->live()
|
|
||||||
->hiddenLabel()
|
|
||||||
->hidden(fn (Get $get) => $get('similar_past_matches') == 'none')
|
|
||||||
->fillTrack()
|
|
||||||
->minValue(0)
|
|
||||||
->maxValue(0.25)
|
|
||||||
->default(0.125)
|
|
||||||
->step(0.025)
|
|
||||||
->decimalPlaces(3)
|
|
||||||
->pips()
|
|
||||||
->pipsFormatter(RawJs::make(<<<'JS'
|
|
||||||
`${$value.toFixed(2)}`
|
|
||||||
JS)),
|
|
||||||
/************************
|
|
||||||
* PLAYER
|
|
||||||
************************/
|
|
||||||
Select::make('ss_player_id')
|
|
||||||
->live()
|
|
||||||
->hiddenLabel()
|
|
||||||
->allowHtml()
|
|
||||||
->columnSpan(2)
|
|
||||||
->placeholder('Player')
|
|
||||||
->visible(fn (Get $get) => $get('team_id'))
|
|
||||||
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
|
||||||
->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'success' : '')
|
|
||||||
->prefixIcon('icon-player')
|
|
||||||
->preload()
|
|
||||||
->searchable()
|
|
||||||
->extraAttributes(fn () => [
|
|
||||||
'id' => 'player_selector',
|
|
||||||
'style' => 'width: 100%;',
|
|
||||||
])
|
|
||||||
->suffixAction(
|
|
||||||
Action::make('iconInfo')
|
|
||||||
->icon('phosphor-question')
|
|
||||||
->color('success')
|
|
||||||
->tooltip(fn () => $this->tooltip_player_info())
|
|
||||||
)
|
|
||||||
->options(function (Get $get) {
|
|
||||||
$team_id = $get('team_id');
|
|
||||||
$team_position = $get('team_position');
|
|
||||||
$sofascore_category_id = $get('sofascore_category_id');
|
|
||||||
$season = $get('season');
|
|
||||||
$seasonmode = $get('seasonmode');
|
|
||||||
|
|
||||||
return LoadPlayerSelection::load($team_id, $team_position, $sofascore_category_id, $season, $seasonmode);
|
|
||||||
}),
|
|
||||||
Select::make('player_on_field')
|
|
||||||
->live()
|
|
||||||
->hiddenLabel()
|
|
||||||
->placeholder('Time on field')
|
|
||||||
->prefixIcon('phosphor-watch')
|
|
||||||
->default('all')
|
|
||||||
->hidden(fn (Get $get) => ! $get('ss_player_id'))
|
|
||||||
->prefixIconColor('success')
|
|
||||||
->selectablePlaceholder(false)
|
|
||||||
->options([
|
|
||||||
'all' => 'All',
|
|
||||||
'lineup' => 'Lineup',
|
|
||||||
'substituted' => 'Substituted',
|
|
||||||
'notplayed' => 'Not Played',
|
|
||||||
]),
|
|
||||||
]),
|
|
||||||
Grid::make([
|
|
||||||
'default' => 7,
|
|
||||||
'sm' => 7,
|
|
||||||
])
|
|
||||||
->columnSpanFull()
|
|
||||||
->schema([
|
|
||||||
Radio::make('season_or_date')
|
|
||||||
->live()
|
|
||||||
->extraAttributes([
|
|
||||||
'class' => 'radio-statistic-group',
|
|
||||||
])
|
|
||||||
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
|
||||||
->columnSpan(2)
|
|
||||||
->inline()
|
|
||||||
->default('season')
|
|
||||||
->hiddenLabel()
|
|
||||||
->options([
|
|
||||||
'season' => 'Season',
|
|
||||||
'date' => 'Date',
|
|
||||||
]),
|
|
||||||
/************************
|
|
||||||
* SEASON full time
|
|
||||||
************************/
|
|
||||||
Select::make('season')
|
|
||||||
->live()
|
|
||||||
->columnSpan(2)
|
|
||||||
->hiddenLabel()
|
|
||||||
->multiple()
|
|
||||||
->placeholder('Current Season')
|
|
||||||
->prefixIconColor('success')
|
|
||||||
->visible(fn (Get $get) => $get('seasonmode'))
|
|
||||||
->hidden(fn (Get $get) => $get('seasonmode') == 'halfyear' || $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none')
|
|
||||||
->prefixIcon('phosphor-calendar-star')
|
|
||||||
->options([
|
|
||||||
'2026' => '2026',
|
|
||||||
'2025' => '2025',
|
|
||||||
'2024' => '2024',
|
|
||||||
])
|
|
||||||
->afterStateUpdated(function (callable $set, Get $get) {
|
|
||||||
$set('ss_player_id', null);
|
|
||||||
}),
|
|
||||||
/************************
|
|
||||||
* SEASON half time
|
|
||||||
************************/
|
|
||||||
Select::make('season')
|
|
||||||
->live()
|
|
||||||
->columnSpan(2)
|
|
||||||
->hiddenLabel()
|
|
||||||
->multiple()
|
|
||||||
->placeholder('Current Season')
|
|
||||||
->prefixIconColor('success')
|
|
||||||
->visible(fn (Get $get) => $get('seasonmode'))
|
|
||||||
->hidden(fn (Get $get) => $get('seasonmode') == 'fullyear' || $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none')
|
|
||||||
->prefixIcon('phosphor-calendar-star')
|
|
||||||
->options([
|
|
||||||
'26/27' => '26/27',
|
|
||||||
'25/26' => '25/26',
|
|
||||||
'24/25' => '24/25',
|
|
||||||
])
|
|
||||||
->afterStateUpdated(function (callable $set) {
|
|
||||||
$set('ss_player_id', null);
|
|
||||||
}),
|
|
||||||
/************************
|
|
||||||
* DATE PICKER
|
|
||||||
************************/
|
|
||||||
DatePicker::make('start_date')
|
|
||||||
->live()
|
|
||||||
->hiddenLabel()
|
|
||||||
->hidden(fn (Get $get) => $get('season_or_date') == 'season')
|
|
||||||
->native(false)
|
|
||||||
->prefixIconColor(fn (Get $get): string => $get('start_date') ? 'success' : 'primary')
|
|
||||||
->prefixIcon('phosphor-calendar')
|
|
||||||
->prefix('Start')
|
|
||||||
->suffixAction(
|
|
||||||
Action::make('clear_start')
|
|
||||||
->icon('phosphor-x')
|
|
||||||
->color('gray')
|
|
||||||
->action(fn (Set $set) => $set('start_date', null))
|
|
||||||
),
|
|
||||||
DatePicker::make('end_date')
|
|
||||||
->live()
|
|
||||||
->hiddenLabel()
|
|
||||||
->hidden(fn (Get $get) => $get('season_or_date') == 'season')
|
|
||||||
->native(false)
|
|
||||||
->prefixIconColor(fn (Get $get): string => $get('end_date') ? 'success' : 'primary')
|
|
||||||
->prefixIcon('phosphor-calendar')
|
|
||||||
->prefix('End')
|
|
||||||
->suffixAction(
|
|
||||||
Action::make('clear_end')
|
|
||||||
->icon('phosphor-x')
|
|
||||||
->color('gray')
|
|
||||||
->action(fn (Set $set) => $set('end_date', null))
|
|
||||||
),
|
|
||||||
Actions::make([
|
Actions::make([
|
||||||
Action::make('esc')
|
Action::make('esc')
|
||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
|
||||||
->tooltip('Clear All (esc)')
|
->tooltip('Clear All (esc)')
|
||||||
->icon('phosphor-x-circle')
|
->icon('phosphor-x')
|
||||||
->color(fn (Get $get) => $get('sofascore_category_id') ? 'danger' : 'gray')
|
->color('gray')
|
||||||
->keyBindings(['esc'])
|
->keyBindings(['esc'])
|
||||||
->outlined()
|
->outlined()
|
||||||
->size(Size::Medium)
|
|
||||||
->action('resetFilters'),
|
->action('resetFilters'),
|
||||||
Action::make('copy')
|
Action::make('copy')
|
||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
@@ -501,7 +158,6 @@ class Statistic extends BaseDashboard
|
|||||||
->visible(fn (Get $get) => $get('team_id'))
|
->visible(fn (Get $get) => $get('team_id'))
|
||||||
->tooltip('Copy data for pasting into spreadsheet')
|
->tooltip('Copy data for pasting into spreadsheet')
|
||||||
->color('success')
|
->color('success')
|
||||||
->size(Size::Medium)
|
|
||||||
->outlined()
|
->outlined()
|
||||||
->icon('phosphor-copy')
|
->icon('phosphor-copy')
|
||||||
->action(function ($livewire) {
|
->action(function ($livewire) {
|
||||||
@@ -518,6 +174,30 @@ class Statistic extends BaseDashboard
|
|||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
|
Grid::make([
|
||||||
|
'default' => 1,
|
||||||
|
'sm' => 3,
|
||||||
|
'md' => 4,
|
||||||
|
])
|
||||||
|
->columnSpanFull()
|
||||||
|
->schema([
|
||||||
|
$this->selectStatisticType(),
|
||||||
|
$this->selectSimilarPastMatches(),
|
||||||
|
$this->sliderAccuracy(),
|
||||||
|
$this->selectPlayerId(),
|
||||||
|
$this->selectPlayerOnField(),
|
||||||
|
]),
|
||||||
|
Grid::make([
|
||||||
|
'default' => 8,
|
||||||
|
'sm' => 8,
|
||||||
|
])
|
||||||
|
->columnSpanFull()
|
||||||
|
->schema([
|
||||||
|
$this->radioSeasonOrDate(),
|
||||||
|
$this->selectSeason(),
|
||||||
|
$this->datePickerStartDate(),
|
||||||
|
$this->datePickerEndDate(),
|
||||||
|
]),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -548,6 +228,18 @@ class Statistic extends BaseDashboard
|
|||||||
$copystring .= implode(';', $row)."\n";
|
$copystring .= implode(';', $row)."\n";
|
||||||
$row = [];
|
$row = [];
|
||||||
$row = array_fill(0, 5, '');
|
$row = array_fill(0, 5, '');
|
||||||
|
$row[] = 'Corner';
|
||||||
|
$row[] = $data['crn']['home'];
|
||||||
|
$row[] = $data['crn']['away'];
|
||||||
|
$row[] = $data['crn_team']['home'];
|
||||||
|
$row[] = $data['crn_team']['away'];
|
||||||
|
$row[] = $data['crn_team_season']['home'];
|
||||||
|
$row[] = $data['crn_team_season']['away'];
|
||||||
|
$row[] = $data['crn_liga_season']['home'];
|
||||||
|
$row[] = $data['crn_liga_season']['away'];
|
||||||
|
$copystring .= implode(';', $row)."\n";
|
||||||
|
$row = [];
|
||||||
|
$row = array_fill(0, 5, '');
|
||||||
$row[] = 'Fouls';
|
$row[] = 'Fouls';
|
||||||
$row[] = $data['fls']['home'];
|
$row[] = $data['fls']['home'];
|
||||||
$row[] = $data['fls']['away'];
|
$row[] = $data['fls']['away'];
|
||||||
@@ -606,6 +298,18 @@ class Statistic extends BaseDashboard
|
|||||||
$row[] = $data['tsh_liga_season']['home'];
|
$row[] = $data['tsh_liga_season']['home'];
|
||||||
$row[] = $data['tsh_liga_season']['away'];
|
$row[] = $data['tsh_liga_season']['away'];
|
||||||
$copystring .= implode(';', $row)."\n";
|
$copystring .= implode(';', $row)."\n";
|
||||||
|
$row = [];
|
||||||
|
$row = array_fill(0, 5, '');
|
||||||
|
$row[] = 'Was Fouled';
|
||||||
|
$row[] = $data['wfl']['home'];
|
||||||
|
$row[] = $data['wfl']['away'];
|
||||||
|
$row[] = $data['wfl_team']['home'];
|
||||||
|
$row[] = $data['wfl_team']['away'];
|
||||||
|
$row[] = $data['wfl_team_season']['home'];
|
||||||
|
$row[] = $data['wfl_team_season']['away'];
|
||||||
|
$row[] = $data['wfl_liga_season']['home'];
|
||||||
|
$row[] = $data['wfl_liga_season']['away'];
|
||||||
|
$copystring .= implode(';', $row)."\n";
|
||||||
|
|
||||||
return $copystring;
|
return $copystring;
|
||||||
}
|
}
|
||||||
@@ -639,4 +343,365 @@ class Statistic extends BaseDashboard
|
|||||||
|
|
||||||
return new HtmlString($str);
|
return new HtmlString($str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FROM HERE ONLY FORM FILTERS
|
||||||
|
* Komplexe Filter in eigene Methoden auslagern (faster)
|
||||||
|
*/
|
||||||
|
private function selectSofascoreCategoryId(): Select
|
||||||
|
{
|
||||||
|
return Select::make('sofascore_category_id')
|
||||||
|
->live()
|
||||||
|
->preload()
|
||||||
|
->searchable(false)
|
||||||
|
->prefixIconColor(fn (Get $get): string => $get('sofascore_category_id') ? 'success' : 'danger')
|
||||||
|
->prefixIcon('phosphor-globe')
|
||||||
|
->hiddenLabel()
|
||||||
|
->options(fn () => LoadSofaScoreCategory::load())
|
||||||
|
->placeholder('Select Country')
|
||||||
|
->afterStateUpdated(function (callable $set, $state) {
|
||||||
|
$set('season_mode', SofaScoreCategory::where('id', $state)->value('season_mode'));
|
||||||
|
$set('league_id', null);
|
||||||
|
$set('match_id', null);
|
||||||
|
$set('team_id', null);
|
||||||
|
$set('ss_player_id', null);
|
||||||
|
$set('season', null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function selectLeagueId(): Select
|
||||||
|
{
|
||||||
|
return Select::make('league_id')
|
||||||
|
->live()
|
||||||
|
->preload()
|
||||||
|
->prefixIconColor(fn (Get $get): string => $get('league_id') ? 'success' : 'danger')
|
||||||
|
->prefixIcon('phosphor-trophy')
|
||||||
|
->hiddenLabel()
|
||||||
|
->options(fn (Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id')))
|
||||||
|
->placeholder('Select League')
|
||||||
|
->afterStateUpdated(function (callable $set) {
|
||||||
|
$set('ss_player_id', null);
|
||||||
|
$set('match_id', null);
|
||||||
|
$set('team_id', null);
|
||||||
|
$this->dispatch('reset-tab');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function selectMatchId(): Select
|
||||||
|
{
|
||||||
|
return Select::make('match_id')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->columnSpan(fn (Get $get) => $get('similar_past_matches') != 'none' ? 2 : 1)
|
||||||
|
->prefixIconColor(fn (Get $get): string => $get('match_id') ? 'success' : 'danger')
|
||||||
|
->prefixIcon('phosphor-calendar-check')
|
||||||
|
->options(function (Get $get) {
|
||||||
|
return LoadStatisticFixturesMatchOptions::load($get('league_id'));
|
||||||
|
})
|
||||||
|
->afterStateUpdated(function (callable $set) {
|
||||||
|
$set('team_id', null);
|
||||||
|
$set('ss_player_id', null);
|
||||||
|
$this->dispatch('reset-tab');
|
||||||
|
})
|
||||||
|
->placeholder('Select Event');
|
||||||
|
}
|
||||||
|
|
||||||
|
private function selectTeamId(): Select
|
||||||
|
{
|
||||||
|
return Select::make('team_id')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->prefixIconColor(function (Get $get): string {
|
||||||
|
if ($get('team_id')) {
|
||||||
|
return 'success';
|
||||||
|
} elseif ($get('similar_past_matches') != 'none') {
|
||||||
|
return 'gray';
|
||||||
|
} else {
|
||||||
|
return 'danger';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->prefixIcon('phosphor-users')
|
||||||
|
->suffixAction(Action::make('reset')
|
||||||
|
->icon('phosphor-x')
|
||||||
|
->tooltip('Clear Team')
|
||||||
|
->action(fn (callable $set) => $set('team_id', 0).$set('ss_player_id', null))
|
||||||
|
->color('gray'))
|
||||||
|
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
||||||
|
->options(function (Get $get) {
|
||||||
|
if ($get('match_id')) {
|
||||||
|
$res = StatisticFixtures::where('id', $get('match_id'))->first();
|
||||||
|
|
||||||
|
$arr = [];
|
||||||
|
if ($res) {
|
||||||
|
$arr[$res->home_id] = SofaScoreRosa::query()->where('ss_team_id', $res->home_id)->value('ss_team_name');
|
||||||
|
$arr[$res->away_id] = SofaScoreRosa::query()->where('ss_team_id', $res->away_id)->value('ss_team_name');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $arr;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->afterStateUpdated(function (callable $set) {
|
||||||
|
$set('ss_player_id', null);
|
||||||
|
$set('team_position', 'all');
|
||||||
|
$this->dispatch('reset-tab');
|
||||||
|
})
|
||||||
|
->placeholder('Select Team');
|
||||||
|
}
|
||||||
|
|
||||||
|
private function selectTeamPosition(): Select
|
||||||
|
{
|
||||||
|
return Select::make('team_position')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->placeholder('Select Team Position')
|
||||||
|
->prefix('TP')
|
||||||
|
->prefixAction(
|
||||||
|
Action::make('iconInfo')
|
||||||
|
->color('success')
|
||||||
|
->icon('phosphor-question')
|
||||||
|
->tooltip(fn () => 'Team Position')
|
||||||
|
)
|
||||||
|
->visible(fn (Get $get) => $get('team_id'))
|
||||||
|
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
||||||
|
->default('all')
|
||||||
|
->selectablePlaceholder(false)
|
||||||
|
->options([
|
||||||
|
'all' => 'All',
|
||||||
|
'home' => 'Home',
|
||||||
|
'away' => 'Away',
|
||||||
|
])->afterStateUpdated(function (callable $set) {
|
||||||
|
$set('ss_player_id', null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function selectStatisticType(): Select
|
||||||
|
{
|
||||||
|
return Select::make('statistic_type')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->allowHtml()
|
||||||
|
->placeholder('Statistic Type')
|
||||||
|
->prefixIconColor('success')
|
||||||
|
->prefixIcon(function (Get $get) {
|
||||||
|
return match ($get('statistic_type')) {
|
||||||
|
'gls' => 'phosphor-soccer-ball',
|
||||||
|
'crn' => 'phosphor-angle',
|
||||||
|
'fls' => 'phosphor-first-aid-kit',
|
||||||
|
'ofs' => 'phosphor-arrow-fat-lines-right',
|
||||||
|
'crd' => 'phosphor-cards',
|
||||||
|
'snt' => 'phosphor-target',
|
||||||
|
'tsh' => 'phosphor-chart-polar',
|
||||||
|
'wfl' => 'phosphor-first-aid-kit',
|
||||||
|
default => 'phosphor-soccer-ball',
|
||||||
|
};
|
||||||
|
})
|
||||||
|
->default('gls')
|
||||||
|
->selectablePlaceholder(false)
|
||||||
|
->options([
|
||||||
|
'gls' => 'Goals',
|
||||||
|
'crn' => 'Corner',
|
||||||
|
'fls' => 'Fouls Commited',
|
||||||
|
'ofs' => 'Offside',
|
||||||
|
'crd' => 'Cards',
|
||||||
|
'snt' => 'Shots On Target',
|
||||||
|
'tsh' => 'Total Shots',
|
||||||
|
'wfl' => 'Was Fouled',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function selectSimilarPastMatches(): Select
|
||||||
|
{
|
||||||
|
return Select::make('similar_past_matches')
|
||||||
|
->live()
|
||||||
|
// ->columnSpan(2)
|
||||||
|
->hiddenLabel()
|
||||||
|
->hidden(fn (Get $get) => $get('team_id') != null)
|
||||||
|
->columnSpan(fn (Get $get) => $get('similar_past_matches') != 'none' ? 2 : 1)
|
||||||
|
->suffixAction(Action::make('reset')
|
||||||
|
->icon('phosphor-x')
|
||||||
|
->tooltip('Clear SMP')
|
||||||
|
->action(fn (callable $set) => $set('similar_past_matches', 'none'))
|
||||||
|
->color('gray'))
|
||||||
|
->placeholder('Similar Past Matches')
|
||||||
|
->suffix(fn (Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('<div class="text-center w-24 font-bold rounded p-1 bg-blue-600 dark:bg-blue-700 text-white dark:text-gray-300">± '.$get('accuracy').'</div>') : '')
|
||||||
|
->prefix('SPM')
|
||||||
|
->prefixAction(
|
||||||
|
Action::make('iconInfo')
|
||||||
|
->icon('phosphor-question')
|
||||||
|
->color(fn (Get $get): string => $get('similar_past_matches') != 'none' ? 'success' : 'danger')
|
||||||
|
->tooltip(fn () => $this->tooltip_similar_past_matches())
|
||||||
|
)
|
||||||
|
->default('none')
|
||||||
|
->selectablePlaceholder(false)
|
||||||
|
->afterStateUpdated(function (callable $set) {
|
||||||
|
$set('ss_player_id', null);
|
||||||
|
$set('team_position', null);
|
||||||
|
$this->dispatch('reset-tab');
|
||||||
|
})
|
||||||
|
->options([
|
||||||
|
'none' => 'None',
|
||||||
|
'league' => 'League',
|
||||||
|
'all' => 'All Database',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function sliderAccuracy(): Slider
|
||||||
|
{
|
||||||
|
return Slider::make('accuracy')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->hidden(fn (Get $get) => $get('similar_past_matches') == 'none')
|
||||||
|
->fillTrack()
|
||||||
|
->minValue(0)
|
||||||
|
->maxValue(0.25)
|
||||||
|
->default(0.125)
|
||||||
|
->step(0.025)
|
||||||
|
->decimalPlaces(3)
|
||||||
|
->pips()
|
||||||
|
->pipsFormatter(RawJs::make(<<<'JS'
|
||||||
|
`${$value.toFixed(2)}`
|
||||||
|
JS));
|
||||||
|
}
|
||||||
|
|
||||||
|
private function selectPlayerId(): Select
|
||||||
|
{
|
||||||
|
return Select::make('ss_player_id')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->allowHtml()
|
||||||
|
->columnSpan(2)
|
||||||
|
->placeholder('Player')
|
||||||
|
->visible(fn (Get $get) => $get('team_id'))
|
||||||
|
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
||||||
|
->disabled(fn (Get $get) => $get('season_or_date') == 'date' && ($get('start_date') == null || $get('end_date') == null))
|
||||||
|
->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'success' : '')
|
||||||
|
->prefixIcon('icon-player')
|
||||||
|
->searchable()
|
||||||
|
->extraAttributes(fn () => [
|
||||||
|
'id' => 'player_selector',
|
||||||
|
'style' => 'width: 100%;',
|
||||||
|
])
|
||||||
|
->suffixAction(
|
||||||
|
Action::make('iconInfo')
|
||||||
|
->icon('phosphor-question')
|
||||||
|
->color('success')
|
||||||
|
->tooltip(fn () => $this->tooltip_player_info())
|
||||||
|
)
|
||||||
|
->options(function (Get $get) {
|
||||||
|
$arr = [
|
||||||
|
'team_id' => $get('team_id'),
|
||||||
|
'team_position' => $get('team_position'),
|
||||||
|
'season' => $get('season'),
|
||||||
|
'season_mode' => $get('season_mode'),
|
||||||
|
'season_or_date' => $get('season_or_date'),
|
||||||
|
'start_date' => $get('start_date'),
|
||||||
|
'end_date' => $get('end_date'),
|
||||||
|
];
|
||||||
|
|
||||||
|
return LoadPlayerSelection::load($arr);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function selectPlayerOnField(): Select
|
||||||
|
{
|
||||||
|
return Select::make('player_on_field')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->placeholder('Time on field')
|
||||||
|
->prefixIcon('phosphor-watch')
|
||||||
|
->default('all')
|
||||||
|
->visible(fn (Get $get) => $get('ss_player_id'))
|
||||||
|
->prefixIconColor('success')
|
||||||
|
->selectablePlaceholder(false)
|
||||||
|
->options([
|
||||||
|
'all' => 'All',
|
||||||
|
'lineup' => 'Lineup',
|
||||||
|
'substituted' => 'Substituted',
|
||||||
|
'notplayed' => 'Not Played',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function radioSeasonOrDate(): Radio
|
||||||
|
{
|
||||||
|
return Radio::make('season_or_date')
|
||||||
|
->live()
|
||||||
|
->extraAttributes([
|
||||||
|
'class' => 'radio-statistic-group',
|
||||||
|
])
|
||||||
|
->visible(fn (Get $get) => $get('team_id'))
|
||||||
|
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
||||||
|
->columnSpan(2)
|
||||||
|
->inline()
|
||||||
|
->default('season')
|
||||||
|
->hiddenLabel()
|
||||||
|
->options([
|
||||||
|
'season' => 'Season',
|
||||||
|
'date' => 'Date',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function selectSeason(): Select
|
||||||
|
{
|
||||||
|
return Select::make('season')
|
||||||
|
->live()
|
||||||
|
->columnSpan(2)
|
||||||
|
->hiddenLabel()
|
||||||
|
->multiple()
|
||||||
|
->placeholder('Current Season')
|
||||||
|
->prefixIconColor('success')
|
||||||
|
->visible(fn (Get $get) => $get('team_id'))
|
||||||
|
->hidden(fn (Get $get) => $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none')
|
||||||
|
->prefixIcon('phosphor-calendar-star')
|
||||||
|
->options(function (Get $get) {
|
||||||
|
if ($get('season_mode') == 'halfyear') {
|
||||||
|
return ['26/27' => '26/27', '25/26' => '25/26', '24/25' => '24/25'];
|
||||||
|
} else {
|
||||||
|
return ['2026' => '2026', '2025' => '2025', '2024' => '2024'];
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->afterStateUpdated(function (callable $set, Get $get) {
|
||||||
|
$set('ss_player_id', null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function datePickerStartDate(): DatePicker
|
||||||
|
{
|
||||||
|
return DatePicker::make('start_date')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->columnSpan(2)
|
||||||
|
->visible(fn (Get $get) => $get('team_id'))
|
||||||
|
->hidden(fn (Get $get) => $get('season_or_date') == 'season')
|
||||||
|
->native(false)
|
||||||
|
->prefixIconColor(fn (Get $get): string => $get('start_date') ? 'success' : 'primary')
|
||||||
|
->prefixIcon('phosphor-calendar')
|
||||||
|
->prefix('Start')
|
||||||
|
->suffixAction(
|
||||||
|
Action::make('clear_start')
|
||||||
|
->icon('phosphor-x')
|
||||||
|
->color('gray')
|
||||||
|
->action(fn (Set $set) => $set('start_date', null))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function datePickerEndDate(): DatePicker
|
||||||
|
{
|
||||||
|
return DatePicker::make('end_date')
|
||||||
|
->live()
|
||||||
|
->hiddenLabel()
|
||||||
|
->columnSpan(2)
|
||||||
|
->visible(fn (Get $get) => $get('team_id'))
|
||||||
|
->hidden(fn (Get $get) => $get('season_or_date') == 'season')
|
||||||
|
->native(false)
|
||||||
|
->prefixIconColor(fn (Get $get): string => $get('end_date') ? 'success' : 'primary')
|
||||||
|
->prefixIcon('phosphor-calendar')
|
||||||
|
->prefix('End')
|
||||||
|
->suffixAction(
|
||||||
|
Action::make('clear_end')
|
||||||
|
->icon('phosphor-x')
|
||||||
|
->color('gray')
|
||||||
|
->action(fn (Set $set) => $set('end_date', null))
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Pages;
|
||||||
|
|
||||||
|
use UniFileManager\FilamentFileManager\Filament\Pages\FileManager;
|
||||||
|
|
||||||
|
class StatistikoFileManager extends FileManager
|
||||||
|
{
|
||||||
|
protected ?string $heading = '';
|
||||||
|
}
|
||||||
@@ -8,15 +8,16 @@ use App\Models\StatistikoEvent;
|
|||||||
|
|
||||||
class AverageLeagueSeason
|
class AverageLeagueSeason
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* BOX 6 - AVERAGE ALL LEAGUE FIXED TO ACTIVE SEASON
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public static function load(array &$expectations, array $filter)
|
public static function load(array &$expectations, array $filter)
|
||||||
{
|
{
|
||||||
$tournament_id = (int) $filter['league_id'] ?? 0;
|
$tournament_id = (int) $filter['league_id'] ?? 0;
|
||||||
$seasonmode = $filter['seasonmode'];
|
$season_mode = $filter['season_mode'];
|
||||||
$active_season = GetSeason::active($seasonmode);
|
$active_season = GetSeason::active($season_mode);
|
||||||
|
|
||||||
// Box 2
|
|
||||||
// average made and got for liga selected
|
|
||||||
// fixed to active season
|
|
||||||
|
|
||||||
$res = StatistikoEvent::where('league_id', $tournament_id)
|
$res = StatistikoEvent::where('league_id', $tournament_id)
|
||||||
->when($active_season, function ($query) use ($active_season) {
|
->when($active_season, function ($query) use ($active_season) {
|
||||||
@@ -27,14 +28,16 @@ class AverageLeagueSeason
|
|||||||
if ($res) {
|
if ($res) {
|
||||||
foreach ($res as $val) {
|
foreach ($res as $val) {
|
||||||
ExpectationAverage::filter($result, 'liga', 'gls', $val->gls_h, $val->gls_a);
|
ExpectationAverage::filter($result, 'liga', 'gls', $val->gls_h, $val->gls_a);
|
||||||
|
ExpectationAverage::filter($result, 'liga', 'crn', $val->crn_h, $val->crn_a);
|
||||||
ExpectationAverage::filter($result, 'liga', 'fls', $val->fls_h, $val->fls_a);
|
ExpectationAverage::filter($result, 'liga', 'fls', $val->fls_h, $val->fls_a);
|
||||||
ExpectationAverage::filter($result, 'liga', 'ofs', $val->ofs_h, $val->ofs_a);
|
ExpectationAverage::filter($result, 'liga', 'ofs', $val->ofs_h, $val->ofs_a);
|
||||||
ExpectationAverage::filter($result, 'liga', 'crd', $val->crd_h, $val->crd_a);
|
ExpectationAverage::filter($result, 'liga', 'crd', $val->crd_h, $val->crd_a);
|
||||||
ExpectationAverage::filter($result, 'liga', 'snt', $val->snt_h, $val->snt_a);
|
ExpectationAverage::filter($result, 'liga', 'snt', $val->snt_h, $val->snt_a);
|
||||||
ExpectationAverage::filter($result, 'liga', 'tsh', $val->tsh_h, $val->tsh_a);
|
ExpectationAverage::filter($result, 'liga', 'tsh', $val->tsh_h, $val->tsh_a);
|
||||||
|
ExpectationAverage::filter($result, 'liga', 'wfl', $val->wfl_h, $val->wfl_a);
|
||||||
}
|
}
|
||||||
|
|
||||||
$bets = ['gls', 'fls', 'ofs', 'crd', 'snt', 'tsh'];
|
$bets = ['gls', 'crn', 'fls', 'ofs', 'crd', 'snt', 'tsh', 'wfl'];
|
||||||
if ($result) {
|
if ($result) {
|
||||||
foreach ($bets as $bet) {
|
foreach ($bets as $bet) {
|
||||||
$expectations[$bet.'_liga_season']['home'] = round(array_sum($result['liga'][$bet]['home']) / \count($result['liga'][$bet]['home']), 1);
|
$expectations[$bet.'_liga_season']['home'] = round(array_sum($result['liga'][$bet]['home']) / \count($result['liga'][$bet]['home']), 1);
|
||||||
@@ -47,11 +50,13 @@ class AverageLeagueSeason
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$expectations['gls_liga_season']['name'] = 'Goals';
|
$expectations['gls_liga_season']['name'] = 'Goals';
|
||||||
|
$expectations['crn_liga_season']['name'] = 'Corner';
|
||||||
$expectations['fls_liga_season']['name'] = 'Fouls';
|
$expectations['fls_liga_season']['name'] = 'Fouls';
|
||||||
$expectations['ofs_liga_season']['name'] = 'Offsides';
|
$expectations['ofs_liga_season']['name'] = 'Offsides';
|
||||||
$expectations['crd_liga_season']['name'] = 'Cards';
|
$expectations['crd_liga_season']['name'] = 'Cards';
|
||||||
$expectations['snt_liga_season']['name'] = 'Shots on Target';
|
$expectations['snt_liga_season']['name'] = 'Shots on Target';
|
||||||
$expectations['tsh_liga_season']['name'] = 'Total Shots';
|
$expectations['tsh_liga_season']['name'] = 'Total Shots';
|
||||||
|
$expectations['wfl_liga_season']['name'] = 'Was Fouled';
|
||||||
$expectations['active_season'] = $active_season;
|
$expectations['active_season'] = $active_season;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,11 @@ use App\Models\StatistikoEvent;
|
|||||||
|
|
||||||
class AverageTeam
|
class AverageTeam
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* BOX 4 - AVERAGE TEAM
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public static function load(array &$expectations, array $filter)
|
public static function load(array &$expectations, array $filter)
|
||||||
{
|
{
|
||||||
$tournament_id = (int) $filter['league_id'] ?? 0;
|
$tournament_id = (int) $filter['league_id'] ?? 0;
|
||||||
@@ -17,25 +22,16 @@ class AverageTeam
|
|||||||
$season_or_date = $filter['season_or_date'] ?? 'season';
|
$season_or_date = $filter['season_or_date'] ?? 'season';
|
||||||
$start = $filter['start_date'] ?? 0;
|
$start = $filter['start_date'] ?? 0;
|
||||||
$end = $filter['end_date'] ?? 0;
|
$end = $filter['end_date'] ?? 0;
|
||||||
$seasonmode = $filter['seasonmode'];
|
$season_mode = $filter['season_mode'];
|
||||||
|
|
||||||
if ($season_or_date != 'season') {
|
if ($season_or_date != 'season') {
|
||||||
$season = 0;
|
$season = 0;
|
||||||
} else {
|
} else {
|
||||||
$end = 0;
|
$end = 0;
|
||||||
$start = 0;
|
$start = 0;
|
||||||
$season = GetSeason::load($season, $seasonmode);
|
$season = GetSeason::load($season, $season_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
$active_season = GetSeason::active($seasonmode);
|
|
||||||
|
|
||||||
// Average made and got for team selected
|
|
||||||
// Box 1
|
|
||||||
// for selected Date or Time or All
|
|
||||||
// Box 2
|
|
||||||
// fixed to active season
|
|
||||||
// Box 3 wie 2
|
|
||||||
// fixed to active season but all league
|
|
||||||
$res = StatistikoEvent::where('league_id', $tournament_id)
|
$res = StatistikoEvent::where('league_id', $tournament_id)
|
||||||
->when($start, function ($query) use ($start) {
|
->when($start, function ($query) use ($start) {
|
||||||
return $query->whereDate('starttime', '>=', $start);
|
return $query->whereDate('starttime', '>=', $start);
|
||||||
@@ -56,6 +52,7 @@ class AverageTeam
|
|||||||
})->get();
|
})->get();
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
if ($res) {
|
if ($res) {
|
||||||
|
|
||||||
// 1) la media dei falli di tutte le partite giocate dal Flamengo
|
// 1) la media dei falli di tutte le partite giocate dal Flamengo
|
||||||
@@ -69,29 +66,46 @@ class AverageTeam
|
|||||||
|
|
||||||
if ($team_position == 'home' && $team_id == $val->home_id) {
|
if ($team_position == 'home' && $team_id == $val->home_id) {
|
||||||
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_h, $val->gls_a);
|
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_h, $val->gls_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'crn', $val->crn_h, $val->crn_a);
|
||||||
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_h, $val->fls_a);
|
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_h, $val->fls_a);
|
||||||
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_h, $val->ofs_a);
|
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_h, $val->ofs_a);
|
||||||
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_h, $val->crd_a);
|
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_h, $val->crd_a);
|
||||||
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_h, $val->snt_a);
|
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_h, $val->snt_a);
|
||||||
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_h, $val->tsh_a);
|
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_h, $val->tsh_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'wfl', $val->wfl_h, $val->wfl_a);
|
||||||
} elseif ($team_position == 'away' && $team_id == $val->away_id) {
|
} elseif ($team_position == 'away' && $team_id == $val->away_id) {
|
||||||
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_a, $val->gls_h);
|
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_a, $val->gls_h);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'crn', $val->crn_a, $val->crn_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_a, $val->fls_h);
|
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_a, $val->fls_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_a, $val->ofs_h);
|
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_a, $val->ofs_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_a, $val->crd_h);
|
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_a, $val->crd_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_a, $val->snt_h);
|
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_a, $val->snt_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_a, $val->tsh_h);
|
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_a, $val->tsh_h);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'wfl', $val->wfl_a, $val->wfl_h);
|
||||||
} else {
|
} else {
|
||||||
|
if ($team_id == $val->home_id) {
|
||||||
|
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_h, $val->gls_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'crn', $val->crn_h, $val->crn_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_h, $val->fls_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_h, $val->ofs_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_h, $val->crd_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_h, $val->snt_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_h, $val->tsh_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'wfl', $val->wfl_h, $val->wfl_a);
|
||||||
|
} elseif ($team_id == $val->away_id) {
|
||||||
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_a, $val->gls_h);
|
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_a, $val->gls_h);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'crn', $val->crn_a, $val->crn_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_a, $val->fls_h);
|
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_a, $val->fls_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_a, $val->ofs_h);
|
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_a, $val->ofs_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_a, $val->crd_h);
|
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_a, $val->crd_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_a, $val->snt_h);
|
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_a, $val->snt_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_a, $val->tsh_h);
|
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_a, $val->tsh_h);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'wfl', $val->wfl_a, $val->wfl_h);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$bets = ['gls', 'fls', 'ofs', 'crd', 'snt', 'tsh'];
|
$bets = ['gls', 'crn', 'fls', 'ofs', 'crd', 'snt', 'tsh', 'wfl'];
|
||||||
if ($result) {
|
if ($result) {
|
||||||
foreach ($bets as $bet) {
|
foreach ($bets as $bet) {
|
||||||
$expectations[$bet.'_team']['home'] = round(array_sum($result['team'][$bet]['home']) / \count($result['team'][$bet]['home']), 1);
|
$expectations[$bet.'_team']['home'] = round(array_sum($result['team'][$bet]['home']) / \count($result['team'][$bet]['home']), 1);
|
||||||
@@ -104,11 +118,13 @@ class AverageTeam
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$expectations['gls_team']['name'] = 'Goals';
|
$expectations['gls_team']['name'] = 'Goals';
|
||||||
|
$expectations['crn_team']['name'] = 'Corner';
|
||||||
$expectations['fls_team']['name'] = 'Fouls';
|
$expectations['fls_team']['name'] = 'Fouls';
|
||||||
$expectations['ofs_team']['name'] = 'Offsides';
|
$expectations['ofs_team']['name'] = 'Offsides';
|
||||||
$expectations['crd_team']['name'] = 'Cards';
|
$expectations['crd_team']['name'] = 'Cards';
|
||||||
$expectations['snt_team']['name'] = 'Shots on Target';
|
$expectations['snt_team']['name'] = 'Shots on Target';
|
||||||
$expectations['tsh_team']['name'] = 'Total Shots';
|
$expectations['tsh_team']['name'] = 'Total Shots';
|
||||||
|
$expectations['wfl_team']['name'] = 'Was Fouled';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,21 +8,20 @@ use App\Models\StatistikoEvent;
|
|||||||
|
|
||||||
class AverageTeamSeason
|
class AverageTeamSeason
|
||||||
{
|
{
|
||||||
public static function load(array &$expectations, array $filter)
|
/**
|
||||||
|
* BOX 5 - AVERAGE WITH TEAM FIXED TO ACTIVE SEASON
|
||||||
|
*/
|
||||||
|
public static function load(array &$expectations, array $filter, object $match)
|
||||||
{
|
{
|
||||||
$tournament_id = (int) $filter['league_id'] ?? 0;
|
$tournament_id = (int) $filter['league_id'] ?? 0;
|
||||||
$team_position = $filter['team_position'];
|
$team_position = $filter['team_position'];
|
||||||
$team_id = (int) $filter['team_id'] ?? 0;
|
$team_id = (int) $filter['team_id'] ?? 0;
|
||||||
$seasonmode = $filter['seasonmode'];
|
$season_mode = $filter['season_mode'];
|
||||||
$active_season = GetSeason::active($seasonmode);
|
$season = GetSeason::active($season_mode);
|
||||||
|
|
||||||
// Box 2
|
|
||||||
// average made and got for team selected
|
|
||||||
// fixed to active season
|
|
||||||
|
|
||||||
$res = StatistikoEvent::where('league_id', $tournament_id)
|
$res = StatistikoEvent::where('league_id', $tournament_id)
|
||||||
->when($active_season, function ($query) use ($active_season) {
|
->when($season, function ($query) use ($season) {
|
||||||
return $query->where('season', $active_season);
|
return $query->where('season', $season);
|
||||||
})->when($team_id, function ($query) use ($team_position, $team_id) {
|
})->when($team_id, function ($query) use ($team_position, $team_id) {
|
||||||
switch ($team_position) {
|
switch ($team_position) {
|
||||||
case 'home':
|
case 'home':
|
||||||
@@ -35,42 +34,53 @@ class AverageTeamSeason
|
|||||||
}
|
}
|
||||||
})->get();
|
})->get();
|
||||||
|
|
||||||
$result = [];
|
|
||||||
if ($res) {
|
if ($res) {
|
||||||
|
|
||||||
// 1) la media dei falli di tutte le partite giocate dal Flamengo
|
$result = [];
|
||||||
// (esempio, giocate 6 partite con falli 17-11-15-14-15-12, la media è 14)
|
|
||||||
|
|
||||||
// 2) la media dei falli di tutte le partite giocate nel campionato Brasiliano
|
|
||||||
// (esempio 6 giornate giocate = 60 partite quindi 120 squadre, quindi 120 dati tipo 17-12-12-15-8-15-13-21-...,
|
|
||||||
// quindi la media di questi 120 dati)
|
|
||||||
|
|
||||||
foreach ($res as $val) {
|
foreach ($res as $val) {
|
||||||
if ($team_position == 'home' && $team_id == $val->home_id) {
|
if ($team_position == 'home' && $team_id == $val->home_id) {
|
||||||
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_h, $val->gls_a);
|
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_h, $val->gls_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'crn', $val->crn_h, $val->crn_a);
|
||||||
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_h, $val->fls_a);
|
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_h, $val->fls_a);
|
||||||
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_h, $val->ofs_a);
|
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_h, $val->ofs_a);
|
||||||
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_h, $val->crd_a);
|
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_h, $val->crd_a);
|
||||||
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_h, $val->snt_a);
|
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_h, $val->snt_a);
|
||||||
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_h, $val->tsh_a);
|
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_h, $val->tsh_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'wfl', $val->wfl_h, $val->wfl_a);
|
||||||
} elseif ($team_position == 'away' && $team_id == $val->away_id) {
|
} elseif ($team_position == 'away' && $team_id == $val->away_id) {
|
||||||
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_a, $val->gls_h);
|
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_a, $val->gls_h);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'crn', $val->crn_a, $val->crn_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_a, $val->fls_h);
|
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_a, $val->fls_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_a, $val->ofs_h);
|
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_a, $val->ofs_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_a, $val->crd_h);
|
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_a, $val->crd_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_a, $val->snt_h);
|
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_a, $val->snt_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_a, $val->tsh_h);
|
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_a, $val->tsh_h);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'wfl', $val->wfl_a, $val->wfl_h);
|
||||||
} else {
|
} else {
|
||||||
|
if ($team_id == $val->home_id) {
|
||||||
|
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_h, $val->gls_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'crn', $val->crn_h, $val->crn_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_h, $val->fls_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_h, $val->ofs_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_h, $val->crd_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_h, $val->snt_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_h, $val->tsh_a);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'wfl', $val->wfl_h, $val->wfl_a);
|
||||||
|
} elseif ($team_id == $val->away_id) {
|
||||||
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_a, $val->gls_h);
|
ExpectationAverage::filter($result, 'team', 'gls', $val->gls_a, $val->gls_h);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'crn', $val->crn_a, $val->crn_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_a, $val->fls_h);
|
ExpectationAverage::filter($result, 'team', 'fls', $val->fls_a, $val->fls_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_a, $val->ofs_h);
|
ExpectationAverage::filter($result, 'team', 'ofs', $val->ofs_a, $val->ofs_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_a, $val->crd_h);
|
ExpectationAverage::filter($result, 'team', 'crd', $val->crd_a, $val->crd_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_a, $val->snt_h);
|
ExpectationAverage::filter($result, 'team', 'snt', $val->snt_a, $val->snt_h);
|
||||||
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_a, $val->tsh_h);
|
ExpectationAverage::filter($result, 'team', 'tsh', $val->tsh_a, $val->tsh_h);
|
||||||
|
ExpectationAverage::filter($result, 'team', 'wfl', $val->wfl_a, $val->wfl_h);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$bets = ['gls', 'fls', 'ofs', 'crd', 'snt', 'tsh'];
|
$bets = ['gls', 'crn', 'fls', 'ofs', 'crd', 'snt', 'tsh', 'wfl'];
|
||||||
if ($result) {
|
if ($result) {
|
||||||
foreach ($bets as $bet) {
|
foreach ($bets as $bet) {
|
||||||
$expectations[$bet.'_team_season']['home'] = round(array_sum($result['team'][$bet]['home']) / \count($result['team'][$bet]['home']), 1);
|
$expectations[$bet.'_team_season']['home'] = round(array_sum($result['team'][$bet]['home']) / \count($result['team'][$bet]['home']), 1);
|
||||||
@@ -83,12 +93,14 @@ class AverageTeamSeason
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$expectations['gls_team_season']['name'] = 'Goals';
|
$expectations['gls_team_season']['name'] = 'Goals';
|
||||||
|
$expectations['crn_team_season']['name'] = 'Corner';
|
||||||
$expectations['fls_team_season']['name'] = 'Fouls';
|
$expectations['fls_team_season']['name'] = 'Fouls';
|
||||||
$expectations['ofs_team_season']['name'] = 'Offsides';
|
$expectations['ofs_team_season']['name'] = 'Offsides';
|
||||||
$expectations['crd_team_season']['name'] = 'Cards';
|
$expectations['crd_team_season']['name'] = 'Cards';
|
||||||
$expectations['snt_team_season']['name'] = 'Shots on Target';
|
$expectations['snt_team_season']['name'] = 'Shots on Target';
|
||||||
$expectations['tsh_team_season']['name'] = 'Total Shots';
|
$expectations['tsh_team_season']['name'] = 'Total Shots';
|
||||||
$expectations['active_season'] = $active_season;
|
$expectations['wfl_team_season']['name'] = 'Was Fouled';
|
||||||
|
$expectations['active_season'] = $season;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Widgets\Boxes;
|
||||||
|
|
||||||
|
use App\Filament\Widgets\Charts\LoadEvents\LoadEventsQueryTP;
|
||||||
|
use App\Utilities\Round;
|
||||||
|
|
||||||
|
class Expectation1X2
|
||||||
|
{
|
||||||
|
public static function load(array &$expectations, array $filter, object $match)
|
||||||
|
{
|
||||||
|
$team_id = (int) $filter['team_id'] ?? 0;
|
||||||
|
|
||||||
|
$res_tp = LoadEventsQueryTP::load($filter, $match);
|
||||||
|
|
||||||
|
$count_tp = $res_tp->count();
|
||||||
|
|
||||||
|
$expectations['count_events'] = $count_tp;
|
||||||
|
|
||||||
|
$expectations += ['win_count' => 0, 'draw_count' => 0, 'lost_count' => 0];
|
||||||
|
foreach ($res_tp as $value) {
|
||||||
|
if ($value->home_id == $team_id) {
|
||||||
|
switch ($value['result_code']) {
|
||||||
|
case '1':
|
||||||
|
$expectations['win_count']++;
|
||||||
|
break;
|
||||||
|
case 'X':
|
||||||
|
$expectations['draw_count']++;
|
||||||
|
break;
|
||||||
|
case '2':
|
||||||
|
$expectations['lost_count']++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} elseif ($value->away_id == $team_id) {
|
||||||
|
switch ($value['result_code']) {
|
||||||
|
case '2':
|
||||||
|
$expectations['win_count']++;
|
||||||
|
break;
|
||||||
|
case 'X':
|
||||||
|
$expectations['draw_count']++;
|
||||||
|
break;
|
||||||
|
case '1':
|
||||||
|
$expectations['lost_count']++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch ($value['result_code']) {
|
||||||
|
case '1':
|
||||||
|
$expectations['win_count']++;
|
||||||
|
break;
|
||||||
|
case 'X':
|
||||||
|
$expectations['draw_count']++;
|
||||||
|
break;
|
||||||
|
case '2':
|
||||||
|
$expectations['lost_count']++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$expectations['win_odd'] = $expectations['win_count'] ? number_format(Round::odd($count_tp / $expectations['win_count']), 2) : 0;
|
||||||
|
$expectations['draw_odd'] = $expectations['draw_count'] ? number_format(Round::odd($count_tp / $expectations['draw_count']), 2) : 0;
|
||||||
|
$expectations['lost_odd'] = $expectations['lost_count'] ? number_format(Round::odd($count_tp / $expectations['lost_count']), 2) : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,264 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Widgets\Boxes;
|
||||||
|
|
||||||
|
use App\Filament\Widgets\Boxes\Helper\ExpectationsMinMax;
|
||||||
|
use App\Filament\Widgets\Charts\LoadEvents\LoadEventsQueryAll;
|
||||||
|
|
||||||
|
class ExpectationsBox3
|
||||||
|
{
|
||||||
|
public static function load(array &$expectations, array $filter, object $match)
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* BOX 3
|
||||||
|
*/
|
||||||
|
$spm = $filter['similar_past_matches'];
|
||||||
|
$bets = ['gls', 'crn', 'fls', 'ofs', 'crd', 'snt', 'tsh'];
|
||||||
|
|
||||||
|
$res = LoadEventsQueryAll::load($filter, $match);
|
||||||
|
|
||||||
|
if (! $res->count()) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($spm == 'league' or $spm == 'all') {
|
||||||
|
$events = $res->count();
|
||||||
|
$tmp = [];
|
||||||
|
foreach ($bets as $bet) {
|
||||||
|
$tmp[$bet]['home'] = 0;
|
||||||
|
$tmp[$bet]['away'] = 0;
|
||||||
|
}
|
||||||
|
foreach ($res as $val) {
|
||||||
|
// GLS
|
||||||
|
$tmp['gls']['home'] += $val->gls_h;
|
||||||
|
$tmp['gls']['away'] += $val->gls_a;
|
||||||
|
// CRN
|
||||||
|
$tmp['crn']['home'] += $val->crn_h;
|
||||||
|
$tmp['crn']['away'] += $val->crn_a;
|
||||||
|
// FLS
|
||||||
|
$tmp['fls']['home'] += $val->fls_h;
|
||||||
|
$tmp['fls']['away'] += $val->fls_a;
|
||||||
|
// OFS
|
||||||
|
$tmp['ofs']['home'] += $val->ofs_h;
|
||||||
|
$tmp['ofs']['away'] += $val->ofs_a;
|
||||||
|
// CRD
|
||||||
|
$tmp['crd']['home'] += $val->crd_h;
|
||||||
|
$tmp['crd']['away'] += $val->crd_a;
|
||||||
|
// SNT
|
||||||
|
$tmp['snt']['home'] += $val->snt_h;
|
||||||
|
$tmp['snt']['away'] += $val->snt_a;
|
||||||
|
// TSH
|
||||||
|
$tmp['tsh']['home'] += $val->tsh_h;
|
||||||
|
$tmp['tsh']['away'] += $val->tsh_a;
|
||||||
|
// WFL
|
||||||
|
$tmp['wfl']['home'] += $val->wfl_h;
|
||||||
|
$tmp['wfl']['away'] += $val->wfl_a;
|
||||||
|
}
|
||||||
|
foreach ($bets as $bet) {
|
||||||
|
$expectations[$bet]['home'] = round($tmp[$bet]['home'] / $events, 1);
|
||||||
|
$expectations[$bet]['away'] = round($tmp[$bet]['away'] / $events, 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$tmp = self::sceleton();
|
||||||
|
|
||||||
|
foreach ($res as $val) {
|
||||||
|
// home home
|
||||||
|
if ($match->home_id == $val->home_id) {
|
||||||
|
// GLS
|
||||||
|
$tmp['gls']['home']['events']['home']++;
|
||||||
|
$tmp['gls']['home']['scored']['home'] += $val->gls_h;
|
||||||
|
$tmp['gls']['home']['conceded']['home'] += $val->gls_a;
|
||||||
|
// CRN
|
||||||
|
$tmp['crn']['home']['events']['home']++;
|
||||||
|
$tmp['crn']['home']['scored']['home'] += $val->crn_h;
|
||||||
|
$tmp['crn']['home']['conceded']['home'] += $val->crn_a;
|
||||||
|
// FLS
|
||||||
|
$tmp['fls']['home']['events']['home']++;
|
||||||
|
$tmp['fls']['home']['scored']['home'] += $val->fls_h;
|
||||||
|
$tmp['fls']['home']['conceded']['home'] += $val->fls_a;
|
||||||
|
// OFS
|
||||||
|
$tmp['ofs']['home']['events']['home']++;
|
||||||
|
$tmp['ofs']['home']['scored']['home'] += $val->ofs_h;
|
||||||
|
$tmp['ofs']['home']['conceded']['home'] += $val->ofs_a;
|
||||||
|
// CRD
|
||||||
|
$tmp['crd']['home']['events']['home']++;
|
||||||
|
$tmp['crd']['home']['scored']['home'] += $val->crd_h;
|
||||||
|
$tmp['crd']['home']['conceded']['home'] += $val->crd_a;
|
||||||
|
// SNT
|
||||||
|
$tmp['snt']['home']['events']['home']++;
|
||||||
|
$tmp['snt']['home']['scored']['home'] += $val->snt_h;
|
||||||
|
$tmp['snt']['home']['conceded']['home'] += $val->snt_a;
|
||||||
|
// TSH
|
||||||
|
$tmp['tsh']['home']['events']['home']++;
|
||||||
|
$tmp['tsh']['home']['scored']['home'] += $val->tsh_h;
|
||||||
|
$tmp['tsh']['home']['conceded']['home'] += $val->tsh_a;
|
||||||
|
// TSH
|
||||||
|
$tmp['wfl']['home']['events']['home']++;
|
||||||
|
$tmp['wfl']['home']['scored']['home'] += $val->wfl_h;
|
||||||
|
$tmp['wfl']['home']['conceded']['home'] += $val->wfl_a;
|
||||||
|
|
||||||
|
}
|
||||||
|
// away home
|
||||||
|
if ($match->away_id == $val->home_id) {
|
||||||
|
// GLS
|
||||||
|
$tmp['gls']['away']['events']['home']++;
|
||||||
|
$tmp['gls']['away']['scored']['home'] += $val->gls_h;
|
||||||
|
$tmp['gls']['away']['conceded']['home'] += $val->gls_a;
|
||||||
|
// CRN
|
||||||
|
$tmp['crn']['away']['events']['home']++;
|
||||||
|
$tmp['crn']['away']['scored']['home'] += $val->crn_h;
|
||||||
|
$tmp['crn']['away']['conceded']['home'] += $val->crn_a;
|
||||||
|
// FLS
|
||||||
|
$tmp['fls']['away']['events']['home']++;
|
||||||
|
$tmp['fls']['away']['scored']['home'] += $val->fls_h;
|
||||||
|
$tmp['fls']['away']['conceded']['home'] += $val->fls_a;
|
||||||
|
// OFS
|
||||||
|
$tmp['ofs']['away']['events']['home']++;
|
||||||
|
$tmp['ofs']['away']['scored']['home'] += $val->ofs_h;
|
||||||
|
$tmp['ofs']['away']['conceded']['home'] += $val->ofs_a;
|
||||||
|
// CRD
|
||||||
|
$tmp['crd']['away']['events']['home']++;
|
||||||
|
$tmp['crd']['away']['scored']['home'] += $val->crd_h;
|
||||||
|
$tmp['crd']['away']['conceded']['home'] += $val->crd_a;
|
||||||
|
// SNT
|
||||||
|
$tmp['snt']['away']['events']['home']++;
|
||||||
|
$tmp['snt']['away']['scored']['home'] += $val->snt_h;
|
||||||
|
$tmp['snt']['away']['conceded']['home'] += $val->snt_a;
|
||||||
|
// TSH
|
||||||
|
$tmp['tsh']['away']['events']['home']++;
|
||||||
|
$tmp['tsh']['away']['scored']['home'] += $val->tsh_h;
|
||||||
|
$tmp['tsh']['away']['conceded']['home'] += $val->tsh_a;
|
||||||
|
// WFL
|
||||||
|
$tmp['wfl']['away']['events']['home']++;
|
||||||
|
$tmp['wfl']['away']['scored']['home'] += $val->wfl_h;
|
||||||
|
$tmp['wfl']['away']['conceded']['home'] += $val->wfl_a;
|
||||||
|
}
|
||||||
|
// home away
|
||||||
|
if ($match->home_id == $val->away_id) {
|
||||||
|
// GLS
|
||||||
|
$tmp['gls']['home']['events']['away']++;
|
||||||
|
$tmp['gls']['home']['scored']['away'] += $val->gls_a;
|
||||||
|
$tmp['gls']['home']['conceded']['away'] += $val->gls_h;
|
||||||
|
// CRN
|
||||||
|
$tmp['crn']['home']['events']['away']++;
|
||||||
|
$tmp['crn']['home']['scored']['away'] += $val->crn_a;
|
||||||
|
$tmp['crn']['home']['conceded']['away'] += $val->crn_h;
|
||||||
|
// FLS
|
||||||
|
$tmp['fls']['home']['events']['away']++;
|
||||||
|
$tmp['fls']['home']['scored']['away'] += $val->fls_a;
|
||||||
|
$tmp['fls']['home']['conceded']['away'] += $val->fls_h;
|
||||||
|
// OFS
|
||||||
|
$tmp['ofs']['home']['events']['away']++;
|
||||||
|
$tmp['ofs']['home']['scored']['away'] += $val->ofs_a;
|
||||||
|
$tmp['ofs']['home']['conceded']['away'] += $val->ofs_h;
|
||||||
|
// CRD
|
||||||
|
$tmp['crd']['home']['events']['away']++;
|
||||||
|
$tmp['crd']['home']['scored']['away'] += $val->crd_a;
|
||||||
|
$tmp['crd']['home']['conceded']['away'] += $val->crd_h;
|
||||||
|
// SNT
|
||||||
|
$tmp['snt']['home']['events']['away']++;
|
||||||
|
$tmp['snt']['home']['scored']['away'] += $val->snt_a;
|
||||||
|
$tmp['snt']['home']['conceded']['away'] += $val->snt_h;
|
||||||
|
// TSH
|
||||||
|
$tmp['tsh']['home']['events']['away']++;
|
||||||
|
$tmp['tsh']['home']['scored']['away'] += $val->tsh_a;
|
||||||
|
$tmp['tsh']['home']['conceded']['away'] += $val->tsh_h;
|
||||||
|
// WFL
|
||||||
|
$tmp['wfl']['home']['events']['away']++;
|
||||||
|
$tmp['wfl']['home']['scored']['away'] += $val->wfl_a;
|
||||||
|
$tmp['wfl']['home']['conceded']['away'] += $val->wfl_h;
|
||||||
|
|
||||||
|
}
|
||||||
|
// away away
|
||||||
|
if ($match->away_id == $val->away_id) {
|
||||||
|
// GLS
|
||||||
|
$tmp['gls']['away']['events']['away']++;
|
||||||
|
$tmp['gls']['away']['scored']['away'] += $val->gls_a;
|
||||||
|
$tmp['gls']['away']['conceded']['away'] += $val->gls_h;
|
||||||
|
// CRN
|
||||||
|
$tmp['crn']['away']['events']['away']++;
|
||||||
|
$tmp['crn']['away']['scored']['away'] += $val->crn_a;
|
||||||
|
$tmp['crn']['away']['conceded']['away'] += $val->crn_h;
|
||||||
|
// FLS
|
||||||
|
$tmp['fls']['away']['events']['away']++;
|
||||||
|
$tmp['fls']['away']['scored']['away'] += $val->fls_a;
|
||||||
|
$tmp['fls']['away']['conceded']['away'] += $val->fls_h;
|
||||||
|
// OFS
|
||||||
|
$tmp['ofs']['away']['events']['away']++;
|
||||||
|
$tmp['ofs']['away']['scored']['away'] += $val->ofs_a;
|
||||||
|
$tmp['ofs']['away']['conceded']['away'] += $val->ofs_h;
|
||||||
|
// CRD
|
||||||
|
$tmp['crd']['away']['events']['away']++;
|
||||||
|
$tmp['crd']['away']['scored']['away'] += $val->crd_a;
|
||||||
|
$tmp['crd']['away']['conceded']['away'] += $val->crd_h;
|
||||||
|
// SNT
|
||||||
|
$tmp['snt']['away']['events']['away']++;
|
||||||
|
$tmp['snt']['away']['scored']['away'] += $val->snt_a;
|
||||||
|
$tmp['snt']['away']['conceded']['away'] += $val->snt_h;
|
||||||
|
// TSH
|
||||||
|
$tmp['tsh']['away']['events']['away']++;
|
||||||
|
$tmp['tsh']['away']['scored']['away'] += $val->tsh_a;
|
||||||
|
$tmp['tsh']['away']['conceded']['away'] += $val->tsh_h;
|
||||||
|
// WFL
|
||||||
|
$tmp['wfl']['away']['events']['away']++;
|
||||||
|
$tmp['wfl']['away']['scored']['away'] += $val->wfl_a;
|
||||||
|
$tmp['wfl']['away']['conceded']['away'] += $val->wfl_h;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$cfHA = 2;
|
||||||
|
|
||||||
|
foreach ($tmp as $bet => $data) {
|
||||||
|
$expectations[$bet]['home'] = round((
|
||||||
|
$data['home']['scored']['home'] * $cfHA +
|
||||||
|
$data['home']['scored']['away'] +
|
||||||
|
$data['away']['conceded']['away'] * $cfHA +
|
||||||
|
$data['away']['conceded']['home']
|
||||||
|
) / (
|
||||||
|
$data['home']['events']['home'] * $cfHA +
|
||||||
|
$data['home']['events']['away'] +
|
||||||
|
$data['away']['events']['home'] +
|
||||||
|
$data['away']['events']['away'] * $cfHA
|
||||||
|
), 1);
|
||||||
|
$expectations[$bet]['away'] = round((
|
||||||
|
$data['home']['conceded']['home'] * $cfHA +
|
||||||
|
$data['home']['conceded']['away'] +
|
||||||
|
$data['away']['scored']['away'] * $cfHA +
|
||||||
|
$data['away']['scored']['home']
|
||||||
|
) / (
|
||||||
|
$data['home']['events']['home'] * $cfHA +
|
||||||
|
$data['home']['events']['away'] +
|
||||||
|
$data['away']['events']['home'] +
|
||||||
|
$data['away']['events']['away'] * $cfHA
|
||||||
|
), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ExpectationsMinMax::calc($expectations, $match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sceleton()
|
||||||
|
{
|
||||||
|
$tmp = [];
|
||||||
|
$bets = ['gls', 'crn', 'fls', 'ofs', 'crd', 'snt', 'tsh', 'wfl'];
|
||||||
|
foreach ($bets as $bet) {
|
||||||
|
$tmp[$bet]['home']['events']['home'] = 0;
|
||||||
|
$tmp[$bet]['home']['scored']['home'] = 0;
|
||||||
|
$tmp[$bet]['home']['conceded']['home'] = 0;
|
||||||
|
// away home
|
||||||
|
$tmp[$bet]['away']['events']['home'] = 0;
|
||||||
|
$tmp[$bet]['away']['scored']['home'] = 0;
|
||||||
|
$tmp[$bet]['away']['conceded']['home'] = 0;
|
||||||
|
// home away
|
||||||
|
$tmp[$bet]['home']['events']['away'] = 0;
|
||||||
|
$tmp[$bet]['home']['scored']['away'] = 0;
|
||||||
|
$tmp[$bet]['home']['conceded']['away'] = 0;
|
||||||
|
// away away
|
||||||
|
$tmp[$bet]['away']['events']['away'] = 0;
|
||||||
|
$tmp[$bet]['away']['scored']['away'] = 0;
|
||||||
|
$tmp[$bet]['away']['conceded']['away'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Filament\Widgets\Boxes;
|
|
||||||
|
|
||||||
use App\Filament\Widgets\Boxes\Helper\ExpectationCalculation;
|
|
||||||
use App\Filament\Widgets\Boxes\Helper\ExpectationCollecting;
|
|
||||||
use App\Filament\Widgets\Charts\LoadEvents\LoadEventsQueryAll;
|
|
||||||
use App\Utilities\Round;
|
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
class ExpectationsTeam
|
|
||||||
{
|
|
||||||
public static function load(array &$expectations, array $filter, object $match)
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* STATTISTIC DATA
|
|
||||||
*/
|
|
||||||
$team_id = (int) $filter['team_id'] ?? 0;
|
|
||||||
$team_position = $filter['team_position'];
|
|
||||||
$similar_past_matches = $filter['similar_past_matches'];
|
|
||||||
|
|
||||||
if ($similar_past_matches != 'none') {
|
|
||||||
$team_id = 0;
|
|
||||||
$team_position = '';
|
|
||||||
$home_team = $match->home->ss_team_name;
|
|
||||||
$away_team = $match->away->ss_team_name;
|
|
||||||
} else {
|
|
||||||
$home_team = 'In Favour';
|
|
||||||
$away_team = 'Against';
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = LoadEventsQueryAll::load($filter, $match);
|
|
||||||
|
|
||||||
$count_events = $res->count();
|
|
||||||
if (! $res) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
$tmp = [];
|
|
||||||
foreach ($res as $value) {
|
|
||||||
ExpectationCollecting::sort($similar_past_matches, $tmp, 'gls', $value->home_id, $value->away_id, $value->gls_h, $value->gls_a, $match);
|
|
||||||
ExpectationCollecting::sort($similar_past_matches, $tmp, 'fls', $value->home_id, $value->away_id, $value->fls_h, $value->fls_a, $match);
|
|
||||||
ExpectationCollecting::sort($similar_past_matches, $tmp, 'ofs', $value->home_id, $value->away_id, $value->ofs_h, $value->ofs_a, $match);
|
|
||||||
ExpectationCollecting::sort($similar_past_matches, $tmp, 'crd', $value->home_id, $value->away_id, $value->crd_h, $value->crd_a, $match);
|
|
||||||
ExpectationCollecting::sort($similar_past_matches, $tmp, 'snt', $value->home_id, $value->away_id, $value->snt_h, $value->snt_a, $match);
|
|
||||||
ExpectationCollecting::sort($similar_past_matches, $tmp, 'tsh', $value->home_id, $value->away_id, $value->tsh_h, $value->tsh_a, $match);
|
|
||||||
ExpectationCollecting::sort($similar_past_matches, $tmp, 'crn', $value->home_id, $value->away_id, $value->crn_h, $value->crn_a, $match);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Log::debug('expectations '.$count_events, $tmp);
|
|
||||||
|
|
||||||
$expectations = ExpectationCalculation::calc($tmp);
|
|
||||||
$expectations['gls']['name'] = 'Goals';
|
|
||||||
$expectations['fls']['name'] = 'Fouls';
|
|
||||||
$expectations['ofs']['name'] = 'Offsides';
|
|
||||||
$expectations['crd']['name'] = 'Cards';
|
|
||||||
$expectations['snt']['name'] = 'Shots on Target';
|
|
||||||
$expectations['tsh']['name'] = 'Total Shots';
|
|
||||||
$expectations['home'] = $home_team;
|
|
||||||
$expectations['away'] = $away_team;
|
|
||||||
|
|
||||||
// Log::debug('expectations '.$count_events, $expectations);
|
|
||||||
|
|
||||||
$expectations += ['win_count' => 0, 'draw_count' => 0, 'lost_count' => 0];
|
|
||||||
foreach ($res as $value) {
|
|
||||||
if ($team_id && $team_position == 'home') {
|
|
||||||
switch ($value['result_code']) {
|
|
||||||
case '1':
|
|
||||||
$expectations['win_count']++;
|
|
||||||
break;
|
|
||||||
case 'X':
|
|
||||||
$expectations['draw_count']++;
|
|
||||||
break;
|
|
||||||
case '2':
|
|
||||||
$expectations['lost_count']++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
} elseif ($team_id && $team_position == 'away') {
|
|
||||||
switch ($value['result_code']) {
|
|
||||||
case '1':
|
|
||||||
$expectations['win_count']++;
|
|
||||||
break;
|
|
||||||
case 'X':
|
|
||||||
$expectations['draw_count']++;
|
|
||||||
break;
|
|
||||||
case '2':
|
|
||||||
$expectations['lost_count']++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
switch ($value['result_code']) {
|
|
||||||
case '1':
|
|
||||||
$expectations['win_count']++;
|
|
||||||
break;
|
|
||||||
case 'X':
|
|
||||||
$expectations['draw_count']++;
|
|
||||||
break;
|
|
||||||
case '2':
|
|
||||||
$expectations['lost_count']++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$expectations['win_odd'] = $expectations['win_count'] ? number_format(Round::odd($count_events / $expectations['win_count']), 2) : 0;
|
|
||||||
$expectations['draw_odd'] = $expectations['draw_count'] ? number_format(Round::odd($count_events / $expectations['draw_count']), 2) : 0;
|
|
||||||
$expectations['lost_odd'] = $expectations['lost_count'] ? number_format(Round::odd($count_events / $expectations['lost_count']), 2) : 0;
|
|
||||||
$expectations['count_events'] = $count_events;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Filament\Widgets\Boxes\Helper;
|
|
||||||
|
|
||||||
use App\Models\StatistikoConfig;
|
|
||||||
|
|
||||||
class ExpectationCalculation
|
|
||||||
{
|
|
||||||
public static function calc(array $expectations)
|
|
||||||
{
|
|
||||||
$summen = [];
|
|
||||||
$config = StatistikoConfig::pluck('value', 'varname');
|
|
||||||
foreach ($config as $name => $value) {
|
|
||||||
if (isset($expectations[$name])) {
|
|
||||||
$summen[$name]['sum'] = array_sum($expectations[$name]) * $value;
|
|
||||||
$summen[$name]['cnt'] = \count($expectations[$name]);
|
|
||||||
} else {
|
|
||||||
$summen[$name]['sum'] = 0;
|
|
||||||
$summen[$name]['cnt'] = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$summen2 = [];
|
|
||||||
$bets = ['gls', 'fls', 'ofs', 'crd', 'snt', 'tsh'];
|
|
||||||
foreach ($bets as $name) {
|
|
||||||
$summen2[$name]['home']['sum'] = 0;
|
|
||||||
$summen2[$name]['home']['cnt'] = 0;
|
|
||||||
$summen2[$name]['away']['sum'] = 0;
|
|
||||||
$summen2[$name]['away']['cnt'] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($summen as $key => $value) {
|
|
||||||
foreach ($bets as $name) {
|
|
||||||
if (strpos($key, $name) !== false) {
|
|
||||||
if (strpos($key, 'home') !== false) {
|
|
||||||
$summen2[$name]['home']['sum'] += $value['sum'];
|
|
||||||
$summen2[$name]['home']['cnt'] += +$value['cnt'];
|
|
||||||
}
|
|
||||||
if (strpos($key, 'away') !== false) {
|
|
||||||
$summen2[$name]['away']['sum'] += $value['sum'];
|
|
||||||
$summen2[$name]['away']['cnt'] += +$value['cnt'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$asp_result = [];
|
|
||||||
foreach ($summen2 as $bettype => $value) {
|
|
||||||
$asp_result[$bettype]['home'] = round($value['home']['sum'] / $value['home']['cnt'], 1);
|
|
||||||
$asp_result[$bettype]['away'] = round($value['away']['sum'] / $value['away']['cnt'], 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $asp_result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Filament\Widgets\Boxes\Helper;
|
|
||||||
|
|
||||||
class ExpectationCollecting
|
|
||||||
{
|
|
||||||
public static function sort(string $similar_past_matches, array &$result, string $type, int $home_id, int $away_id, float $val_home, float $val_away, object $match)
|
|
||||||
{
|
|
||||||
if ($similar_past_matches != 'none') {
|
|
||||||
$result[$type.'_home_made_total'][] = $val_home;
|
|
||||||
$result[$type.'_away_made_total'][] = $val_away;
|
|
||||||
} else {
|
|
||||||
if ($home_id == $match->home_id) {
|
|
||||||
$result[$type.'_home_made_total'][] = $val_home;
|
|
||||||
$result[$type.'_home_made_home'][] = $val_home;
|
|
||||||
$result[$type.'_home_got_total'][] = $val_away;
|
|
||||||
$result[$type.'_home_got_home'][] = $val_away;
|
|
||||||
} elseif ($away_id == $match->home_id) {
|
|
||||||
$result[$type.'_home_made_total'][] = $val_away;
|
|
||||||
$result[$type.'_home_got_total'][] = $val_away;
|
|
||||||
} elseif ($home_id == $match->away_id) {
|
|
||||||
$result[$type.'_home_made_total'][] = $val_away;
|
|
||||||
$result[$type.'_home_got_total'][] = $val_away;
|
|
||||||
} elseif ($away_id == $match->away_id) {
|
|
||||||
$result[$type.'_home_made_total'][] = $val_home;
|
|
||||||
$result[$type.'_home_made_home'][] = $val_home;
|
|
||||||
$result[$type.'_home_got_total'][] = $val_away;
|
|
||||||
$result[$type.'_home_got_home'][] = $val_home;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($away_id == $match->away_id) {
|
|
||||||
$result[$type.'_away_made_total'][] = $val_away;
|
|
||||||
$result[$type.'_away_made_home'][] = $val_away;
|
|
||||||
$result[$type.'_away_got_total'][] = $val_home;
|
|
||||||
$result[$type.'_away_got_home'][] = $val_home;
|
|
||||||
} elseif ($home_id == $match->away_id) {
|
|
||||||
$result[$type.'_away_made_total'][] = $val_home;
|
|
||||||
$result[$type.'_away_got_total'][] = $val_home;
|
|
||||||
} elseif ($away_id == $match->home_id) {
|
|
||||||
$result[$type.'_away_made_total'][] = $val_home;
|
|
||||||
$result[$type.'_away_got_total'][] = $val_home;
|
|
||||||
} elseif ($home_id == $match->home_id) {
|
|
||||||
$result[$type.'_away_made_total'][] = $val_away;
|
|
||||||
$result[$type.'_away_made_home'][] = $val_away;
|
|
||||||
$result[$type.'_away_got_total'][] = $val_home;
|
|
||||||
$result[$type.'_away_got_home'][] = $val_away;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Widgets\Boxes\Helper;
|
||||||
|
|
||||||
|
use App\Models\StatistikoConfig;
|
||||||
|
|
||||||
|
class ExpectationMethodA
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* keep code to see how to add vars from DB
|
||||||
|
*/
|
||||||
|
public static function calc(array $expectations)
|
||||||
|
{
|
||||||
|
$summen = [];
|
||||||
|
$config = StatistikoConfig::pluck('value', 'varname');
|
||||||
|
foreach ($config as $name => $value) {
|
||||||
|
if (isset($expectations[$name])) {
|
||||||
|
$summen[$name]['sum'] = array_sum($expectations[$name]) * $value;
|
||||||
|
$summen[$name]['cnt'] = \count($expectations[$name]);
|
||||||
|
} else {
|
||||||
|
$summen[$name]['sum'] = 0;
|
||||||
|
$summen[$name]['cnt'] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Widgets\Boxes\Helper;
|
||||||
|
|
||||||
|
use App\Models\StatistikoEvent;
|
||||||
|
|
||||||
|
class ExpectationsMinMax
|
||||||
|
{
|
||||||
|
public static function calc(array &$expectations, object $match)
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* get min and max for each bettype from all DB for liga
|
||||||
|
* make average
|
||||||
|
*/
|
||||||
|
$bets = ['crn', 'fls', 'ofs', 'crd', 'snt', 'tsh', 'wfl'];
|
||||||
|
$Y = 0.25;
|
||||||
|
|
||||||
|
$res = StatistikoEvent::where('league_id', $match->league_id)->get();
|
||||||
|
$count = $res->count();
|
||||||
|
|
||||||
|
$data = [];
|
||||||
|
foreach ($bets as $bet) {
|
||||||
|
$data[$bet]['home'] = 0;
|
||||||
|
$data[$bet]['away'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($res as $val) {
|
||||||
|
|
||||||
|
$data['crn']['home'] += $val->crn_h;
|
||||||
|
$data['crn']['away'] += $val->crn_a;
|
||||||
|
|
||||||
|
$data['fls']['home'] += $val->fls_h;
|
||||||
|
$data['fls']['away'] += $val->fls_a;
|
||||||
|
|
||||||
|
$data['ofs']['home'] += $val->ofs_h;
|
||||||
|
$data['ofs']['away'] += $val->ofs_a;
|
||||||
|
|
||||||
|
$data['snt']['home'] += $val->snt_h;
|
||||||
|
$data['snt']['away'] += $val->snt_a;
|
||||||
|
|
||||||
|
$data['tsh']['home'] += $val->tsh_h;
|
||||||
|
$data['tsh']['away'] += $val->tsh_a;
|
||||||
|
|
||||||
|
$data['crd']['home'] += $val->crd_h;
|
||||||
|
$data['crd']['away'] += $val->crd_a;
|
||||||
|
|
||||||
|
$data['wfl']['home'] += $val->wfl_h;
|
||||||
|
$data['wfl']['away'] += $val->wfl_a;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($data as $key => $value) {
|
||||||
|
$data[$key]['home'] = $value['home'] / $count;
|
||||||
|
$data[$key]['away'] = $value['away'] / $count;
|
||||||
|
}
|
||||||
|
|
||||||
|
$final = [];
|
||||||
|
foreach ($data as $key => $value) {
|
||||||
|
if ($value['home'] > $value['away']) {
|
||||||
|
$final[$key]['max'] = round($value['home'] * (1 + $Y), 2);
|
||||||
|
$final[$key]['min'] = round($value['away'] * (1 - $Y), 2);
|
||||||
|
} else {
|
||||||
|
$final[$key]['min'] = round($value['home'] * (1 - $Y), 2);
|
||||||
|
$final[$key]['max'] = round($value['away'] * (1 + $Y), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($bets as $key) {
|
||||||
|
if (isset($expectations[$key])) {
|
||||||
|
if ($expectations[$key]['home'] > $final[$key]['max']) {
|
||||||
|
$expectations[$key]['home'] = $final[$key]['max'];
|
||||||
|
}
|
||||||
|
if ($expectations[$key]['away'] > $final[$key]['max']) {
|
||||||
|
$expectations[$key]['away'] = $final[$key]['max'];
|
||||||
|
}
|
||||||
|
if ($expectations[$key]['home'] < $final[$key]['min']) {
|
||||||
|
$expectations[$key]['home'] = $final[$key]['min'];
|
||||||
|
}
|
||||||
|
if ($expectations[$key]['away'] < $final[$key]['min']) {
|
||||||
|
$expectations[$key]['away'] = $final[$key]['min'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GOALS with asp from fixtures
|
||||||
|
$gls_home_max = $match->exp_home * (1 + ($Y / 2));
|
||||||
|
$gls_home_min = $match->exp_home * (1 - ($Y / 2));
|
||||||
|
$gls_away_max = $match->exp_away * (1 + ($Y / 2));
|
||||||
|
$gls_away_min = $match->exp_away * (1 - ($Y / 2));
|
||||||
|
|
||||||
|
if (isset($expectations['gls'])) {
|
||||||
|
if ($expectations['gls']['home'] > $gls_home_max) {
|
||||||
|
$expectations['gls']['home'] = $gls_home_max;
|
||||||
|
}
|
||||||
|
if ($expectations['gls']['away'] > $gls_away_max) {
|
||||||
|
$expectations['gls']['away'] = $gls_away_max;
|
||||||
|
}
|
||||||
|
if ($expectations['gls']['home'] < $gls_home_min) {
|
||||||
|
$expectations['gls']['home'] = $gls_home_min;
|
||||||
|
}
|
||||||
|
if ($expectations['gls']['away'] < $gls_away_min) {
|
||||||
|
$expectations['gls']['away'] = $gls_away_min;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,6 +13,15 @@ class LoadEventsBoxes
|
|||||||
$team_id = (int) $filter['team_id'] ?? 0;
|
$team_id = (int) $filter['team_id'] ?? 0;
|
||||||
$similar_past_matches = $filter['similar_past_matches'];
|
$similar_past_matches = $filter['similar_past_matches'];
|
||||||
|
|
||||||
|
$match = StatisticFixtures::with('home')->with('away')->where('id', (int) $match_id)->first();
|
||||||
|
if ($similar_past_matches != 'none') {
|
||||||
|
$home_team = $match->home->ss_team_name;
|
||||||
|
$away_team = $match->away->ss_team_name;
|
||||||
|
} else {
|
||||||
|
$home_team = 'In Favour';
|
||||||
|
$away_team = 'Against';
|
||||||
|
}
|
||||||
|
|
||||||
if (! $league_id) {
|
if (! $league_id) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@@ -20,14 +29,25 @@ class LoadEventsBoxes
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$match = StatisticFixtures::with('home')->with('away')->where('id', (int) $match_id)->first();
|
|
||||||
|
|
||||||
if (! $match) {
|
if (! $match) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$expectations = [];
|
$expectations = [];
|
||||||
ExpectationsTeam::load($expectations, $filter, $match);
|
$expectations['gls']['name'] = 'Goals';
|
||||||
|
$expectations['crn']['name'] = 'Corner';
|
||||||
|
$expectations['fls']['name'] = 'Fouls';
|
||||||
|
$expectations['ofs']['name'] = 'Offsides';
|
||||||
|
$expectations['crd']['name'] = 'Cards';
|
||||||
|
$expectations['snt']['name'] = 'Shots on Target';
|
||||||
|
$expectations['tsh']['name'] = 'Total Shots';
|
||||||
|
$expectations['wfl']['name'] = 'Was Fouled';
|
||||||
|
$expectations['home'] = $home_team;
|
||||||
|
$expectations['away'] = $away_team;
|
||||||
|
|
||||||
|
Expectation1X2::load($expectations, $filter, $match);
|
||||||
|
|
||||||
|
ExpectationsBox3::load($expectations, $filter, $match);
|
||||||
|
|
||||||
if ($team_id == $match->home_id) {
|
if ($team_id == $match->home_id) {
|
||||||
$expectations['active_team'] = $match->home->ss_team_name;
|
$expectations['active_team'] = $match->home->ss_team_name;
|
||||||
@@ -40,10 +60,29 @@ class LoadEventsBoxes
|
|||||||
*/
|
*/
|
||||||
if ($team_id != 0 && $similar_past_matches == 'none') {
|
if ($team_id != 0 && $similar_past_matches == 'none') {
|
||||||
AverageTeam::load($expectations, $filter);
|
AverageTeam::load($expectations, $filter);
|
||||||
AverageTeamSeason::load($expectations, $filter);
|
AverageTeamSeason::load($expectations, $filter, $match);
|
||||||
AverageLeagueSeason::load($expectations, $filter);
|
AverageLeagueSeason::load($expectations, $filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $expectations;
|
return $expectations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function template()
|
||||||
|
{
|
||||||
|
$arr = [];
|
||||||
|
$bets = ['gls', 'crn', 'fls', 'ofs', 'crd', 'snt', 'tsh', 'wfl'];
|
||||||
|
foreach ($bets as $bet) {
|
||||||
|
foreach (['team_home', 'team_away'] as $team) {
|
||||||
|
foreach (['scored', 'conceded'] as $sc) {
|
||||||
|
foreach (['home', 'away'] as $ha) {
|
||||||
|
foreach (['evt', 'sum'] as $es) {
|
||||||
|
$arr[$bet][$team][$sc][$ha][$es] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $arr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -32,13 +32,18 @@ class BoxesBettypeAll extends StatsOverviewWidget
|
|||||||
|
|
||||||
protected function getStats(): array
|
protected function getStats(): array
|
||||||
{
|
{
|
||||||
$data = LoadEventsBoxes::load($this->filters, false);
|
|
||||||
|
|
||||||
// dd($data);
|
|
||||||
|
|
||||||
$similar_past_matches = $this->filters['similar_past_matches'];
|
$similar_past_matches = $this->filters['similar_past_matches'];
|
||||||
|
|
||||||
$team_position = $this->filters['team_position'];
|
$team_position = $this->filters['team_position'];
|
||||||
|
|
||||||
|
$team_id = (int) $this->filters['team_id'] ?? 0;
|
||||||
|
|
||||||
|
if (! $team_id && $similar_past_matches == 'none') {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = LoadEventsBoxes::load($this->filters, false);
|
||||||
|
|
||||||
$team_position = in_array($this->filters['team_position'], ['home', 'away']) ? ucfirst($this->filters['team_position']) : 'Both Position';
|
$team_position = in_array($this->filters['team_position'], ['home', 'away']) ? ucfirst($this->filters['team_position']) : 'Both Position';
|
||||||
|
|
||||||
if (! $data) {
|
if (! $data) {
|
||||||
@@ -69,7 +74,7 @@ class BoxesBettypeAll extends StatsOverviewWidget
|
|||||||
->description('Home - Away');
|
->description('Home - Away');
|
||||||
}
|
}
|
||||||
|
|
||||||
// BOX AVERAGE
|
// BOX AVERAGE TEAM
|
||||||
if (isset($data['gls_team'])) {
|
if (isset($data['gls_team'])) {
|
||||||
$boxes[] = Stat::make('Average '.$data['active_team'], self::template_tabelle_2($data))
|
$boxes[] = Stat::make('Average '.$data['active_team'], self::template_tabelle_2($data))
|
||||||
->extraAttributes(['class' => 'box-blank'])
|
->extraAttributes(['class' => 'box-blank'])
|
||||||
@@ -134,13 +139,13 @@ class BoxesBettypeAll extends StatsOverviewWidget
|
|||||||
// TEAMPLATE BOX 1
|
// TEAMPLATE BOX 1
|
||||||
protected function template_tabelle_1(array $data): HtmlString
|
protected function template_tabelle_1(array $data): HtmlString
|
||||||
{
|
{
|
||||||
$bets = ['gls', 'fls', 'ofs', 'crd', 'snt', 'tsh'];
|
$bets = ['gls', 'crn', 'fls', 'ofs', 'crd', 'snt', 'tsh', 'wfl'];
|
||||||
$str = '<div class="grid grid-cols-4 gap-0.5 text-xs">';
|
$str = '<div class="grid grid-cols-4 gap-0.5 text-xs">';
|
||||||
// $str .= '<div class="col-span-2"></div><div>Home</div><div>Away</div>';
|
// $str .= '<div class="col-span-2"></div><div>Home</div><div>Away</div>';
|
||||||
foreach ($bets as $name) {
|
foreach ($bets as $name) {
|
||||||
$str .= '<div class="font-normal text-left col-span-2">'.$data[$name]['name'].'</div>';
|
$str .= '<div class="font-normal text-left col-span-2">'.$data[$name]['name'].'</div>';
|
||||||
$str .= '<div class="text-right">'.number_format($data[$name]['home'], 1).'</div>';
|
$str .= '<div class="text-right">'.number_format($data[$name]['home'] ?? 0, 1).'</div>';
|
||||||
$str .= '<div class="text-right">'.number_format($data[$name]['away'], 1).'</div>';
|
$str .= '<div class="text-right">'.number_format($data[$name]['away'] ?? 0, 1).'</div>';
|
||||||
}
|
}
|
||||||
$str .= '</div>';
|
$str .= '</div>';
|
||||||
|
|
||||||
@@ -149,13 +154,13 @@ class BoxesBettypeAll extends StatsOverviewWidget
|
|||||||
|
|
||||||
protected function template_tabelle_2(array $data): HtmlString
|
protected function template_tabelle_2(array $data): HtmlString
|
||||||
{
|
{
|
||||||
$bets = ['gls_team', 'fls_team', 'ofs_team', 'crd_team', 'snt_team', 'tsh_team'];
|
$bets = ['gls_team', 'crn_team', 'fls_team', 'ofs_team', 'crd_team', 'snt_team', 'tsh_team', 'wfl_team'];
|
||||||
$str = '<div class="grid grid-cols-4 gap-0.5 text-xs">';
|
$str = '<div class="grid grid-cols-4 gap-0.5 text-xs">';
|
||||||
// $str .= '<div class="col-span-2"></div><div>Home</div><div>Away</div>';
|
// $str .= '<div class="col-span-2"></div><div>Home</div><div>Away</div>';
|
||||||
foreach ($bets as $name) {
|
foreach ($bets as $name) {
|
||||||
$str .= '<div class="font-normal text-left col-span-2">'.$data[$name]['name'].'</div>';
|
$str .= '<div class="font-normal text-left col-span-2">'.$data[$name]['name'].'</div>';
|
||||||
$str .= '<div class="text-right">'.number_format($data[$name]['home'], 1).'</div>';
|
$str .= '<div class="text-right">'.number_format($data[$name]['home'] ?? 0, 1).'</div>';
|
||||||
$str .= '<div class="text-right">'.number_format($data[$name]['away'], 1).'</div>';
|
$str .= '<div class="text-right">'.number_format($data[$name]['away'] ?? 0, 1).'</div>';
|
||||||
}
|
}
|
||||||
$str .= '</div>';
|
$str .= '</div>';
|
||||||
|
|
||||||
@@ -164,13 +169,13 @@ class BoxesBettypeAll extends StatsOverviewWidget
|
|||||||
|
|
||||||
protected function template_tabelle_3(array $data): HtmlString
|
protected function template_tabelle_3(array $data): HtmlString
|
||||||
{
|
{
|
||||||
$bets = ['gls_team_season', 'fls_team_season', 'ofs_team_season', 'crd_team_season', 'snt_team_season', 'tsh_team_season'];
|
$bets = ['gls_team_season', 'crn_team_season', 'fls_team_season', 'ofs_team_season', 'crd_team_season', 'snt_team_season', 'tsh_team_season', 'wfl_team_season'];
|
||||||
$str = '<div class="grid grid-cols-4 gap-0.5 text-xs">';
|
$str = '<div class="grid grid-cols-4 gap-0.5 text-xs">';
|
||||||
// $str .= '<div class="col-span-2"></div><div>Home</div><div>Away</div>';
|
// $str .= '<div class="col-span-2"></div><div>Home</div><div>Away</div>';
|
||||||
foreach ($bets as $name) {
|
foreach ($bets as $name) {
|
||||||
$str .= '<div class="font-normal text-left col-span-2">'.$data[$name]['name'].'</div>';
|
$str .= '<div class="font-normal text-left col-span-2">'.$data[$name]['name'].'</div>';
|
||||||
$str .= '<div class="text-right">'.number_format($data[$name]['home'], 1).'</div>';
|
$str .= '<div class="text-right">'.number_format($data[$name]['home'] ?? 0, 1).'</div>';
|
||||||
$str .= '<div class="text-right">'.number_format($data[$name]['away'], 1).'</div>';
|
$str .= '<div class="text-right">'.number_format($data[$name]['away'] ?? 0, 1).'</div>';
|
||||||
}
|
}
|
||||||
$str .= '</div>';
|
$str .= '</div>';
|
||||||
|
|
||||||
@@ -179,13 +184,13 @@ class BoxesBettypeAll extends StatsOverviewWidget
|
|||||||
|
|
||||||
protected function template_tabelle_4(array $data): HtmlString
|
protected function template_tabelle_4(array $data): HtmlString
|
||||||
{
|
{
|
||||||
$bets = ['gls_liga_season', 'fls_liga_season', 'ofs_liga_season', 'crd_liga_season', 'snt_liga_season', 'tsh_liga_season'];
|
$bets = ['gls_liga_season', 'crn_liga_season', 'fls_liga_season', 'ofs_liga_season', 'crd_liga_season', 'snt_liga_season', 'tsh_liga_season', 'wfl_liga_season'];
|
||||||
$str = '<div class="grid grid-cols-4 gap-0.5 text-xs">';
|
$str = '<div class="grid grid-cols-4 gap-0.5 text-xs">';
|
||||||
// $str .= '<div class="col-span-2"></div><div>Home</div><div>Away</div>';
|
// $str .= '<div class="col-span-2"></div><div>Home</div><div>Away</div>';
|
||||||
foreach ($bets as $name) {
|
foreach ($bets as $name) {
|
||||||
$str .= '<div class="font-normal text-left col-span-2">'.$data[$name]['name'].'</div>';
|
$str .= '<div class="font-normal text-left col-span-2">'.$data[$name]['name'].'</div>';
|
||||||
$str .= '<div class="text-right">'.number_format($data[$name]['home'], 1).'</div>';
|
$str .= '<div class="text-right">'.number_format($data[$name]['home'] ?? 0, 1).'</div>';
|
||||||
$str .= '<div class="text-right">'.number_format($data[$name]['away'], 1).'</div>';
|
$str .= '<div class="text-right">'.number_format($data[$name]['away'] ?? 0, 1).'</div>';
|
||||||
}
|
}
|
||||||
$str .= '</div>';
|
$str .= '</div>';
|
||||||
|
|
||||||
|
|||||||
@@ -1,345 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Filament\Widgets;
|
|
||||||
|
|
||||||
use App\Filament\Widgets\Charts\HelperStatisticType;
|
|
||||||
use App\Filament\Widgets\Charts\LoadEvents;
|
|
||||||
use App\Utilities\Round;
|
|
||||||
use Filament\Widgets\Concerns\InteractsWithPageFilters;
|
|
||||||
use Filament\Widgets\StatsOverviewWidget;
|
|
||||||
use Filament\Widgets\StatsOverviewWidget\Stat;
|
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
use Illuminate\Support\HtmlString;
|
|
||||||
use Livewire\Attributes\Reactive;
|
|
||||||
|
|
||||||
// use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
class BoxesBettypeSingle extends StatsOverviewWidget
|
|
||||||
{
|
|
||||||
use InteractsWithPageFilters;
|
|
||||||
|
|
||||||
protected ?string $pollingInterval = null;
|
|
||||||
|
|
||||||
protected int|array|null $columns = null;
|
|
||||||
|
|
||||||
#[Reactive]
|
|
||||||
public ?array $filters = [];
|
|
||||||
|
|
||||||
public ?int $count;
|
|
||||||
|
|
||||||
public function mount(array $filters)
|
|
||||||
{
|
|
||||||
$this->filters = $filters;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getStats(): array
|
|
||||||
{
|
|
||||||
$data = LoadEvents::load($this->filters, false);
|
|
||||||
|
|
||||||
$team_id = (int) $this->filters['team_id'] ?? 0;
|
|
||||||
|
|
||||||
$season = $this->filters['season'] ?? 0;
|
|
||||||
$season_or_date = $this->filters['season_or_date'];
|
|
||||||
$similar_past_matches = $this->filters['similar_past_matches'];
|
|
||||||
$date_events = '';
|
|
||||||
|
|
||||||
switch ($season_or_date) {
|
|
||||||
case 'season':
|
|
||||||
if ($season) {
|
|
||||||
$date_events = implode(', ', $season);
|
|
||||||
} else {
|
|
||||||
$date_events = 'Current Season';
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$start = $this->filters['start_date'] ?? 0;
|
|
||||||
$end = $this->filters['end_date'] ?? 0;
|
|
||||||
|
|
||||||
$tmp = [];
|
|
||||||
if ($start) {
|
|
||||||
$tmp[] = 'From: '.Carbon::createFromDate($start)->format('Y-m-d');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($end) {
|
|
||||||
$tmp[] = 'To: '.Carbon::createFromDate($end)->format('Y-m-d');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($tmp) {
|
|
||||||
$date_events = implode('<br>', $tmp);
|
|
||||||
} else {
|
|
||||||
$date_events = 'All Dates';
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$team_position = $this->filters['team_position'] ? ucfirst($this->filters['team_position']) : 'Position Both';
|
|
||||||
|
|
||||||
if (! $data) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
$statistic_type = HelperStatisticType::get($this->filters);
|
|
||||||
|
|
||||||
if (! isset($data['datasets'][0])) {
|
|
||||||
$data['datasets'][0]['data'] = [];
|
|
||||||
$data['datasets'][1]['data'] = [];
|
|
||||||
$total_home = 0;
|
|
||||||
$total_away = 0;
|
|
||||||
$summe_home = 0;
|
|
||||||
$summe_away = 0;
|
|
||||||
$home_team = '';
|
|
||||||
$away_team = '';
|
|
||||||
} else {
|
|
||||||
$arr_home = $data['datasets'][0]['data'];
|
|
||||||
$arr_away = $data['datasets'][1]['data'];
|
|
||||||
$total_home = count($arr_home);
|
|
||||||
$total_away = count($arr_away);
|
|
||||||
$summe_home = array_sum($arr_home);
|
|
||||||
$summe_away = array_sum($arr_away);
|
|
||||||
$home_team = $data['home_team'];
|
|
||||||
$away_team = $data['away_team'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($data['results'])) {
|
|
||||||
$win = $data['results']['w'] ? number_format(Round::odd($total_home / $data['results']['w']), 2) : 0;
|
|
||||||
$draw = $data['results']['d'] ? number_format(Round::odd($total_home / $data['results']['d']), 2) : 0;
|
|
||||||
$lost = $data['results']['l'] ? number_format(Round::odd($total_home / $data['results']['l']), 2) : 0;
|
|
||||||
} else {
|
|
||||||
$win = 0;
|
|
||||||
$draw = 0;
|
|
||||||
$lost = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($total_home) {
|
|
||||||
$value_home = number_format($summe_home / $total_home, 1);
|
|
||||||
} else {
|
|
||||||
$value_home = 0;
|
|
||||||
}
|
|
||||||
if ($total_away) {
|
|
||||||
$value_away = number_format($summe_away / $total_away, 1);
|
|
||||||
} else {
|
|
||||||
$value_away = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$max_boxes = 3;
|
|
||||||
$average_team_home = 0;
|
|
||||||
$average_team_away = 0;
|
|
||||||
$average_league_home = 0;
|
|
||||||
$average_league_away = 0;
|
|
||||||
$expectations_home = 0;
|
|
||||||
$expectations_away = 0;
|
|
||||||
|
|
||||||
$expectations_home = $data['expectations_home'] ?? 0;
|
|
||||||
$expectations_away = $data['expectations_away'] ?? 0;
|
|
||||||
|
|
||||||
foreach ($data['datasets'] as $value) {
|
|
||||||
if ($value['label'] == 'Average Team') {
|
|
||||||
$average_team_home = $value['average_team_home'] ?? 0;
|
|
||||||
$average_team_away = $value['average_team_away'] ?? 0;
|
|
||||||
$max_boxes++;
|
|
||||||
}
|
|
||||||
if ($value['label'] == 'Average League') {
|
|
||||||
$average_league_home = $value['average_league_home'] ?? 0;
|
|
||||||
$average_league_away = $value['average_league_away'] ?? 0;
|
|
||||||
$max_boxes++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// i box 1 3 4 5 devono sempre avere 1 decimale, se il valore è 12 fai scrivere 12.0
|
|
||||||
// il box 2 sempre un numero intero
|
|
||||||
// il box 6 sempre a due decimali, se trovi 2 fai scrivere 2.00
|
|
||||||
|
|
||||||
$boxes = [];
|
|
||||||
|
|
||||||
if ($similar_past_matches != 'none') {
|
|
||||||
// BOX 2
|
|
||||||
$boxes[] = Stat::make('Total', self::template_box2($total_home))
|
|
||||||
->description(fn () => $similar_past_matches == 'all' ? 'SPM Source Database' : 'SPM Source League')
|
|
||||||
->extraAttributes([
|
|
||||||
'x-init' => "animate('number-of-events', $total_home);",
|
|
||||||
'class' => 'box-info',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// BOX 3
|
|
||||||
$boxes[] = Stat::make('Average '.$statistic_type, self::template_box3('Home', 'Away', $value_home, $value_away))
|
|
||||||
->description('Team '.$team_position)
|
|
||||||
->extraAttributes([
|
|
||||||
'x-init' => "animate('average_home', $value_home, 1); animate('average_away', $value_away, 1)",
|
|
||||||
'class' => 'box-success',
|
|
||||||
]);
|
|
||||||
// BOX 6
|
|
||||||
$boxes[] = Stat::make('Odds', self::templateOdds($data, $win, $draw, $lost))
|
|
||||||
->description($team_position)
|
|
||||||
->extraAttributes([
|
|
||||||
'x-init' => "animate('win', $win); animate('draw', $draw); animate('lost', $lost)",
|
|
||||||
'class' => 'box-purple',
|
|
||||||
]);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// BOX 1
|
|
||||||
$boxes[] = Stat::make($statistic_type, self::template_box1($expectations_home, $expectations_away))
|
|
||||||
->description('Expected Values')
|
|
||||||
->extraAttributes([
|
|
||||||
'x-init' => "animate('expectations_home', $expectations_home, 1); animate('expectations_away', $expectations_away, 1)",
|
|
||||||
'class' => 'box-yellow',
|
|
||||||
]);
|
|
||||||
|
|
||||||
if ($team_id) {
|
|
||||||
|
|
||||||
// BOX 2
|
|
||||||
$boxes[] = Stat::make('Total', self::template_box2($total_home))
|
|
||||||
->description(fn () => new HtmlString($date_events))
|
|
||||||
->extraAttributes([
|
|
||||||
'x-init' => "animate('number-of-events', $total_home);",
|
|
||||||
'class' => 'box-info',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// BOX 3
|
|
||||||
$boxes[] = Stat::make('Average '.$statistic_type, self::template_box3($home_team, $away_team, $value_home, $value_away))
|
|
||||||
->description('Team '.$team_position)
|
|
||||||
->extraAttributes([
|
|
||||||
'x-init' => "animate('average_home', $value_home, 1); animate('average_away', $value_away, 1)",
|
|
||||||
'class' => 'box-success',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// BOX 4
|
|
||||||
$boxes[] = Stat::make('Average '.$statistic_type, self::template_box4($home_team, $away_team, $average_team_home, $average_team_away))
|
|
||||||
->description('Team Season')
|
|
||||||
->extraAttributes([
|
|
||||||
'x-init' => "animate('av_team_home', $average_team_home, 1); animate('av_team_away', $average_team_away, 1)",
|
|
||||||
'class' => 'box-success',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// BOX 5
|
|
||||||
$boxes[] = Stat::make('Average '.$statistic_type, self::template_box5('Home', 'Away', $average_league_home, $average_league_away))
|
|
||||||
->description('League Season')
|
|
||||||
->extraAttributes([
|
|
||||||
'x-init' => "animate('av_league_home', $average_league_home, 1); animate('av_league_away', $average_league_away, 1)",
|
|
||||||
'class' => 'box-success',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// BOX 6
|
|
||||||
$boxes[] = Stat::make('Odds', self::templateOdds($data, $win, $draw, $lost))
|
|
||||||
->description($team_position)
|
|
||||||
->extraAttributes([
|
|
||||||
'x-init' => "animate('win', $win, 2); animate('draw', $draw, 2); animate('lost', $lost, 2)",
|
|
||||||
'class' => 'box-purple',
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->columns = [
|
|
||||||
'default' => 1,
|
|
||||||
'sm' => 2,
|
|
||||||
'md' => 3,
|
|
||||||
'xl' => 6,
|
|
||||||
];
|
|
||||||
|
|
||||||
return $boxes;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TEAMPLATE BOX 1
|
|
||||||
protected function template_box1(float $expectations_home, float $expectations_away): HtmlString
|
|
||||||
{
|
|
||||||
return new HtmlString('<div class="grid grid-cols-2 justify-center font-bold text-2xl">
|
|
||||||
<span class="text-center" id="expectations_home">'.$expectations_home.'</span>
|
|
||||||
<span class="text-center" id="expectations_away">'.$expectations_away.'</span>
|
|
||||||
<span class="text-center text-xs text-gray-500 dark:text-gray-400">Home</span>
|
|
||||||
<span class="text-center text-xs text-gray-500 dark:text-gray-400">Away</span>
|
|
||||||
</div>');
|
|
||||||
}
|
|
||||||
|
|
||||||
// TEAMPLATE BOX 2
|
|
||||||
protected function template_box2(float $total_home): HtmlString
|
|
||||||
{
|
|
||||||
return new HtmlString('<div class="grid grid-cols-1 justify-center font-bold text-2xl">
|
|
||||||
<span class="text-center" id="number-of-events">'.$total_home.'</span>
|
|
||||||
<span class="text-center text-xs text-gray-500 dark:text-gray-400">Events</span>
|
|
||||||
</div>');
|
|
||||||
}
|
|
||||||
|
|
||||||
// TEAMPLATE BOX 3
|
|
||||||
protected function template_box3(string $home_team, string $away_team, float $value_home, float $value_away): HtmlString
|
|
||||||
{
|
|
||||||
return new HtmlString('<div class="grid grid-cols-2 justify-center font-bold text-2xl">
|
|
||||||
<span class="text-center" id="average_home">'.$value_home.'</span>
|
|
||||||
<span class="text-center" id="average_away">'.$value_away.'</span>
|
|
||||||
<span class="text-center text-xs text-gray-500 dark:text-gray-400">'.$home_team.'</span>
|
|
||||||
<span class="text-center text-xs text-gray-500 dark:text-gray-400">'.$away_team.'</span>
|
|
||||||
</div>');
|
|
||||||
}
|
|
||||||
|
|
||||||
// TEAMPLATE BOX 4
|
|
||||||
protected function template_box4(string $home_team, string $away_team, float $value_home, float $value_away): HtmlString
|
|
||||||
{
|
|
||||||
return new HtmlString('<div class="grid grid-cols-2 justify-center font-bold text-2xl">
|
|
||||||
<span class="text-center" id="av_team_home">'.$value_home.'</span>
|
|
||||||
<span class="text-center" id="av_team_away">'.$value_away.'</span>
|
|
||||||
<span class="text-center text-xs text-gray-500 dark:text-gray-400">'.$home_team.'</span>
|
|
||||||
<span class="text-center text-xs text-gray-500 dark:text-gray-400">'.$away_team.'</span>
|
|
||||||
</div>');
|
|
||||||
}
|
|
||||||
|
|
||||||
// TEAMPLATE BOX 5
|
|
||||||
protected function template_box5(string $home_team, string $away_team, float $value_home, float $value_away): HtmlString
|
|
||||||
{
|
|
||||||
return new HtmlString('<div class="grid grid-cols-2 justify-center font-bold text-2xl">
|
|
||||||
<span class="text-center" id="av_league_home">'.$value_home.'</span>
|
|
||||||
<span class="text-center" id="av_league_away">'.$value_away.'</span>
|
|
||||||
<span class="text-center text-xs text-gray-500 dark:text-gray-400">'.$home_team.'</span>
|
|
||||||
<span class="text-center text-xs text-gray-500 dark:text-gray-400">'.$away_team.'</span>
|
|
||||||
</div>');
|
|
||||||
}
|
|
||||||
|
|
||||||
// TEAMPLATE BOX 6 odds
|
|
||||||
protected function templateOdds(array &$data, float $win, float $draw, float $lost): HtmlString
|
|
||||||
{
|
|
||||||
if ($data['similar_past_matches'] != 'none') {
|
|
||||||
$name_win = '<b>1</b> ('.$data['results']['w'].')';
|
|
||||||
$name_draw = '<b>X</b> ('.$data['results']['d'].')';
|
|
||||||
$name_lost = '<b>2</b> ('.$data['results']['l'].')';
|
|
||||||
} else {
|
|
||||||
$name_win = '<b>Win</b> ('.$data['results']['w'].')';
|
|
||||||
$name_draw = '<b>Draw</b> ('.$data['results']['d'].')';
|
|
||||||
$name_lost = '<b>Lost</b> ('.$data['results']['l'].')';
|
|
||||||
}
|
|
||||||
|
|
||||||
return new HtmlString('<div class="grid grid-cols-3 justify-center">
|
|
||||||
<span class="text-center font-bold text-xl" id="win">'.number_format($win, 2).'</span>
|
|
||||||
<span class="text-center font-bold text-xl" id="draw">'.number_format($draw, 2).'</span>
|
|
||||||
<span class="text-center font-bold text-xl" id="lost">'.number_format($lost, 2).'</span>
|
|
||||||
<span class="text-center text-xs text-gray-500 dark:text-gray-400">'.$name_win.'</span>
|
|
||||||
<span class="text-center text-xs text-gray-500 dark:text-gray-400">'.$name_draw.'</span>
|
|
||||||
<span class="text-center text-xs text-gray-500 dark:text-gray-400">'.$name_lost.'</span>
|
|
||||||
</div>');
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getMedian(array $arr)
|
|
||||||
{
|
|
||||||
sort($arr);
|
|
||||||
|
|
||||||
$size = count($arr);
|
|
||||||
|
|
||||||
if ($size % 2 == 0) {
|
|
||||||
// even
|
|
||||||
$m = ($size) / 2;
|
|
||||||
$m1 = $m - 1;
|
|
||||||
$m2 = $m;
|
|
||||||
|
|
||||||
// dd($m1, $m2, $arr);
|
|
||||||
|
|
||||||
// dd('GERADE', $arr, $size, $m, $m1, $m2);
|
|
||||||
if (isset($arr[$m1]) && isset($arr[$m2])) {
|
|
||||||
return round(($arr[$m1] + $arr[$m2]) / 2, 2);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// odd (add 1 because array starts with 0)
|
|
||||||
$m = (int) ceil($size / 2);
|
|
||||||
// dd($m, $arr);
|
|
||||||
// dd('UNGERADE', $m, $arr, $arr[$m]);
|
|
||||||
if (isset($arr[$m])) {
|
|
||||||
return $arr[$m];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -38,9 +38,9 @@ class ChartPlayer extends ChartWidget
|
|||||||
c0.211,0.1782,0.5264,0.1516,0.7046-0.0593C13.0037,6.5523,13.0018,6.2761,12.84,6.09z"></path>
|
c0.211,0.1782,0.5264,0.1516,0.7046-0.0593C13.0037,6.5523,13.0018,6.2761,12.84,6.09z"></path>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
'.$this->player.'
|
' . $this->player . '
|
||||||
</span>
|
</span>
|
||||||
<span>'.$this->type.'</span>
|
<span>' . $this->type . '</span>
|
||||||
</span>
|
</span>
|
||||||
');
|
');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ class LoadEvents
|
|||||||
$team_id = (int) $filter['team_id'] ?? 0;
|
$team_id = (int) $filter['team_id'] ?? 0;
|
||||||
$statistic_type = $filter['statistic_type'] ?? 'gls';
|
$statistic_type = $filter['statistic_type'] ?? 'gls';
|
||||||
$team_position = $filter['team_position'];
|
$team_position = $filter['team_position'];
|
||||||
$seasonmode = $filter['seasonmode'];
|
|
||||||
$accuracy = (float) $filter['accuracy'] ?? 0.5;
|
$accuracy = (float) $filter['accuracy'] ?? 0.5;
|
||||||
$similar_past_matches = $filter['similar_past_matches'];
|
$similar_past_matches = $filter['similar_past_matches'];
|
||||||
|
|
||||||
@@ -28,6 +27,10 @@ class LoadEvents
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $team_id && $similar_past_matches == 'none') {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
if ($statistic_type == 'none') {
|
if ($statistic_type == 'none') {
|
||||||
$statistic_type = 'gls';
|
$statistic_type = 'gls';
|
||||||
}
|
}
|
||||||
@@ -128,10 +131,10 @@ class LoadEvents
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($statistic_type == 'gls') {
|
// if ($statistic_type == 'gls') {
|
||||||
$dataset_exp_home[] = (float) round($value['exp_home'], 1);
|
// $dataset_exp_home[] = (float) round($value['exp_home'], 1);
|
||||||
$dataset_exp_away[] = (float) round($value['exp_away'], 1);
|
// $dataset_exp_away[] = (float) round($value['exp_away'], 1);
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
if ($team_position == 'home') {
|
if ($team_position == 'home') {
|
||||||
switch ($value['result_code']) {
|
switch ($value['result_code']) {
|
||||||
@@ -148,10 +151,10 @@ class LoadEvents
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($statistic_type == 'gls') {
|
// if ($statistic_type == 'gls') {
|
||||||
$dataset_exp_home[] = (float) round($value['exp_home'], 1);
|
// $dataset_exp_home[] = (float) round($value['exp_home'], 1);
|
||||||
$dataset_exp_away[] = (float) round($value['exp_away'], 1);
|
// $dataset_exp_away[] = (float) round($value['exp_away'], 1);
|
||||||
}
|
// }
|
||||||
} elseif ($team_position == 'away') {
|
} elseif ($team_position == 'away') {
|
||||||
|
|
||||||
switch ($value['result_code']) {
|
switch ($value['result_code']) {
|
||||||
@@ -168,10 +171,10 @@ class LoadEvents
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($statistic_type == 'gls') {
|
// if ($statistic_type == 'gls') {
|
||||||
$dataset_exp_home[] = (float) round($value['exp_away'], 1);
|
// $dataset_exp_home[] = (float) round($value['exp_away'], 1);
|
||||||
$dataset_exp_away[] = (float) round($value['exp_home'], 1);
|
// $dataset_exp_away[] = (float) round($value['exp_home'], 1);
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// dd($team_id, $value['home_id'], $value['away_id']);
|
// dd($team_id, $value['home_id'], $value['away_id']);
|
||||||
@@ -200,10 +203,10 @@ class LoadEvents
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($statistic_type == 'gls') {
|
// if ($statistic_type == 'gls') {
|
||||||
$dataset_exp_home[] = (float) round($value['exp_away'], 1);
|
// $dataset_exp_home[] = (float) round($value['exp_away'], 1);
|
||||||
$dataset_exp_away[] = (float) round($value['exp_home'], 1);
|
// $dataset_exp_away[] = (float) round($value['exp_home'], 1);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($val_home) && isset($val_away)) {
|
if (isset($val_home) && isset($val_away)) {
|
||||||
@@ -240,8 +243,8 @@ class LoadEvents
|
|||||||
$dataset_home2 = [];
|
$dataset_home2 = [];
|
||||||
$dataset_away2 = [];
|
$dataset_away2 = [];
|
||||||
|
|
||||||
$home_id = $match->home_id;
|
// $home_id = $match->home_id;
|
||||||
$away_id = $match->away_id;
|
// $away_id = $match->away_id;
|
||||||
|
|
||||||
foreach ($res[$team_position] as $value) {
|
foreach ($res[$team_position] as $value) {
|
||||||
|
|
||||||
@@ -310,13 +313,13 @@ class LoadEvents
|
|||||||
'results_per_event' => $results_per_event,
|
'results_per_event' => $results_per_event,
|
||||||
'data' => $dataset_home,
|
'data' => $dataset_home,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#fb2c36',
|
'borderColor' => '#00c950',
|
||||||
'backgroundColor' => '#fb2c36',
|
'backgroundColor' => '#00c950',
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
'fill' => [
|
'fill' => [
|
||||||
'target' => 1,
|
'target' => 1,
|
||||||
'above' => '#fb2c3680',
|
'above' => '#00c95080',
|
||||||
'below' => '#fdc70080',
|
'below' => '#2b7fff80',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -326,11 +329,11 @@ class LoadEvents
|
|||||||
'results_per_event' => $results_per_event,
|
'results_per_event' => $results_per_event,
|
||||||
'data' => $dataset_away,
|
'data' => $dataset_away,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#fdc700',
|
'borderColor' => '#2b7fff',
|
||||||
'backgroundColor' => '#fdc700',
|
'backgroundColor' => '#2b7fff',
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'hidden' => true,
|
'hidden' => false,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'labels' => $labels,
|
'labels' => $labels,
|
||||||
@@ -342,32 +345,32 @@ class LoadEvents
|
|||||||
'expectations_home' => $expectations['home'],
|
'expectations_home' => $expectations['home'],
|
||||||
'expectations_away' => $expectations['away'],
|
'expectations_away' => $expectations['away'],
|
||||||
];
|
];
|
||||||
if ($team_id && $statistic_type == 'gls') {
|
// if ($team_id && $statistic_type == 'gls') {
|
||||||
$data['datasets'][] = [
|
// $data['datasets'][] = [
|
||||||
'label' => 'Goals '.$label1,
|
// 'label' => 'Goals '.$label1,
|
||||||
'events' => $events,
|
// 'events' => $events,
|
||||||
'playing_date' => $playing_date,
|
// 'playing_date' => $playing_date,
|
||||||
'results_per_event' => $results_per_event,
|
// 'results_per_event' => $results_per_event,
|
||||||
'data' => $dataset_exp_home,
|
// 'data' => $dataset_exp_home,
|
||||||
'tension' => 0.5,
|
// 'tension' => 0.5,
|
||||||
'borderColor' => '#00c950',
|
// 'borderColor' => '#00c950',
|
||||||
'backgroundColor' => '#00c950',
|
// 'backgroundColor' => '#00c950',
|
||||||
'pointStyle' => $hasdots,
|
// 'pointStyle' => $hasdots,
|
||||||
'hidden' => true,
|
// 'hidden' => true,
|
||||||
];
|
// ];
|
||||||
$data['datasets'][] = [
|
// $data['datasets'][] = [
|
||||||
'label' => 'Goals '.$label2,
|
// 'label' => 'Goals '.$label2,
|
||||||
'events' => $events,
|
// 'events' => $events,
|
||||||
'playing_date' => $playing_date,
|
// 'playing_date' => $playing_date,
|
||||||
'results_per_event' => $results_per_event,
|
// 'results_per_event' => $results_per_event,
|
||||||
'data' => $dataset_exp_away,
|
// 'data' => $dataset_exp_away,
|
||||||
'tension' => 0.5,
|
// 'tension' => 0.5,
|
||||||
'borderColor' => '#2b7fff',
|
// 'borderColor' => '#2b7fff',
|
||||||
'backgroundColor' => '#2b7fff',
|
// 'backgroundColor' => '#2b7fff',
|
||||||
'pointStyle' => $hasdots,
|
// 'pointStyle' => $hasdots,
|
||||||
'hidden' => true,
|
// 'hidden' => true,
|
||||||
];
|
// ];
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (isset($dataset_home2) && isset($dataset_away2)) {
|
if (isset($dataset_home2) && isset($dataset_away2)) {
|
||||||
$data['datasets'][] = [
|
$data['datasets'][] = [
|
||||||
|
|||||||
@@ -81,6 +81,10 @@ class LoadEventsAverages
|
|||||||
$league_home[] = (int) $value['tsh_h'];
|
$league_home[] = (int) $value['tsh_h'];
|
||||||
$league_away[] = (int) $value['tsh_a'];
|
$league_away[] = (int) $value['tsh_a'];
|
||||||
break;
|
break;
|
||||||
|
case 'wfl':
|
||||||
|
$league_home[] = (int) $value['wfl_h'];
|
||||||
|
$league_away[] = (int) $value['wfl_a'];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((! $team_position || $team_position == 'all') && ($team_id == $value['home_id'] or $team_id == $value['away_id'])) {
|
if ((! $team_position || $team_position == 'all') && ($team_id == $value['home_id'] or $team_id == $value['away_id'])) {
|
||||||
@@ -148,6 +152,15 @@ class LoadEventsAverages
|
|||||||
$team_away[] = (int) $value['tsh_h'];
|
$team_away[] = (int) $value['tsh_h'];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'wfl':
|
||||||
|
if ($team_id == $value['home_id']) {
|
||||||
|
$team_home[] = (int) $value['wfl_h'];
|
||||||
|
$team_away[] = (int) $value['wfl_a'];
|
||||||
|
} else {
|
||||||
|
$team_home[] = (int) $value['wfl_a'];
|
||||||
|
$team_away[] = (int) $value['wfl_h'];
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} elseif ($team_position == 'home' && $team_id == $value['home_id']) {
|
} elseif ($team_position == 'home' && $team_id == $value['home_id']) {
|
||||||
switch ($statistic_type) {
|
switch ($statistic_type) {
|
||||||
@@ -179,6 +192,10 @@ class LoadEventsAverages
|
|||||||
$team_home[] = (int) $value['tsh_h'];
|
$team_home[] = (int) $value['tsh_h'];
|
||||||
$team_away[] = (int) $value['tsh_a'];
|
$team_away[] = (int) $value['tsh_a'];
|
||||||
break;
|
break;
|
||||||
|
case 'wfl':
|
||||||
|
$team_home[] = (int) $value['wfl_h'];
|
||||||
|
$team_away[] = (int) $value['wfl_a'];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} elseif ($team_position == 'away' && $team_id == $value['away_id']) {
|
} elseif ($team_position == 'away' && $team_id == $value['away_id']) {
|
||||||
switch ($statistic_type) {
|
switch ($statistic_type) {
|
||||||
@@ -210,6 +227,10 @@ class LoadEventsAverages
|
|||||||
$team_home[] = (int) $value['tsh_a'];
|
$team_home[] = (int) $value['tsh_a'];
|
||||||
$team_away[] = (int) $value['tsh_h'];
|
$team_away[] = (int) $value['tsh_h'];
|
||||||
break;
|
break;
|
||||||
|
case 'wfl':
|
||||||
|
$team_home[] = (int) $value['wfl_a'];
|
||||||
|
$team_away[] = (int) $value['wfl_h'];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -252,8 +273,8 @@ class LoadEventsAverages
|
|||||||
'events' => $events,
|
'events' => $events,
|
||||||
'data' => $data_team,
|
'data' => $data_team,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#ad46ff',
|
'borderColor' => '#00c950',
|
||||||
'backgroundColor' => '#ad46ff',
|
// 'backgroundColor' => '#ad46ff',
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'hidden' => false,
|
'hidden' => false,
|
||||||
@@ -265,8 +286,8 @@ class LoadEventsAverages
|
|||||||
'events' => $events,
|
'events' => $events,
|
||||||
'data' => $data_league,
|
'data' => $data_league,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#00bba7',
|
'borderColor' => '#2b7fff',
|
||||||
'backgroundColor' => '#00bba7',
|
// 'backgroundColor' => '#00bba7',
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'hidden' => false,
|
'hidden' => false,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use App\Filament\Pages\Selections\Helper\GetSeason;
|
|||||||
use App\Models\SofaScoreRosa;
|
use App\Models\SofaScoreRosa;
|
||||||
use App\Models\StatistikoEvent;
|
use App\Models\StatistikoEvent;
|
||||||
use App\Models\StatistikoPlayer;
|
use App\Models\StatistikoPlayer;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class LoadEventsQuery
|
class LoadEventsQuery
|
||||||
{
|
{
|
||||||
@@ -14,7 +15,7 @@ class LoadEventsQuery
|
|||||||
$league_id = (int) $filter['league_id'] ?? 0;
|
$league_id = (int) $filter['league_id'] ?? 0;
|
||||||
$team_id = (int) $filter['team_id'] ?? 0;
|
$team_id = (int) $filter['team_id'] ?? 0;
|
||||||
$season = $filter['season'];
|
$season = $filter['season'];
|
||||||
$seasonmode = $filter['seasonmode'];
|
$season_mode = $filter['season_mode'];
|
||||||
$season_or_date = $filter['season_or_date'];
|
$season_or_date = $filter['season_or_date'];
|
||||||
$start = $filter['start_date'] ?? 0;
|
$start = $filter['start_date'] ?? 0;
|
||||||
$end = $filter['end_date'] ?? 0;
|
$end = $filter['end_date'] ?? 0;
|
||||||
@@ -41,7 +42,7 @@ class LoadEventsQuery
|
|||||||
}
|
}
|
||||||
|
|
||||||
// dd($season);
|
// dd($season);
|
||||||
$season = GetSeason::load($season, $seasonmode);
|
$season = GetSeason::load($season, $season_mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IF WITH PLAYER
|
* IF WITH PLAYER
|
||||||
@@ -94,6 +95,8 @@ class LoadEventsQuery
|
|||||||
* STATTISTIC DATA
|
* STATTISTIC DATA
|
||||||
*/
|
*/
|
||||||
// dd($team_id, $home_id, $away_id);
|
// dd($team_id, $home_id, $away_id);
|
||||||
|
// Log::debug('res', [$team_id, $league_id, $season]);
|
||||||
|
|
||||||
$res = StatistikoEvent::where(function ($query) use ($league_id, $similar_past_matches) {
|
$res = StatistikoEvent::where(function ($query) use ($league_id, $similar_past_matches) {
|
||||||
switch ($similar_past_matches) {
|
switch ($similar_past_matches) {
|
||||||
case 'none':
|
case 'none':
|
||||||
@@ -184,6 +187,10 @@ class LoadEventsQuery
|
|||||||
$tmp['val_home'] = $value->tsh_h;
|
$tmp['val_home'] = $value->tsh_h;
|
||||||
$tmp['val_away'] = $value->tsh_a;
|
$tmp['val_away'] = $value->tsh_a;
|
||||||
break;
|
break;
|
||||||
|
case 'wfl':
|
||||||
|
$tmp['val_home'] = $value->wfl_h;
|
||||||
|
$tmp['val_away'] = $value->wfl_a;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$arr['all'][] = $tmp;
|
$arr['all'][] = $tmp;
|
||||||
|
|||||||
@@ -11,9 +11,8 @@ class LoadEventsQueryAll
|
|||||||
public static function load(array $filter, object $match)
|
public static function load(array $filter, object $match)
|
||||||
{
|
{
|
||||||
$league_id = (int) $filter['league_id'] ?? 0;
|
$league_id = (int) $filter['league_id'] ?? 0;
|
||||||
$team_id = (int) $filter['team_id'] ?? 0;
|
|
||||||
$season = $filter['season'];
|
$season = $filter['season'];
|
||||||
$seasonmode = $filter['seasonmode'];
|
$season_mode = $filter['season_mode'];
|
||||||
$season_or_date = $filter['season_or_date'];
|
$season_or_date = $filter['season_or_date'];
|
||||||
$accuracy = (float) $filter['accuracy'] ?? 0.5;
|
$accuracy = (float) $filter['accuracy'] ?? 0.5;
|
||||||
$start = $filter['start_date'] ?? 0;
|
$start = $filter['start_date'] ?? 0;
|
||||||
@@ -24,17 +23,12 @@ class LoadEventsQueryAll
|
|||||||
}
|
}
|
||||||
$ss_player_id = (int) $filter['ss_player_id'] ?? 0;
|
$ss_player_id = (int) $filter['ss_player_id'] ?? 0;
|
||||||
$player_on_field = $filter['player_on_field'] ?? 'all';
|
$player_on_field = $filter['player_on_field'] ?? 'all';
|
||||||
$similar_past_matches = $filter['similar_past_matches'];
|
$spm = $filter['similar_past_matches'];
|
||||||
$team_position = $filter['team_position'];
|
|
||||||
$home_id = $match->home_id;
|
|
||||||
$away_id = $match->away_id;
|
|
||||||
|
|
||||||
$handicap_range = [];
|
$handicap_range = [];
|
||||||
$total_range = [];
|
$total_range = [];
|
||||||
if ($similar_past_matches != 'none') {
|
if ($spm == 'league' or $spm == 'all') {
|
||||||
$team_id = 0;
|
|
||||||
$ss_player_id = 0;
|
$ss_player_id = 0;
|
||||||
$team_position = '';
|
|
||||||
$exp_handicap = $match->exp_away - $match->exp_home;
|
$exp_handicap = $match->exp_away - $match->exp_home;
|
||||||
$exp_total = $match->exp_away + $match->exp_home;
|
$exp_total = $match->exp_away + $match->exp_home;
|
||||||
$handicap_range = [$exp_handicap - $accuracy, $exp_handicap + $accuracy];
|
$handicap_range = [$exp_handicap - $accuracy, $exp_handicap + $accuracy];
|
||||||
@@ -42,7 +36,7 @@ class LoadEventsQueryAll
|
|||||||
}
|
}
|
||||||
|
|
||||||
// dd($season);
|
// dd($season);
|
||||||
$season = GetSeason::load($season, $seasonmode);
|
$season = GetSeason::load($season, $season_mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IF WITH PLAYER
|
* IF WITH PLAYER
|
||||||
@@ -51,16 +45,11 @@ class LoadEventsQueryAll
|
|||||||
|
|
||||||
if ($ss_player_id) {
|
if ($ss_player_id) {
|
||||||
$matches_season = StatistikoEvent::whereIn('season', $season)
|
$matches_season = StatistikoEvent::whereIn('season', $season)
|
||||||
->where(function ($query) use ($team_id, $team_position) {
|
->where(function ($query) use ($match) {
|
||||||
switch ($team_position) {
|
return $query->where('home_id', '=', $match->home_id)
|
||||||
case 'home':
|
->orWhere('home_id', '=', $match->away_id)
|
||||||
return $query->where('home_id', '=', $team_id);
|
->orWhere('away_id', '=', $match->home_id)
|
||||||
case 'away':
|
->orWhere('away_id', '=', $match->away_id);
|
||||||
return $query->where('away_id', '=', $team_id);
|
|
||||||
default:
|
|
||||||
return $query->where('home_id', '=', $team_id)
|
|
||||||
->orWhere('away_id', '=', $team_id);
|
|
||||||
}
|
|
||||||
})->pluck('match_id')->toArray();
|
})->pluck('match_id')->toArray();
|
||||||
|
|
||||||
$matches_played = StatistikoPlayer::query()
|
$matches_played = StatistikoPlayer::query()
|
||||||
@@ -89,28 +78,26 @@ class LoadEventsQueryAll
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// dd($handicap_range, $total_range);
|
|
||||||
/**
|
/**
|
||||||
* STATTISTIC DATA
|
* STATTISTIC DATA
|
||||||
*/
|
*/
|
||||||
// Log::debug('result', [$similar_past_matches, $home_id, $away_id, $team_id]);
|
// Log::debug('result', [$spm, $team_id]);
|
||||||
|
|
||||||
return StatistikoEvent::with('home')->with('away')
|
return StatistikoEvent::with('home')->with('away')
|
||||||
->where(function ($query) use ($league_id, $similar_past_matches) {
|
->where(function ($query) use ($league_id, $spm) {
|
||||||
switch ($similar_past_matches) {
|
switch ($spm) {
|
||||||
case 'none':
|
case 'none':
|
||||||
case 'league':
|
case 'league':
|
||||||
return $query->where('league_id', $league_id);
|
return $query->where('league_id', $league_id);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->where(function ($query) use ($team_id, $home_id, $away_id, $similar_past_matches) {
|
->where(function ($query) use ($match, $spm) {
|
||||||
if ($similar_past_matches == 'none') {
|
if ($spm == 'none') {
|
||||||
if ($team_id) {
|
return $query
|
||||||
return $query->orWhere('home_id', $team_id)
|
->where('home_id', $match->home_id)
|
||||||
->orWhere('away_id', '=', $team_id);
|
->orWhere('home_id', '=', $match->away_id)
|
||||||
} else {
|
->orWhere('away_id', '=', $match->home_id)
|
||||||
return $query->whereIn('home_id', [$home_id, $away_id])->orWhereIn('away_id', [$home_id, $away_id]);
|
->orWhere('away_id', '=', $match->away_id);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->when($matches_played, function ($query) use ($matches_played, $player_on_field) {
|
->when($matches_played, function ($query) use ($matches_played, $player_on_field) {
|
||||||
@@ -130,8 +117,8 @@ class LoadEventsQueryAll
|
|||||||
})->when($end, function ($query) use ($end) {
|
})->when($end, function ($query) use ($end) {
|
||||||
return $query->whereDate('starttime', '<=', $end);
|
return $query->whereDate('starttime', '<=', $end);
|
||||||
})
|
})
|
||||||
->when($season, function ($query) use ($season, $season_or_date, $similar_past_matches) {
|
->when($season, function ($query) use ($season, $season_or_date, $spm) {
|
||||||
if ($similar_past_matches == 'none' && $season_or_date == 'season') {
|
if ($spm == 'none' && $season_or_date == 'season') {
|
||||||
return $query->whereIn('season', $season);
|
return $query->whereIn('season', $season);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
+20
-12
@@ -5,15 +5,16 @@ namespace App\Filament\Widgets\Charts\LoadEvents;
|
|||||||
use App\Filament\Pages\Selections\Helper\GetSeason;
|
use App\Filament\Pages\Selections\Helper\GetSeason;
|
||||||
use App\Models\StatistikoEvent;
|
use App\Models\StatistikoEvent;
|
||||||
use App\Models\StatistikoPlayer;
|
use App\Models\StatistikoPlayer;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class LoadEventsQuerySPM
|
class LoadEventsQueryTP
|
||||||
{
|
{
|
||||||
public static function load(array $filter, object $match)
|
public static function load(array $filter, object $match)
|
||||||
{
|
{
|
||||||
$league_id = (int) $filter['league_id'] ?? 0;
|
$league_id = (int) $filter['league_id'] ?? 0;
|
||||||
$team_id = (int) $filter['team_id'] ?? 0;
|
$team_id = (int) $filter['team_id'] ?? 0;
|
||||||
$season = $filter['season'];
|
$season = $filter['season'];
|
||||||
$seasonmode = $filter['seasonmode'];
|
$season_mode = $filter['season_mode'];
|
||||||
$season_or_date = $filter['season_or_date'];
|
$season_or_date = $filter['season_or_date'];
|
||||||
$accuracy = (float) $filter['accuracy'] ?? 0.5;
|
$accuracy = (float) $filter['accuracy'] ?? 0.5;
|
||||||
$start = $filter['start_date'] ?? 0;
|
$start = $filter['start_date'] ?? 0;
|
||||||
@@ -26,8 +27,6 @@ class LoadEventsQuerySPM
|
|||||||
$player_on_field = $filter['player_on_field'] ?? 'all';
|
$player_on_field = $filter['player_on_field'] ?? 'all';
|
||||||
$similar_past_matches = $filter['similar_past_matches'];
|
$similar_past_matches = $filter['similar_past_matches'];
|
||||||
$team_position = $filter['team_position'];
|
$team_position = $filter['team_position'];
|
||||||
$home_id = $match->home_id;
|
|
||||||
$away_id = $match->away_id;
|
|
||||||
|
|
||||||
$handicap_range = [];
|
$handicap_range = [];
|
||||||
$total_range = [];
|
$total_range = [];
|
||||||
@@ -42,7 +41,7 @@ class LoadEventsQuerySPM
|
|||||||
}
|
}
|
||||||
|
|
||||||
// dd($season);
|
// dd($season);
|
||||||
$season = GetSeason::load($season, $seasonmode);
|
$season = GetSeason::load($season, $season_mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IF WITH PLAYER
|
* IF WITH PLAYER
|
||||||
@@ -63,6 +62,12 @@ class LoadEventsQuerySPM
|
|||||||
}
|
}
|
||||||
})->pluck('match_id')->toArray();
|
})->pluck('match_id')->toArray();
|
||||||
|
|
||||||
|
$matches_season = StatistikoEvent::whereIn('season', $season)
|
||||||
|
->where(function ($query) use ($team_id) {
|
||||||
|
return $query->where('home_id', '=', $team_id)
|
||||||
|
->orWhere('away_id', '=', $team_id);
|
||||||
|
})->pluck('match_id')->toArray();
|
||||||
|
|
||||||
$matches_played = StatistikoPlayer::query()
|
$matches_played = StatistikoPlayer::query()
|
||||||
->whereIn('match_id', $matches_season)
|
->whereIn('match_id', $matches_season)
|
||||||
->where('ss_player_id', $ss_player_id)
|
->where('ss_player_id', $ss_player_id)
|
||||||
@@ -93,7 +98,7 @@ class LoadEventsQuerySPM
|
|||||||
/**
|
/**
|
||||||
* STATTISTIC DATA
|
* STATTISTIC DATA
|
||||||
*/
|
*/
|
||||||
// Log::debug('result', [$similar_past_matches, $home_id, $away_id, $team_id]);
|
Log::debug('result', [$similar_past_matches, $league_id, $team_id]);
|
||||||
|
|
||||||
return StatistikoEvent::with('home')->with('away')
|
return StatistikoEvent::with('home')->with('away')
|
||||||
->where(function ($query) use ($league_id, $similar_past_matches) {
|
->where(function ($query) use ($league_id, $similar_past_matches) {
|
||||||
@@ -103,13 +108,16 @@ class LoadEventsQuerySPM
|
|||||||
return $query->where('league_id', $league_id);
|
return $query->where('league_id', $league_id);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->where(function ($query) use ($team_id, $home_id, $away_id, $similar_past_matches) {
|
->where(function ($query) use ($team_id, $similar_past_matches, $team_position) {
|
||||||
if ($similar_past_matches == 'none') {
|
if ($team_id && $similar_past_matches == 'none') {
|
||||||
if ($team_id) {
|
switch ($team_position) {
|
||||||
return $query->orWhere('home_id', $team_id)
|
case 'home':
|
||||||
|
return $query->where('home_id', '=', $team_id);
|
||||||
|
case 'away':
|
||||||
|
return $query->where('away_id', '=', $team_id);
|
||||||
|
default:
|
||||||
|
return $query->where('home_id', '=', $team_id)
|
||||||
->orWhere('away_id', '=', $team_id);
|
->orWhere('away_id', '=', $team_id);
|
||||||
} else {
|
|
||||||
return $query->whereIn('home_id', [$home_id, $away_id])->orWhereIn('away_id', [$home_id, $away_id]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Filament\Widgets\Charts;
|
namespace App\Filament\Widgets\Charts;
|
||||||
|
|
||||||
|
use App\Filament\Pages\Selections\Helper\GetSeason;
|
||||||
use App\Models\SofaScoreRosa;
|
use App\Models\SofaScoreRosa;
|
||||||
use App\Models\StatisticFixtures;
|
use App\Models\StatisticFixtures;
|
||||||
use App\Models\StatistikoEvent;
|
use App\Models\StatistikoEvent;
|
||||||
@@ -21,14 +22,34 @@ class LoadPerformance
|
|||||||
|
|
||||||
$match_id = (int) $filter['match_id'] ?? 0;
|
$match_id = (int) $filter['match_id'] ?? 0;
|
||||||
|
|
||||||
|
$team_id = (int) $filter['team_id'] ?? 0;
|
||||||
|
|
||||||
$team_position = $filter['team_position'];
|
$team_position = $filter['team_position'];
|
||||||
|
|
||||||
|
$similar_past_matches = $filter['similar_past_matches'];
|
||||||
|
|
||||||
|
$accuracy = (float) $filter['accuracy'] ?? 0.5;
|
||||||
|
|
||||||
if (! $league_id) {
|
if (! $league_id) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
if (! $match_id) {
|
if (! $match_id) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
if (! $team_id && $similar_past_matches == 'none') {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$start = $filter['start_date'] ?? 0;
|
||||||
|
$end = $filter['end_date'] ?? 0;
|
||||||
|
$season_or_date = $filter['season_or_date'];
|
||||||
|
$season = $filter['season'];
|
||||||
|
$season_mode = $filter['season_mode'];
|
||||||
|
if ($season_or_date == 'season') {
|
||||||
|
$start = 0;
|
||||||
|
$end = 0;
|
||||||
|
}
|
||||||
|
$season = GetSeason::load($season, $season_mode);
|
||||||
|
|
||||||
$team_map = SofaScoreRosa::pluck('ss_team_name', 'ss_team_id')->toArray();
|
$team_map = SofaScoreRosa::pluck('ss_team_name', 'ss_team_id')->toArray();
|
||||||
|
|
||||||
@@ -39,7 +60,56 @@ class LoadPerformance
|
|||||||
$home_id = $match->home_id ?? 0;
|
$home_id = $match->home_id ?? 0;
|
||||||
$away_id = $match->away_id ?? 0;
|
$away_id = $match->away_id ?? 0;
|
||||||
|
|
||||||
$res = StatistikoEvent::where('league_id', $league_id)->get();
|
$handicap_range = [];
|
||||||
|
$total_range = [];
|
||||||
|
|
||||||
|
if ($similar_past_matches != 'none') {
|
||||||
|
|
||||||
|
$team_position = '';
|
||||||
|
|
||||||
|
$exp_handicap = $match->exp_away - $match->exp_home;
|
||||||
|
|
||||||
|
$exp_total = $match->exp_away + $match->exp_home;
|
||||||
|
|
||||||
|
$handicap_range = [$exp_handicap - $accuracy, $exp_handicap + $accuracy];
|
||||||
|
|
||||||
|
$total_range = [$exp_total - $accuracy, $exp_total + $accuracy];
|
||||||
|
}
|
||||||
|
|
||||||
|
// $res = LoadEventsQuery::load($filter, $handicap_range, $total_range, $match, 1);
|
||||||
|
|
||||||
|
// $res = StatistikoEvent::where('league_id', $league_id)->get();
|
||||||
|
|
||||||
|
$res = StatistikoEvent::where(function ($query) use ($league_id, $similar_past_matches) {
|
||||||
|
switch ($similar_past_matches) {
|
||||||
|
case 'none':
|
||||||
|
case 'league':
|
||||||
|
return $query->where('league_id', $league_id);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->where(function ($query) use ($home_id, $away_id, $similar_past_matches) {
|
||||||
|
if ($similar_past_matches == 'none') {
|
||||||
|
return $query->where('home_id', $home_id)->orWhere('away_id', $home_id)->orWhere('home_id', $away_id)->orWhere('away_id', $away_id);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
->when($handicap_range, function ($query) use ($handicap_range) {
|
||||||
|
return $query->whereBetween('exp_handicap', $handicap_range);
|
||||||
|
})->when($total_range, function ($query) use ($total_range) {
|
||||||
|
return $query->whereBetween('exp_total', $total_range);
|
||||||
|
})
|
||||||
|
->when($start, function ($query) use ($start) {
|
||||||
|
return $query->whereDate('starttime', '>=', $start);
|
||||||
|
})->when($end, function ($query) use ($end) {
|
||||||
|
return $query->whereDate('starttime', '<=', $end);
|
||||||
|
})
|
||||||
|
->when($season, function ($query) use ($season, $season_or_date, $similar_past_matches) {
|
||||||
|
if ($similar_past_matches == 'none' && $season_or_date == 'season') {
|
||||||
|
return $query->whereIn('season', $season);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->orderBy('starttime', 'ASC')
|
||||||
|
->get();
|
||||||
|
|
||||||
$home_matches = [];
|
$home_matches = [];
|
||||||
$away_matches = [];
|
$away_matches = [];
|
||||||
@@ -66,7 +136,7 @@ class LoadPerformance
|
|||||||
$labels[] = round($val->starttime->diffInDays(Carbon::now()));
|
$labels[] = round($val->starttime->diffInDays(Carbon::now()));
|
||||||
$date_away[] = $val['starttime']->format('Y-m-d H:i');
|
$date_away[] = $val['starttime']->format('Y-m-d H:i');
|
||||||
$results_away[] = $val['gls_h'].' : '.$val['gls_a'];
|
$results_away[] = $val['gls_h'].' : '.$val['gls_a'];
|
||||||
$events_home[] = $team_map[$val->home_id].' vs '.$team_map[$val->away_id];
|
$events_away[] = $team_map[$val->home_id].' vs '.$team_map[$val->away_id];
|
||||||
$away_matches[] = $val->match_id;
|
$away_matches[] = $val->match_id;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -82,7 +152,7 @@ class LoadPerformance
|
|||||||
$labels[] = round($val->starttime->diffInDays(Carbon::now()));
|
$labels[] = round($val->starttime->diffInDays(Carbon::now()));
|
||||||
$date_away[] = $val['starttime']->format('Y-m-d H:i');
|
$date_away[] = $val['starttime']->format('Y-m-d H:i');
|
||||||
$results_away[] = $val['gls_h'].' : '.$val['gls_a'];
|
$results_away[] = $val['gls_h'].' : '.$val['gls_a'];
|
||||||
$events_home[] = $team_map[$val->home_id].' vs '.$team_map[$val->away_id];
|
$events_away[] = $team_map[$val->home_id].' vs '.$team_map[$val->away_id];
|
||||||
$away_matches[] = $val->match_id;
|
$away_matches[] = $val->match_id;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -98,7 +168,7 @@ class LoadPerformance
|
|||||||
$labels[] = round($val->starttime->diffInDays(Carbon::now()));
|
$labels[] = round($val->starttime->diffInDays(Carbon::now()));
|
||||||
$date_away[] = $val['starttime']->format('Y-m-d H:i');
|
$date_away[] = $val['starttime']->format('Y-m-d H:i');
|
||||||
$results_away[] = $val['gls_h'].' : '.$val['gls_a'];
|
$results_away[] = $val['gls_h'].' : '.$val['gls_a'];
|
||||||
$events_home[] = $team_map[$val->home_id].' vs '.$team_map[$val->away_id];
|
$events_away[] = $team_map[$val->home_id].' vs '.$team_map[$val->away_id];
|
||||||
$away_matches[] = $val->match_id;
|
$away_matches[] = $val->match_id;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -131,6 +201,9 @@ class LoadPerformance
|
|||||||
$data = [
|
$data = [
|
||||||
'datasets' => [
|
'datasets' => [
|
||||||
[
|
[
|
||||||
|
/**
|
||||||
|
* HOME
|
||||||
|
*/
|
||||||
'label' => $team_map[$match->home_id],
|
'label' => $team_map[$match->home_id],
|
||||||
'playing_date' => $date_home,
|
'playing_date' => $date_home,
|
||||||
'results_per_event' => $results_home,
|
'results_per_event' => $results_home,
|
||||||
@@ -138,8 +211,8 @@ class LoadPerformance
|
|||||||
'data' => $homes['all'] ?? [],
|
'data' => $homes['all'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#fb2c36',
|
'borderColor' => '#2b7fff',
|
||||||
'backgroundColor' => '#fb2c36',
|
'backgroundColor' => '#2b7fff',
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -150,8 +223,7 @@ class LoadPerformance
|
|||||||
'data' => $home_av['all'],
|
'data' => $home_av['all'],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#fb2c36',
|
'borderColor' => '#2b7fff',
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
],
|
],
|
||||||
@@ -163,8 +235,8 @@ class LoadPerformance
|
|||||||
'data' => $homes['def'] ?? [],
|
'data' => $homes['def'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#fe9a00',
|
'borderColor' => '#8ec5ff',
|
||||||
'backgroundColor' => '#fe9a00',
|
'backgroundColor' => '#8ec5ff',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -177,7 +249,7 @@ class LoadPerformance
|
|||||||
'data' => $home_av['def'],
|
'data' => $home_av['def'],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#fe9a00',
|
'borderColor' => '#8ec5ff',
|
||||||
'backgroundColor' => 'transparent',
|
'backgroundColor' => 'transparent',
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -191,8 +263,8 @@ class LoadPerformance
|
|||||||
'data' => $homes['att'] ?? [],
|
'data' => $homes['att'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#fe9a00',
|
'borderColor' => '#8ec5ff',
|
||||||
'backgroundColor' => '#fe9a00',
|
'backgroundColor' => '#8ec5ff',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -205,7 +277,7 @@ class LoadPerformance
|
|||||||
'data' => $home_av['att'] ?? [],
|
'data' => $home_av['att'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#fe9a00',
|
'borderColor' => '#8ec5ff',
|
||||||
'backgroundColor' => 'transparent',
|
'backgroundColor' => 'transparent',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
@@ -220,8 +292,8 @@ class LoadPerformance
|
|||||||
'data' => $homes['mid'] ?? [],
|
'data' => $homes['mid'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#fe9a00',
|
'borderColor' => '#8ec5ff',
|
||||||
'backgroundColor' => '#fe9a00',
|
'backgroundColor' => '#8ec5ff',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -234,13 +306,16 @@ class LoadPerformance
|
|||||||
'data' => $home_av['mid'] ?? [],
|
'data' => $home_av['mid'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#fe9a00',
|
'borderColor' => '#8ec5ff',
|
||||||
'backgroundColor' => 'transparent',
|
'backgroundColor' => 'transparent',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
],
|
],
|
||||||
|
/**
|
||||||
|
* AWAY
|
||||||
|
*/
|
||||||
[
|
[
|
||||||
'label' => $team_map[$match->away_id],
|
'label' => $team_map[$match->away_id],
|
||||||
'playing_date' => $date_away,
|
'playing_date' => $date_away,
|
||||||
@@ -249,8 +324,8 @@ class LoadPerformance
|
|||||||
'data' => $aways['all'] ?? [],
|
'data' => $aways['all'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#00bc7d',
|
'borderColor' => '#00c950',
|
||||||
'backgroundColor' => '#00bc7d',
|
'backgroundColor' => '#00c950',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
'hidden' => false,
|
'hidden' => false,
|
||||||
@@ -263,8 +338,7 @@ class LoadPerformance
|
|||||||
'data' => $away_av['all'] ?? [],
|
'data' => $away_av['all'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#00bc7d',
|
'borderColor' => '#00c950',
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
@@ -278,8 +352,8 @@ class LoadPerformance
|
|||||||
'data' => $aways['def'] ?? [],
|
'data' => $aways['def'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#7ccf00',
|
'borderColor' => '#7bf1a8',
|
||||||
'backgroundColor' => '#7ccf00',
|
'backgroundColor' => '#7bf1a8',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -292,8 +366,7 @@ class LoadPerformance
|
|||||||
'data' => $away_av['def'] ?? [],
|
'data' => $away_av['def'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#7ccf00',
|
'borderColor' => '#7bf1a8',
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
@@ -307,8 +380,8 @@ class LoadPerformance
|
|||||||
'data' => $aways['att'] ?? [],
|
'data' => $aways['att'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#7ccf00',
|
'borderColor' => '#7bf1a8',
|
||||||
'backgroundColor' => '#7ccf00',
|
'backgroundColor' => '#7bf1a8',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -321,8 +394,7 @@ class LoadPerformance
|
|||||||
'data' => $away_av['att'] ?? [],
|
'data' => $away_av['att'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#7ccf00',
|
'borderColor' => '#7bf1a8',
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
@@ -336,27 +408,15 @@ class LoadPerformance
|
|||||||
'data' => $aways['mid'] ?? [],
|
'data' => $aways['mid'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#7ccf00',
|
'borderColor' => '#7bf1a8',
|
||||||
'backgroundColor' => '#7ccf00',
|
'backgroundColor' => '#7bf1a8',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
],
|
],
|
||||||
[
|
/**
|
||||||
'label' => 'Average Midfield',
|
* AVERAGE
|
||||||
'playing_date' => $date_away,
|
*/
|
||||||
'results_per_event' => $results_away,
|
|
||||||
'events' => $events_away,
|
|
||||||
'data' => $away_av['mid'] ?? [],
|
|
||||||
'spanGaps' => true,
|
|
||||||
'tension' => 0.5,
|
|
||||||
'borderColor' => '#7ccf00',
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'fill' => false,
|
|
||||||
'pointStyle' => false,
|
|
||||||
'borderDash' => [5, 5],
|
|
||||||
'hidden' => true,
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
'label' => 'Average League',
|
'label' => 'Average League',
|
||||||
'playing_date' => $date_home,
|
'playing_date' => $date_home,
|
||||||
@@ -365,8 +425,7 @@ class LoadPerformance
|
|||||||
'data' => $league_av['all'],
|
'data' => $league_av['all'],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#00a6f4',
|
'borderColor' => '#ffb900',
|
||||||
'backgroundColor' => '#00a6f4',
|
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -379,8 +438,7 @@ class LoadPerformance
|
|||||||
'data' => $league_av['def'],
|
'data' => $league_av['def'],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#155dfc',
|
'borderColor' => '#ffb900',
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -393,8 +451,7 @@ class LoadPerformance
|
|||||||
'data' => $league_av['att'],
|
'data' => $league_av['att'],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#155dfc',
|
'borderColor' => '#ffb900',
|
||||||
'backgroundColor' => '#155dfc',
|
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -407,8 +464,7 @@ class LoadPerformance
|
|||||||
'data' => $league_av['mid'],
|
'data' => $league_av['mid'],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#155dfc',
|
'borderColor' => '#ffb900',
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -474,11 +530,12 @@ class LoadPerformance
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// dd($result);
|
|
||||||
|
|
||||||
$return = [];
|
$return = [];
|
||||||
foreach ($matches as $matchid) {
|
foreach ($matches as $matchid) {
|
||||||
if (isset($result[$matchid])) {
|
if (isset($result[$matchid])) {
|
||||||
|
if (! $result[$matchid]['all']['ply']) {
|
||||||
|
$result[$matchid]['all']['ply'] = 1;
|
||||||
|
}
|
||||||
$return['all'][] = round($result[$matchid]['all']['rating'] / $result[$matchid]['all']['ply'], 1);
|
$return['all'][] = round($result[$matchid]['all']['rating'] / $result[$matchid]['all']['ply'], 1);
|
||||||
if ($result[$matchid]['def']['sum_min']) {
|
if ($result[$matchid]['def']['sum_min']) {
|
||||||
$return['def'][] = round($result[$matchid]['def']['rating'] / $result[$matchid]['def']['ply'], 1);
|
$return['def'][] = round($result[$matchid]['def']['rating'] / $result[$matchid]['def']['ply'], 1);
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ class LoadPlayerWidgets
|
|||||||
$player_on_field = $filter['player_on_field'] ?? 'all';
|
$player_on_field = $filter['player_on_field'] ?? 'all';
|
||||||
|
|
||||||
$season = $filter['season'];
|
$season = $filter['season'];
|
||||||
$seasonmode = $filter['seasonmode'];
|
$season_mode = $filter['season_mode'];
|
||||||
$season = GetSeason::load($season, $seasonmode);
|
$season = GetSeason::load($season, $season_mode);
|
||||||
|
|
||||||
// dd($player_on_field);
|
// dd($player_on_field);
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class BoxNames
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
2 => 'DL',
|
2 => 'DL',
|
||||||
4 => 'MR',
|
4 => 'ML',
|
||||||
6 => 'LW',
|
6 => 'LW',
|
||||||
9 => 'DC',
|
9 => 'DC',
|
||||||
10 => 'DM',
|
10 => 'DM',
|
||||||
@@ -26,7 +26,7 @@ class BoxNames
|
|||||||
25 => 'MC',
|
25 => 'MC',
|
||||||
26 => 'AM',
|
26 => 'AM',
|
||||||
30 => 'DR',
|
30 => 'DR',
|
||||||
32 => 'ML',
|
32 => 'MR',
|
||||||
34 => 'RW',
|
34 => 'RW',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class Expectations
|
|||||||
})->get();
|
})->get();
|
||||||
|
|
||||||
$work = [];
|
$work = [];
|
||||||
$bettypes = ['gls', 'fls', 'crn', 'ofs', 'crd', 'snt', 'tsh'];
|
$bettypes = ['gls', 'fls', 'crn', 'ofs', 'crd', 'snt', 'tsh', 'wfl'];
|
||||||
foreach ($data as $value) {
|
foreach ($data as $value) {
|
||||||
foreach ($bettypes as $type) {
|
foreach ($bettypes as $type) {
|
||||||
if ($value['home_id'] == $home_id) {
|
if ($value['home_id'] == $home_id) {
|
||||||
@@ -69,8 +69,10 @@ class Expectations
|
|||||||
$num_away_snt = 0;
|
$num_away_snt = 0;
|
||||||
$num_home_tsh = 0;
|
$num_home_tsh = 0;
|
||||||
$num_away_tsh = 0;
|
$num_away_tsh = 0;
|
||||||
|
$num_home_wfl = 0;
|
||||||
|
$num_away_wfl = 0;
|
||||||
|
|
||||||
$bettypes = ['gls', 'crd', 'fls', 'ofs', 'snt', 'tsh'];
|
$bettypes = ['gls', 'crd', 'fls', 'ofs', 'snt', 'tsh', 'wfl'];
|
||||||
|
|
||||||
foreach ($work as $type => $value) {
|
foreach ($work as $type => $value) {
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
@@ -224,6 +226,31 @@ class Expectations
|
|||||||
$sum_away_tsh += array_sum($value['away_got_away']);
|
$sum_away_tsh += array_sum($value['away_got_away']);
|
||||||
$num_away_tsh += \count($value['away_got_away']);
|
$num_away_tsh += \count($value['away_got_away']);
|
||||||
break;
|
break;
|
||||||
|
case 'wfl':
|
||||||
|
$sum_home_wfl = array_sum($value['home_made_total']);
|
||||||
|
$num_home_wfl = \count($value['home_made_total']);
|
||||||
|
|
||||||
|
$sum_home_wfl += array_sum($value['home_made_home']);
|
||||||
|
$num_home_wfl += \count($value['home_made_home']);
|
||||||
|
|
||||||
|
$sum_home_wfl += array_sum($value['home_got_total']);
|
||||||
|
$num_home_wfl += \count($value['home_got_total']);
|
||||||
|
|
||||||
|
$sum_home_wfl += array_sum($value['home_got_home']);
|
||||||
|
$num_home_wfl += \count($value['home_got_home']);
|
||||||
|
|
||||||
|
$sum_away_wfl = array_sum($value['away_made_total']);
|
||||||
|
$num_away_wfl = \count($value['away_made_total']);
|
||||||
|
|
||||||
|
$sum_away_wfl += array_sum($value['away_made_away']);
|
||||||
|
$num_away_wfl += \count($value['away_made_away']);
|
||||||
|
|
||||||
|
$sum_away_wfl += array_sum($value['away_got_total']);
|
||||||
|
$num_away_wfl += \count($value['away_got_total']);
|
||||||
|
|
||||||
|
$sum_away_wfl += array_sum($value['away_got_away']);
|
||||||
|
$num_away_wfl += \count($value['away_got_away']);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,6 +261,7 @@ class Expectations
|
|||||||
$aspettativa['home']['ofs'] = round($sum_home_ofs / $num_home_ofs, 1);
|
$aspettativa['home']['ofs'] = round($sum_home_ofs / $num_home_ofs, 1);
|
||||||
$aspettativa['home']['snt'] = round($sum_home_snt / $num_home_snt, 1);
|
$aspettativa['home']['snt'] = round($sum_home_snt / $num_home_snt, 1);
|
||||||
$aspettativa['home']['tsh'] = round($sum_home_tsh / $num_home_tsh, 1);
|
$aspettativa['home']['tsh'] = round($sum_home_tsh / $num_home_tsh, 1);
|
||||||
|
$aspettativa['home']['wfl'] = round($sum_home_wfl / $num_home_wfl, 1);
|
||||||
|
|
||||||
$aspettativa['away']['gls'] = round($sum_away_gls / $sum_away_gls, 1);
|
$aspettativa['away']['gls'] = round($sum_away_gls / $sum_away_gls, 1);
|
||||||
$aspettativa['away']['crd'] = round($sum_away_crd / $num_away_crd, 1);
|
$aspettativa['away']['crd'] = round($sum_away_crd / $num_away_crd, 1);
|
||||||
@@ -241,6 +269,7 @@ class Expectations
|
|||||||
$aspettativa['away']['ofs'] = round($sum_away_ofs / $num_away_ofs, 1);
|
$aspettativa['away']['ofs'] = round($sum_away_ofs / $num_away_ofs, 1);
|
||||||
$aspettativa['away']['snt'] = round($sum_away_snt / $num_away_snt, 1);
|
$aspettativa['away']['snt'] = round($sum_away_snt / $num_away_snt, 1);
|
||||||
$aspettativa['away']['tsh'] = round($sum_away_tsh / $num_away_tsh, 1);
|
$aspettativa['away']['tsh'] = round($sum_away_tsh / $num_away_tsh, 1);
|
||||||
|
$aspettativa['away']['wfl'] = round($sum_away_wfl / $num_away_wfl, 1);
|
||||||
|
|
||||||
return $aspettativa;
|
return $aspettativa;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,4 +58,65 @@ class LineUpMap
|
|||||||
'541+' => [2, 9, 16, 23, 30, 4, 11, 25, 32, 21],
|
'541+' => [2, 9, 16, 23, 30, 4, 11, 25, 32, 21],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function get(string $key)
|
||||||
|
{
|
||||||
|
$lup = [
|
||||||
|
'3313' => [9, 16, 23, 11, 18, 25, 19, 6, 34, 21],
|
||||||
|
'3331' => [9, 16, 23, 17, 11, 25, 12, 19, 26, 21],
|
||||||
|
'3331-' => [9, 16, 23, 10, 18, 24, 12, 19, 26, 21],
|
||||||
|
'3331+' => [9, 16, 23, 11, 18, 25, 12, 19, 26, 21],
|
||||||
|
'3412-' => [9, 16, 23, 4, 10, 24, 32, 19, 20, 21],
|
||||||
|
'3412+' => [9, 16, 23, 4, 11, 25, 32, 19, 20, 21],
|
||||||
|
'3421-' => [9, 16, 23, 4, 10, 24, 32, 12, 26, 21],
|
||||||
|
'3421+' => [9, 16, 23, 4, 11, 25, 32, 12, 26, 21],
|
||||||
|
'343-' => [9, 16, 23, 4, 10, 24, 32, 6, 34, 21],
|
||||||
|
'343+' => [9, 16, 23, 4, 11, 25, 32, 6, 34, 21],
|
||||||
|
'3511' => [9, 16, 23, 4, 11, 17, 25, 32, 19, 21],
|
||||||
|
'3511-' => [9, 16, 23, 4, 10, 18, 24, 32, 19, 21],
|
||||||
|
'3511+' => [9, 16, 23, 4, 11, 18, 25, 32, 19, 21],
|
||||||
|
'352' => [9, 16, 23, 4, 11, 17, 25, 32, 20, 21],
|
||||||
|
'352-' => [9, 16, 23, 4, 10, 18, 24, 32, 20, 21],
|
||||||
|
'352+' => [9, 16, 23, 4, 11, 18, 25, 32, 20, 21],
|
||||||
|
'4132' => [2, 9, 23, 30, 17, 12, 19, 26, 20, 21],
|
||||||
|
'4213-' => [2, 9, 23, 30, 10, 24, 19, 6, 34, 21],
|
||||||
|
'4213+' => [2, 9, 23, 30, 11, 25, 19, 6, 34, 21],
|
||||||
|
'4222' => [2, 9, 23, 30, 10, 24, 12, 26, 20, 21],
|
||||||
|
'4231' => [2, 9, 23, 30, 10, 24, 12, 19, 26, 21],
|
||||||
|
'424' => [2, 9, 23, 30, 10, 24, 6, 34, 20, 21],
|
||||||
|
'4312' => [2, 9, 23, 30, 17, 11, 25, 19, 20, 21],
|
||||||
|
'4312-' => [2, 9, 23, 30, 10, 18, 24, 19, 20, 21],
|
||||||
|
'4312+' => [2, 9, 23, 30, 11, 18, 25, 19, 20, 21],
|
||||||
|
'4321' => [2, 9, 23, 30, 17, 11, 25, 12, 26, 21],
|
||||||
|
'4321-' => [2, 9, 23, 30, 10, 18, 24, 12, 26, 21],
|
||||||
|
'4321+' => [2, 9, 23, 30, 11, 18, 25, 12, 26, 21],
|
||||||
|
'433' => [2, 9, 23, 30, 17, 11, 25, 6, 34, 21],
|
||||||
|
'433-' => [2, 9, 23, 30, 10, 18, 24, 6, 34, 21],
|
||||||
|
'433+' => [2, 9, 23, 30, 11, 18, 25, 6, 34, 21],
|
||||||
|
'4411-' => [2, 9, 23, 30, 4, 10, 24, 32, 19, 21],
|
||||||
|
'4411+' => [2, 9, 23, 30, 4, 11, 25, 32, 19, 21],
|
||||||
|
'442' => [2, 9, 23, 30, 4, 17, 18, 32, 20, 21],
|
||||||
|
'442-' => [2, 9, 23, 30, 4, 10, 24, 32, 20, 21],
|
||||||
|
'442+' => [2, 9, 23, 30, 4, 11, 25, 32, 20, 21],
|
||||||
|
'451' => [2, 9, 23, 30, 4, 17, 11, 25, 32, 21],
|
||||||
|
'451-' => [2, 9, 23, 30, 4, 10, 18, 24, 32, 21],
|
||||||
|
'451+' => [2, 9, 23, 30, 4, 11, 18, 25, 32, 21],
|
||||||
|
'523-' => [2, 9, 16, 23, 30, 10, 24, 6, 34, 21],
|
||||||
|
'523+' => [2, 9, 16, 23, 30, 11, 25, 6, 34, 21],
|
||||||
|
'5311' => [2, 9, 16, 23, 30, 17, 11, 25, 19, 21],
|
||||||
|
'5311-' => [2, 9, 16, 23, 30, 10, 18, 24, 19, 21],
|
||||||
|
'5311+' => [2, 9, 16, 23, 30, 11, 18, 25, 19, 21],
|
||||||
|
'532' => [2, 9, 16, 23, 30, 17, 11, 25, 20, 21],
|
||||||
|
'532-' => [2, 9, 16, 23, 30, 10, 18, 24, 20, 21],
|
||||||
|
'532+' => [2, 9, 16, 23, 30, 11, 18, 25, 20, 21],
|
||||||
|
'541-' => [2, 9, 16, 23, 30, 4, 10, 24, 32, 21],
|
||||||
|
'541+' => [2, 9, 16, 23, 30, 4, 11, 25, 32, 21],
|
||||||
|
];
|
||||||
|
|
||||||
|
if (isset($lup[$key])) {
|
||||||
|
return $lup[$key];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Widgets\PlayerProps;
|
||||||
|
|
||||||
|
class PositionHirarchie
|
||||||
|
{
|
||||||
|
public static function load()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// 'DC' => ['DC'],
|
||||||
|
'DR' => ['MR', 'DC'],
|
||||||
|
'DL' => ['ML', 'DC'],
|
||||||
|
'SW' => ['DC'],
|
||||||
|
'MR' => ['DR', 'RW'],
|
||||||
|
'ML' => ['DL', 'LW'],
|
||||||
|
// 'MC' => ['MC'],
|
||||||
|
'DM' => ['MC'],
|
||||||
|
'AM' => ['LW', 'RW', 'MC'],
|
||||||
|
'LW' => ['AM', 'ST'],
|
||||||
|
'RW' => ['AM', 'ST'],
|
||||||
|
// 'ST' => ['ST'],
|
||||||
|
'SS' => ['ST'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,19 +2,27 @@
|
|||||||
|
|
||||||
namespace App\Filament\Widgets;
|
namespace App\Filament\Widgets;
|
||||||
|
|
||||||
|
use App\Filament\Pages\Selections\LoadPositions;
|
||||||
|
use App\Filament\Pages\Selections\LoadSeasons;
|
||||||
use App\Filament\Widgets\PlayerProps\BoxNames;
|
use App\Filament\Widgets\PlayerProps\BoxNames;
|
||||||
use App\Filament\Widgets\PlayerProps\Expectations;
|
use App\Filament\Widgets\PlayerProps\Expectations;
|
||||||
use App\Filament\Widgets\PlayerProps\LineUpMap;
|
use App\Filament\Widgets\PlayerProps\LineUpMap;
|
||||||
use App\Livewire\PlayerCalculator;
|
use App\Filament\Widgets\PlayerProps\PositionHirarchie;
|
||||||
use App\Models\ExpectedMinimumPosition;
|
use App\Models\ExpectedMinimumPosition;
|
||||||
use App\Models\SofaScorePlayerPerSeason;
|
use App\Models\SofaScoreCategory;
|
||||||
use App\Models\SofaScorePlayerPosition;
|
use App\Models\SofaScorePlayerPosition;
|
||||||
use App\Models\SofaScoreRosa;
|
use App\Models\SofaScoreRosa;
|
||||||
use App\Models\SsLineupMemory;
|
use App\Models\SsLineupMemory;
|
||||||
use App\Models\StatisticFixtures;
|
use App\Models\StatisticFixtures;
|
||||||
|
use App\Models\StatistikoDetail;
|
||||||
|
use App\Models\StatistikoEvent;
|
||||||
|
use App\Models\StatistikoPlayer;
|
||||||
use Filament\Notifications\Notification;
|
use Filament\Notifications\Notification;
|
||||||
use Filament\Widgets\Widget;
|
use Filament\Widgets\Widget;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use Livewire\Attributes\On;
|
use Livewire\Attributes\On;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,9 +50,19 @@ class PlayerPropsDrop extends Widget
|
|||||||
|
|
||||||
public string $team_name = '';
|
public string $team_name = '';
|
||||||
|
|
||||||
|
public string $season_or_date = 'season';
|
||||||
|
|
||||||
|
public string $season_mode = '';
|
||||||
|
|
||||||
|
public array $season;
|
||||||
|
|
||||||
|
public string $start_date = '';
|
||||||
|
|
||||||
|
public string $end_date = '';
|
||||||
|
|
||||||
public int $team_id = 0;
|
public int $team_id = 0;
|
||||||
|
|
||||||
public int $match_id;
|
public int $match_id = 0;
|
||||||
|
|
||||||
public int $player_on_field_counter;
|
public int $player_on_field_counter;
|
||||||
|
|
||||||
@@ -56,6 +74,8 @@ class PlayerPropsDrop extends Widget
|
|||||||
{
|
{
|
||||||
$this->activeBoxes = BoxNames::load();
|
$this->activeBoxes = BoxNames::load();
|
||||||
|
|
||||||
|
$this->season_or_date = 'season';
|
||||||
|
|
||||||
$this->lineUpMap = LineUpMap::load();
|
$this->lineUpMap = LineUpMap::load();
|
||||||
|
|
||||||
$this->player_on_field_counter = 0;
|
$this->player_on_field_counter = 0;
|
||||||
@@ -77,6 +97,7 @@ class PlayerPropsDrop extends Widget
|
|||||||
{
|
{
|
||||||
$this->team_name = '';
|
$this->team_name = '';
|
||||||
$this->match_id = 0;
|
$this->match_id = 0;
|
||||||
|
$this->team_id = 0;
|
||||||
for ($i = 1; $i <= 35; $i++) {
|
for ($i = 1; $i <= 35; $i++) {
|
||||||
$this->boxes[$i] = [];
|
$this->boxes[$i] = [];
|
||||||
}
|
}
|
||||||
@@ -100,12 +121,80 @@ class PlayerPropsDrop extends Widget
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[On('team-update')]
|
#[On('team-update')]
|
||||||
public function syncData(?int $team_id)
|
public function teamUpdate(int $team_id)
|
||||||
|
{
|
||||||
|
$this->team_id = $team_id;
|
||||||
|
|
||||||
|
$this->syncData($team_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function syncData(int $team_id)
|
||||||
{
|
{
|
||||||
if ($team_id) {
|
if ($team_id) {
|
||||||
$this->players = PlayerCalculator::load($team_id);
|
$this->players = [];
|
||||||
$this->team_name = SofaScoreRosa::where('ss_team_id', $team_id)->value('ss_team_name');
|
|
||||||
$this->team_id = $team_id;
|
$positions_map = LoadPositions::load();
|
||||||
|
|
||||||
|
$players = $this->loadAverages();
|
||||||
|
|
||||||
|
foreach ($players as $val) {
|
||||||
|
|
||||||
|
$tmp = [];
|
||||||
|
$tmp['id'] = $val['ss_player_id'];
|
||||||
|
$tmp['name'] = $val['player_name'];
|
||||||
|
$tmp['pos_ori'] = $val['position'];
|
||||||
|
$tmp['foot'] = $val['preferred_foot'];
|
||||||
|
$tmp['pos'] = '';
|
||||||
|
$tmp['active'] = 0;
|
||||||
|
$tmp['tot_evt'] = $val['total_events'];
|
||||||
|
$tmp['tot_min'] = $val['total_min'];
|
||||||
|
$tmp['ave_min'] = $val['average_min'];
|
||||||
|
$tmp['gls'] = $val['goals'];
|
||||||
|
$tmp['fls'] = $val['fouls'];
|
||||||
|
$tmp['ofs'] = $val['offsides'];
|
||||||
|
$tmp['crd'] = $val['cards'];
|
||||||
|
$tmp['snt'] = $val['shots_on_target'];
|
||||||
|
$tmp['tsh'] = $val['shots_off_target'];
|
||||||
|
$tmp['wfl'] = $val['was_fouled'];
|
||||||
|
|
||||||
|
$level = round($val['total_events'] / 3);
|
||||||
|
if ($val['total_events']) {
|
||||||
|
if ($level > 1 && $val['total_events'] < $level) {
|
||||||
|
$tmp['color_evt'] = 'danger';
|
||||||
|
} elseif ($val['total_events'] < $level * 2) {
|
||||||
|
$tmp['color_evt'] = 'info';
|
||||||
|
} else {
|
||||||
|
$tmp['color_evt'] = 'success';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array($val['position'], $positions_map['MIDFIELD'])) {
|
||||||
|
$tmp['area'] = 'midfield';
|
||||||
|
$tmp['color_pos'] = 'info';
|
||||||
|
$tmp['order'] = 2;
|
||||||
|
} elseif (in_array($val['position'], $positions_map['DEFENCE'])) {
|
||||||
|
$tmp['area'] = 'defence';
|
||||||
|
$tmp['color_pos'] = 'success';
|
||||||
|
$tmp['order'] = 1;
|
||||||
|
} elseif (in_array($val['position'], $positions_map['ATTACK'])) {
|
||||||
|
$tmp['area'] = 'attack';
|
||||||
|
$tmp['color_pos'] = 'warning';
|
||||||
|
$tmp['order'] = 3;
|
||||||
|
} elseif (in_array($val['position'], $positions_map['GOALKEEPER'])) {
|
||||||
|
$tmp['area'] = 'goalkeeper';
|
||||||
|
$tmp['color_pos'] = 'gray';
|
||||||
|
$tmp['order'] = 4;
|
||||||
|
} else {
|
||||||
|
$tmp['area'] = 'defence';
|
||||||
|
$tmp['color_pos'] = 'success';
|
||||||
|
$tmp['order'] = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->players[] = $tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->team_name = SofaScoreRosa::where('ss_team_id', $this->team_id)->value('ss_team_name');
|
||||||
|
|
||||||
$this->loadPlacement();
|
$this->loadPlacement();
|
||||||
} else {
|
} else {
|
||||||
$this->team_name = '';
|
$this->team_name = '';
|
||||||
@@ -118,8 +207,14 @@ class PlayerPropsDrop extends Widget
|
|||||||
public function lineUpUpdate(int|string $activeLineUp)
|
public function lineUpUpdate(int|string $activeLineUp)
|
||||||
{
|
{
|
||||||
$this->activeLineUp = $activeLineUp;
|
$this->activeLineUp = $activeLineUp;
|
||||||
|
|
||||||
$this->lineup = $this->lineUpMap[$activeLineUp];
|
$this->lineup = $this->lineUpMap[$activeLineUp];
|
||||||
|
|
||||||
$this->loadPlacement();
|
$this->loadPlacement();
|
||||||
|
|
||||||
|
$this->generateLineUp();
|
||||||
|
|
||||||
|
$this->calculateAspg();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[On('element-dropped-in-box')]
|
#[On('element-dropped-in-box')]
|
||||||
@@ -162,6 +257,44 @@ class PlayerPropsDrop extends Widget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[On('season_or_date-update')]
|
||||||
|
public function setSeasonOrData(string $season_or_date)
|
||||||
|
{
|
||||||
|
$this->season_or_date = $season_or_date;
|
||||||
|
|
||||||
|
if ($this->player_on_field_counter >= 10) {
|
||||||
|
$this->calculateAspg();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[On('start_date-update')]
|
||||||
|
public function setStartDate(string $start_date)
|
||||||
|
{
|
||||||
|
$this->start_date = $start_date;
|
||||||
|
|
||||||
|
if ($this->player_on_field_counter >= 10) {
|
||||||
|
$this->calculateAspg();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[On('end_date-update')]
|
||||||
|
public function setEndDate(string $end_date)
|
||||||
|
{
|
||||||
|
$this->end_date = $end_date;
|
||||||
|
|
||||||
|
if ($this->player_on_field_counter >= 10) {
|
||||||
|
$this->calculateAspg();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[On('season_mode-update')]
|
||||||
|
public function setSeason(string $country_id)
|
||||||
|
{
|
||||||
|
$season_mode = SofaScoreCategory::where('id', $country_id)->value('season_mode');
|
||||||
|
$this->season_mode = $season_mode;
|
||||||
|
$this->season = LoadSeasons::load($season_mode);
|
||||||
|
}
|
||||||
|
|
||||||
public function loadPlacement()
|
public function loadPlacement()
|
||||||
{
|
{
|
||||||
$this->clearResultTable();
|
$this->clearResultTable();
|
||||||
@@ -173,7 +306,6 @@ class PlayerPropsDrop extends Widget
|
|||||||
$res = SsLineupMemory::where('client_id', Auth::user()->client_id)->where('team_id', $this->team_id)->where('lineup', $this->activeLineUp)->first();
|
$res = SsLineupMemory::where('client_id', Auth::user()->client_id)->where('team_id', $this->team_id)->where('lineup', $this->activeLineUp)->first();
|
||||||
|
|
||||||
if ($res) {
|
if ($res) {
|
||||||
// Log::debug('SsLineupMemory', $res->toArray());
|
|
||||||
|
|
||||||
$placement = json_decode($res->placement, 1);
|
$placement = json_decode($res->placement, 1);
|
||||||
|
|
||||||
@@ -192,6 +324,7 @@ class PlayerPropsDrop extends Widget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// dd('here');
|
||||||
$this->calculateAspg();
|
$this->calculateAspg();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,6 +384,7 @@ class PlayerPropsDrop extends Widget
|
|||||||
$this->players[$k]['crd'] = '';
|
$this->players[$k]['crd'] = '';
|
||||||
$this->players[$k]['snt'] = '';
|
$this->players[$k]['snt'] = '';
|
||||||
$this->players[$k]['tsh'] = '';
|
$this->players[$k]['tsh'] = '';
|
||||||
|
$this->players[$k]['wfl'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->storePlacement();
|
$this->storePlacement();
|
||||||
@@ -275,6 +409,7 @@ class PlayerPropsDrop extends Widget
|
|||||||
$this->players[$k]['crd'] = '';
|
$this->players[$k]['crd'] = '';
|
||||||
$this->players[$k]['snt'] = '';
|
$this->players[$k]['snt'] = '';
|
||||||
$this->players[$k]['tsh'] = '';
|
$this->players[$k]['tsh'] = '';
|
||||||
|
$this->players[$k]['wfl'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->player_on_field_counter = 0;
|
$this->player_on_field_counter = 0;
|
||||||
@@ -297,9 +432,9 @@ class PlayerPropsDrop extends Widget
|
|||||||
foreach ($this->calculationVariables as $row) {
|
foreach ($this->calculationVariables as $row) {
|
||||||
if ($copystring == '') {
|
if ($copystring == '') {
|
||||||
$keys = array_keys($row);
|
$keys = array_keys($row);
|
||||||
$copystring .= implode(';', $keys) . "\n";
|
$copystring .= implode(';', $keys)."\n";
|
||||||
}
|
}
|
||||||
$copystring .= implode(';', $row) . "\n";
|
$copystring .= implode(';', $row)."\n";
|
||||||
}
|
}
|
||||||
$this->js("navigator.clipboard.writeText(`$copystring`)");
|
$this->js("navigator.clipboard.writeText(`$copystring`)");
|
||||||
|
|
||||||
@@ -318,8 +453,8 @@ class PlayerPropsDrop extends Widget
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$header = ['name', 'foot', 'events', 'average min', 'position', 'on field', 'gls', 'fls', 'ofs', 'crd', 'snt', 'tsh'];
|
$header = ['name', 'foot', 'events', 'average min', 'position', 'on field', 'gls', 'fls', 'ofs', 'crd', 'snt', 'tsh', 'wfl'];
|
||||||
$copystring = implode(';', $header) . "\n";
|
$copystring = implode(';', $header)."\n";
|
||||||
foreach ($this->players as $row) {
|
foreach ($this->players as $row) {
|
||||||
$tmp = [];
|
$tmp = [];
|
||||||
$tmp[] = $row['name'];
|
$tmp[] = $row['name'];
|
||||||
@@ -338,8 +473,9 @@ class PlayerPropsDrop extends Widget
|
|||||||
$tmp[] = $row['crd'];
|
$tmp[] = $row['crd'];
|
||||||
$tmp[] = $row['snt'];
|
$tmp[] = $row['snt'];
|
||||||
$tmp[] = $row['tsh'];
|
$tmp[] = $row['tsh'];
|
||||||
|
$tmp[] = $row['wfl'];
|
||||||
|
|
||||||
$copystring .= implode(';', $tmp) . "\n";
|
$copystring .= implode(';', $tmp)."\n";
|
||||||
}
|
}
|
||||||
$this->js("navigator.clipboard.writeText(`$copystring`)");
|
$this->js("navigator.clipboard.writeText(`$copystring`)");
|
||||||
|
|
||||||
@@ -359,6 +495,7 @@ class PlayerPropsDrop extends Widget
|
|||||||
$this->players[$k]['crd'] = '';
|
$this->players[$k]['crd'] = '';
|
||||||
$this->players[$k]['snt'] = '';
|
$this->players[$k]['snt'] = '';
|
||||||
$this->players[$k]['tsh'] = '';
|
$this->players[$k]['tsh'] = '';
|
||||||
|
$this->players[$k]['wfl'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->dispatch('update-players', players: $this->players);
|
$this->dispatch('update-players', players: $this->players);
|
||||||
@@ -371,6 +508,12 @@ class PlayerPropsDrop extends Widget
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $this->team_id && ! $this->match_id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Log::info($this->team_id, ['calculateAspg']);
|
||||||
// Calcolare Aspettativa Team per GOALS
|
// Calcolare Aspettativa Team per GOALS
|
||||||
// (il valore che appare quando viene selezionato un Evento): nell' esempio,
|
// (il valore che appare quando viene selezionato un Evento): nell' esempio,
|
||||||
// se scegliamo come Team il Remo (Home) il valore di riferimento sarà 1.2
|
// se scegliamo come Team il Remo (Home) il valore di riferimento sarà 1.2
|
||||||
@@ -385,20 +528,28 @@ class PlayerPropsDrop extends Widget
|
|||||||
$asp_team = (float) $match->exp_away;
|
$asp_team = (float) $match->exp_away;
|
||||||
$team_home_away = 'away';
|
$team_home_away = 'away';
|
||||||
}
|
}
|
||||||
|
$arr = [
|
||||||
|
'team_id' => $this->team_id,
|
||||||
|
'season_or_date' => $this->season_or_date,
|
||||||
|
'season' => $this->season,
|
||||||
|
'season_mode' => $this->season_mode,
|
||||||
|
'start_date' => $this->end_date,
|
||||||
|
'end_date' => $this->end_date,
|
||||||
|
];
|
||||||
|
|
||||||
$player_totals = SofaScorePlayerPerSeason::with('details')->where('total_min', '>', 0)->where('season', 'total')->where('ss_team_id', $team_id)->get();
|
$players = $this->loadAverages();
|
||||||
|
|
||||||
$count_player = 0;
|
$count_player = 0;
|
||||||
foreach ($player_totals as $key => $value) {
|
foreach ($players as $ss_player_id => $value) {
|
||||||
if ($value->details != null && $value->details->position != 'GK' && (int) $value->details->is_active != 0) {
|
if ($value['position'] != 'GK') {
|
||||||
$count_player++;
|
$count_player++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$results = [];
|
$results = [];
|
||||||
|
|
||||||
foreach ($player_totals as $val) {
|
foreach ($players as $val) {
|
||||||
if ($val->details != null && $val->details->position != 'GK' && (int) $val->details->is_active != 0) {
|
if ($val['position'] != 'GK') {
|
||||||
|
|
||||||
/***
|
/***
|
||||||
"goals" => 0
|
"goals" => 0
|
||||||
@@ -410,12 +561,12 @@ class PlayerPropsDrop extends Widget
|
|||||||
"total_shots" => 4
|
"total_shots" => 4
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$ss_player_id = $val->ss_player_id;
|
$ss_player_id = $val['ss_player_id'];
|
||||||
$position = $val->details->position;
|
$position = $val['position'];
|
||||||
|
|
||||||
$tmp = [];
|
$tmp = [];
|
||||||
$tmp['id'] = $ss_player_id;
|
$tmp['id'] = $ss_player_id;
|
||||||
$tmp['name'] = $val->details->player_name;
|
$tmp['name'] = $val['player_name'];
|
||||||
|
|
||||||
$tmp['id_team'] = $team_id;
|
$tmp['id_team'] = $team_id;
|
||||||
$tmp['asp_team'] = $asp_team;
|
$tmp['asp_team'] = $asp_team;
|
||||||
@@ -435,10 +586,10 @@ class PlayerPropsDrop extends Widget
|
|||||||
// Il valore Y dovrebbe essere configurabile in una interfaccia. Il valore iniziale lo fissiamo a Y = 180
|
// Il valore Y dovrebbe essere configurabile in una interfaccia. Il valore iniziale lo fissiamo a Y = 180
|
||||||
|
|
||||||
// Somma Minuti Giocati da Player (SMG) nel DB
|
// Somma Minuti Giocati da Player (SMG) nel DB
|
||||||
$tmp['somma_minuti'] = $val->total_min;
|
$tmp['somma_minuti'] = $val['total_min'];
|
||||||
$tmp['shots_on_target'] = $val->shots_on_target;
|
$tmp['shots_on_target'] = $val['shots_on_target'];
|
||||||
$tmp['shots_off_target'] = $val->shots_off_target;
|
$tmp['shots_off_target'] = $val['shots_off_target'];
|
||||||
$tmp['shots_blocked'] = $val->shots_blocked;
|
$tmp['shots_blocked'] = $val['shots_blocked'];
|
||||||
|
|
||||||
// il valore corrispondente al ruolo del Player (esempio un giocatore in Details ha ruolo = RW
|
// il valore corrispondente al ruolo del Player (esempio un giocatore in Details ha ruolo = RW
|
||||||
// quindi Aspettativa Statistica (AS) per RW = 0.219)
|
// quindi Aspettativa Statistica (AS) per RW = 0.219)
|
||||||
@@ -451,11 +602,11 @@ class PlayerPropsDrop extends Widget
|
|||||||
// exp_total_shots
|
// exp_total_shots
|
||||||
// exp_shots_on_target
|
// exp_shots_on_target
|
||||||
|
|
||||||
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target'];
|
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target', 'was_fouled'];
|
||||||
foreach ($bettypes as $bettype) {
|
foreach ($bettypes as $bettype) {
|
||||||
|
|
||||||
$asp_statistica = (float) SofaScorePlayerPosition::where('ss_code', $position)->value('exp_' . $bettype);
|
$asp_statistica = (float) SofaScorePlayerPosition::where('ss_code', $position)->value('exp_'.$bettype);
|
||||||
$tmp['asp_statistica_' . $bettype] = $asp_statistica;
|
$tmp['asp_statistica_'.$bettype] = $asp_statistica;
|
||||||
|
|
||||||
// if ($val->ss_player_id == 243651)
|
// if ($val->ss_player_id == 243651)
|
||||||
// dd($val, $asp_statistica);
|
// dd($val, $asp_statistica);
|
||||||
@@ -468,63 +619,73 @@ class PlayerPropsDrop extends Widget
|
|||||||
|
|
||||||
switch ($bettype) {
|
switch ($bettype) {
|
||||||
case 'goals':
|
case 'goals':
|
||||||
$asp_gioco = $val->goals / $val->total_min * 90;
|
$asp_gioco = $val['goals'] / $val['total_min'] * 90;
|
||||||
if ($asp_gioco == 0 || $val->total_min < $this->y_value) {
|
if ($asp_gioco == 0 || $val['total_min'] < $this->y_value) {
|
||||||
$tmp['asp_gioco_' . $bettype] = 0;
|
$tmp['asp_gioco_'.$bettype] = 0;
|
||||||
$tmp['asp_teorica_' . $bettype] = $asp_statistica;
|
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||||
} else {
|
} else {
|
||||||
$tmp['asp_gioco_' . $bettype] = $asp_gioco;
|
$tmp['asp_gioco_'.$bettype] = $asp_gioco;
|
||||||
$tmp['asp_teorica_' . $bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'cards':
|
case 'cards':
|
||||||
$asp_gioco = $val->cards / $val->total_min * 90;
|
$asp_gioco = $val['cards'] / $val['total_min'] * 90;
|
||||||
if ($asp_gioco == 0 || $val->total_min < $this->y_value) {
|
if ($asp_gioco == 0 || $val['total_min'] < $this->y_value) {
|
||||||
$tmp['asp_gioco_' . $bettype] = 0;
|
$tmp['asp_gioco_'.$bettype] = 0;
|
||||||
$tmp['asp_teorica_' . $bettype] = $asp_statistica;
|
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||||
} else {
|
} else {
|
||||||
$tmp['asp_gioco_' . $bettype] = $asp_gioco;
|
$tmp['asp_gioco_'.$bettype] = $asp_gioco;
|
||||||
$tmp['asp_teorica_' . $bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'fouls':
|
case 'fouls':
|
||||||
$asp_gioco = $val->fouls / $val->total_min * 90;
|
$asp_gioco = $val['fouls'] / $val['total_min'] * 90;
|
||||||
if ($asp_gioco == 0 || $val->total_min < $this->y_value) {
|
if ($asp_gioco == 0 || $val['total_min'] < $this->y_value) {
|
||||||
$tmp['asp_gioco_' . $bettype] = 0;
|
$tmp['asp_gioco_'.$bettype] = 0;
|
||||||
$tmp['asp_teorica_' . $bettype] = $asp_statistica;
|
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||||
} else {
|
} else {
|
||||||
$tmp['asp_gioco_' . $bettype] = $asp_gioco;
|
$tmp['asp_gioco_'.$bettype] = $asp_gioco;
|
||||||
$tmp['asp_teorica_' . $bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'offsides':
|
case 'offsides':
|
||||||
$asp_gioco = $val->offsides / $val->total_min * 90;
|
$asp_gioco = $val['offsides'] / $val['total_min'] * 90;
|
||||||
if ($asp_gioco == 0 || $val->total_min < $this->y_value) {
|
if ($asp_gioco == 0 || $val['total_min'] < $this->y_value) {
|
||||||
$tmp['asp_gioco_' . $bettype] = 0;
|
$tmp['asp_gioco_'.$bettype] = 0;
|
||||||
$tmp['asp_teorica_' . $bettype] = $asp_statistica;
|
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||||
} else {
|
} else {
|
||||||
$tmp['asp_gioco_' . $bettype] = $asp_gioco;
|
$tmp['asp_gioco_'.$bettype] = $asp_gioco;
|
||||||
$tmp['asp_teorica_' . $bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'total_shots':
|
case 'total_shots':
|
||||||
$asp_gioco = $val->total_shots / $val->total_min * 90;
|
$asp_gioco = $val['total_shots'] / $val['total_min'] * 90;
|
||||||
if ($asp_gioco == 0 || $val->total_min < $this->y_value) {
|
if ($asp_gioco == 0 || $val['total_min'] < $this->y_value) {
|
||||||
$tmp['asp_gioco_' . $bettype] = 0;
|
$tmp['asp_gioco_'.$bettype] = 0;
|
||||||
$tmp['asp_teorica_' . $bettype] = $asp_statistica;
|
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||||
} else {
|
} else {
|
||||||
$tmp['asp_gioco_' . $bettype] = $asp_gioco;
|
$tmp['asp_gioco_'.$bettype] = $asp_gioco;
|
||||||
$tmp['asp_teorica_' . $bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'shots_on_target':
|
case 'shots_on_target':
|
||||||
$asp_gioco = $val->shots_on_target / $val->total_min * 90;
|
$asp_gioco = $val['shots_on_target'] / $val['total_min'] * 90;
|
||||||
if ($asp_gioco == 0 || $val->total_min < $this->y_value) {
|
if ($asp_gioco == 0 || $val['total_min'] < $this->y_value) {
|
||||||
$tmp['asp_gioco_' . $bettype] = 0;
|
$tmp['asp_gioco_'.$bettype] = 0;
|
||||||
$tmp['asp_teorica_' . $bettype] = $asp_statistica;
|
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||||
} else {
|
} else {
|
||||||
$tmp['asp_gioco_' . $bettype] = $asp_gioco;
|
$tmp['asp_gioco_'.$bettype] = $asp_gioco;
|
||||||
$tmp['asp_teorica_' . $bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'was_fouled':
|
||||||
|
$asp_gioco = $val['was_fouled'] / $val['total_min'] * 90;
|
||||||
|
if ($asp_gioco == 0 || $val['total_min'] < $this->y_value) {
|
||||||
|
$tmp['asp_gioco_'.$bettype] = 0;
|
||||||
|
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||||
|
} else {
|
||||||
|
$tmp['asp_gioco_'.$bettype] = $asp_gioco;
|
||||||
|
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -543,10 +704,10 @@ class PlayerPropsDrop extends Widget
|
|||||||
// (ATR) = Aspettativa Team * Numero di Giocatori di Team in Rosters (esclusi i portieri) / 10.
|
// (ATR) = Aspettativa Team * Numero di Giocatori di Team in Rosters (esclusi i portieri) / 10.
|
||||||
// Ad esempio per Remo (supponiamo 24 giocatori nel Roster esclusi i portieri): ATR = 1.2 * 24 / 10 = 2.88
|
// Ad esempio per Remo (supponiamo 24 giocatori nel Roster esclusi i portieri): ATR = 1.2 * 24 / 10 = 2.88
|
||||||
|
|
||||||
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target'];
|
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target', 'was_fouled'];
|
||||||
foreach ($bettypes as $bettype) {
|
foreach ($bettypes as $bettype) {
|
||||||
|
|
||||||
$total_bettype = array_sum(array_column($results, 'asp_teorica_' . $bettype));
|
$total_bettype = array_sum(array_column($results, 'asp_teorica_'.$bettype));
|
||||||
|
|
||||||
foreach ($results as $key => $value) {
|
foreach ($results as $key => $value) {
|
||||||
switch ($bettype) {
|
switch ($bettype) {
|
||||||
@@ -557,38 +718,44 @@ class PlayerPropsDrop extends Widget
|
|||||||
|
|
||||||
$asp_team_riferimento = (float) $asp_team * $count_player / 10;
|
$asp_team_riferimento = (float) $asp_team * $count_player / 10;
|
||||||
$results[$key]['asp_riferimento_goals'] = $asp_team_riferimento;
|
$results[$key]['asp_riferimento_goals'] = $asp_team_riferimento;
|
||||||
$results[$key]['asp_player_' . $bettype] = $value['asp_teorica_' . $bettype] * $asp_team_riferimento / $total_bettype;
|
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_riferimento / $total_bettype;
|
||||||
$results[$key]['asp_total_' . $bettype] = $total_bettype;
|
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||||
break;
|
break;
|
||||||
case 'cards':
|
case 'cards':
|
||||||
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['crd'] * $count_player / 10;
|
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['crd'] * $count_player / 10;
|
||||||
$results[$key]['asp_team_riferimento_card'] = $asp_team_riferimento;
|
$results[$key]['asp_team_riferimento_card'] = $asp_team_riferimento;
|
||||||
$results[$key]['asp_total_' . $bettype] = $total_bettype;
|
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||||
$results[$key]['asp_player_' . $bettype] = $value['asp_teorica_' . $bettype] * $asp_team_riferimento / $total_bettype;
|
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_riferimento / $total_bettype;
|
||||||
break;
|
break;
|
||||||
case 'fouls':
|
case 'fouls':
|
||||||
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['fls'] * $count_player / 10;
|
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['fls'] * $count_player / 10;
|
||||||
$results[$key]['asp_team_riferimento_fouls'] = $asp_team_riferimento;
|
$results[$key]['asp_team_riferimento_fouls'] = $asp_team_riferimento;
|
||||||
$results[$key]['asp_total_' . $bettype] = $total_bettype;
|
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||||
$results[$key]['asp_player_' . $bettype] = $value['asp_teorica_' . $bettype] * $asp_team_riferimento / $total_bettype;
|
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_riferimento / $total_bettype;
|
||||||
break;
|
break;
|
||||||
case 'offsides':
|
case 'offsides':
|
||||||
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['ofs'] * $count_player / 10;
|
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['ofs'] * $count_player / 10;
|
||||||
$results[$key]['asp_team_riferimento_offside'] = $asp_team_riferimento;
|
$results[$key]['asp_team_riferimento_offside'] = $asp_team_riferimento;
|
||||||
$results[$key]['asp_total_' . $bettype] = $total_bettype;
|
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||||
$results[$key]['asp_player_' . $bettype] = $value['asp_teorica_' . $bettype] * $asp_team_riferimento / $total_bettype;
|
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_riferimento / $total_bettype;
|
||||||
break;
|
break;
|
||||||
case 'total_shots':
|
case 'total_shots':
|
||||||
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['tsh'] * $count_player / 10;
|
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['tsh'] * $count_player / 10;
|
||||||
$results[$key]['asp_team_riferimento_tsh'] = $asp_team_riferimento;
|
$results[$key]['asp_team_riferimento_tsh'] = $asp_team_riferimento;
|
||||||
$results[$key]['asp_total_' . $bettype] = $total_bettype;
|
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||||
$results[$key]['asp_player_' . $bettype] = $value['asp_teorica_' . $bettype] * $asp_team_riferimento / $total_bettype;
|
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_riferimento / $total_bettype;
|
||||||
break;
|
break;
|
||||||
case 'shots_on_target':
|
case 'shots_on_target':
|
||||||
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['snt'] * $count_player / 10;
|
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['snt'] * $count_player / 10;
|
||||||
$results[$key]['asp_team_riferimento_snt'] = $asp_team_riferimento;
|
$results[$key]['asp_team_riferimento_snt'] = $asp_team_riferimento;
|
||||||
$results[$key]['asp_total_' . $bettype] = $total_bettype;
|
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||||
$results[$key]['asp_player_' . $bettype] = $value['asp_teorica_' . $bettype] * $asp_team_riferimento / $total_bettype;
|
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_riferimento / $total_bettype;
|
||||||
|
break;
|
||||||
|
case 'was_fouled':
|
||||||
|
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['wfl'] * $count_player / 10;
|
||||||
|
$results[$key]['asp_team_riferimento_wfl'] = $asp_team_riferimento;
|
||||||
|
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||||
|
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_riferimento / $total_bettype;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -603,9 +770,10 @@ class PlayerPropsDrop extends Widget
|
|||||||
$map[$val->position]['ofs'] = $val->ofs;
|
$map[$val->position]['ofs'] = $val->ofs;
|
||||||
$map[$val->position]['tsh'] = $val->tsh;
|
$map[$val->position]['tsh'] = $val->tsh;
|
||||||
$map[$val->position]['snt'] = $val->snt;
|
$map[$val->position]['snt'] = $val->snt;
|
||||||
|
$map[$val->position]['wfl'] = $val->wfl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// stesso ordine di prima: GLS, CRD, FLS, OFS, TSH, SNT
|
// stesso ordine di prima: GLS, CRD, FLS, OFS, TSH, SNT, WFL
|
||||||
|
|
||||||
foreach ($this->players as $k => $player) {
|
foreach ($this->players as $k => $player) {
|
||||||
foreach ($results as $key => $result) {
|
foreach ($results as $key => $result) {
|
||||||
@@ -614,9 +782,11 @@ class PlayerPropsDrop extends Widget
|
|||||||
$this->players[$k]['active'] = $result['active'];
|
$this->players[$k]['active'] = $result['active'];
|
||||||
|
|
||||||
$pos = $this->players[$k]['pos'];
|
$pos = $this->players[$k]['pos'];
|
||||||
if (!$pos)
|
if (! $pos) {
|
||||||
$pos = $this->players[$k]['pos_ori'];
|
$pos = $this->players[$k]['pos_ori'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($pos != 'GK') {
|
||||||
$tamx = number_format($map[$pos]['gls'], 3);
|
$tamx = number_format($map[$pos]['gls'], 3);
|
||||||
$final = number_format($result['asp_player_goals'], 3);
|
$final = number_format($result['asp_player_goals'], 3);
|
||||||
$results[$key]['finale_tamx_gls'] = $tamx;
|
$results[$key]['finale_tamx_gls'] = $tamx;
|
||||||
@@ -652,6 +822,13 @@ class PlayerPropsDrop extends Widget
|
|||||||
$results[$key]['finale_tamx_snt'] = $tamx;
|
$results[$key]['finale_tamx_snt'] = $tamx;
|
||||||
$results[$key]['finale_calc_snt'] = $final;
|
$results[$key]['finale_calc_snt'] = $final;
|
||||||
$this->players[$k]['snt'] = (float) $final > (float) $tamx ? $final : $tamx;
|
$this->players[$k]['snt'] = (float) $final > (float) $tamx ? $final : $tamx;
|
||||||
|
|
||||||
|
$tamx = number_format($map[$pos]['wfl'], 3);
|
||||||
|
$final = number_format($result['asp_player_was_fouled'], 3);
|
||||||
|
$results[$key]['finale_tamx_wfl'] = $tamx;
|
||||||
|
$results[$key]['finale_calc_wfl'] = $final;
|
||||||
|
$this->players[$k]['wfl'] = (float) $final > (float) $tamx ? $final : $tamx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -672,4 +849,325 @@ class PlayerPropsDrop extends Widget
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function prepareLineUp()
|
||||||
|
{
|
||||||
|
$arr = [
|
||||||
|
'team_id' => $this->team_id,
|
||||||
|
'season_or_date' => $this->season_or_date,
|
||||||
|
'season' => $this->season,
|
||||||
|
'season_mode' => $this->season_mode,
|
||||||
|
'start_date' => $this->start_date,
|
||||||
|
'end_date' => $this->end_date,
|
||||||
|
];
|
||||||
|
|
||||||
|
$players = $this->loadAverages();
|
||||||
|
|
||||||
|
$arr = collect();
|
||||||
|
foreach ($players as $value) {
|
||||||
|
if ($value['position'] != '') {
|
||||||
|
$arr->push([
|
||||||
|
'id' => $value['ss_player_id'],
|
||||||
|
'min' => $value['average_min'],
|
||||||
|
'pos' => $value['position'],
|
||||||
|
'name' => $value['player_name'],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function generateLineUp(): void
|
||||||
|
{
|
||||||
|
if ($this->activeLineUp && $this->team_id) {
|
||||||
|
|
||||||
|
$players = $this->prepareLineUp();
|
||||||
|
|
||||||
|
$places = LineUpMap::get($this->activeLineUp);
|
||||||
|
|
||||||
|
$lineup = [];
|
||||||
|
|
||||||
|
$id_used = [];
|
||||||
|
|
||||||
|
foreach ($places as $place) {
|
||||||
|
$this->getPlayerForPosition($lineup, $id_used, $place, $players);
|
||||||
|
}
|
||||||
|
|
||||||
|
for ($i = 1; $i <= 35; $i++) {
|
||||||
|
$this->boxes[$i] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->clearResultTable();
|
||||||
|
|
||||||
|
$this->player_on_field_counter = 0;
|
||||||
|
|
||||||
|
foreach ($this->players as $k => $record) {
|
||||||
|
$id = $record['id'];
|
||||||
|
if (isset($lineup[$id])) {
|
||||||
|
|
||||||
|
$this->boxes[$lineup[$id]['place']] = $record;
|
||||||
|
|
||||||
|
$this->players[$k]['active'] = 1;
|
||||||
|
$this->players[$k]['pos'] = $lineup[$id]['position'];
|
||||||
|
|
||||||
|
$this->player_on_field_counter++;
|
||||||
|
} else {
|
||||||
|
$this->players[$k]['active'] = 0;
|
||||||
|
$this->players[$k]['pos'] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->calculateAspg();
|
||||||
|
|
||||||
|
$this->storePlacement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function majorFormations(): array
|
||||||
|
{
|
||||||
|
// 343+
|
||||||
|
// 352
|
||||||
|
// 433+
|
||||||
|
// 442+
|
||||||
|
// 4231
|
||||||
|
// 4321+
|
||||||
|
// 4312+
|
||||||
|
// 4411+
|
||||||
|
return [
|
||||||
|
'343+' => [9, 16, 23, 4, 11, 25, 32, 6, 34, 21],
|
||||||
|
'352' => [9, 16, 23, 4, 11, 17, 25, 32, 20, 21],
|
||||||
|
'433+' => [2, 9, 23, 30, 11, 18, 25, 6, 34, 21],
|
||||||
|
'442+' => [2, 9, 23, 30, 4, 11, 25, 32, 20, 21],
|
||||||
|
'4231' => [2, 9, 23, 30, 10, 24, 12, 19, 26, 21],
|
||||||
|
'4321+' => [2, 9, 23, 30, 11, 18, 25, 12, 26, 21],
|
||||||
|
'4312+' => [2, 9, 23, 30, 11, 18, 25, 19, 20, 21],
|
||||||
|
'4411+' => [2, 9, 23, 30, 4, 11, 25, 32, 19, 21],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function generateBestLineUp(): void
|
||||||
|
{
|
||||||
|
if (! $this->team_id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$all_lineups = [];
|
||||||
|
|
||||||
|
$players = $this->prepareLineUp();
|
||||||
|
|
||||||
|
$major_formations = self::majorFormations();
|
||||||
|
|
||||||
|
foreach ($major_formations as $formation_name => $formation_positions) {
|
||||||
|
|
||||||
|
$lineup = [];
|
||||||
|
|
||||||
|
$id_used = [];
|
||||||
|
|
||||||
|
foreach ($formation_positions as $place) {
|
||||||
|
$this->getPlayerForPosition($lineup, $id_used, $place, $players);
|
||||||
|
}
|
||||||
|
|
||||||
|
$all_lineups[$formation_name] = $lineup;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tmp = [];
|
||||||
|
foreach ($all_lineups as $formation_name => $lineup) {
|
||||||
|
$tmp[$formation_name] = array_sum(array_column($lineup, 'min'));
|
||||||
|
}
|
||||||
|
$formation_name = array_search(max($tmp), $tmp);
|
||||||
|
|
||||||
|
// dd($all_lineups, $tmp, $formation_name);
|
||||||
|
|
||||||
|
$this->dispatch('update-lineup', $formation_name);
|
||||||
|
|
||||||
|
$this->lineUpUpdate($formation_name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPlayerForPosition(array &$lineup, array &$id_used, int $place, Collection $players)
|
||||||
|
{
|
||||||
|
$log = 0;
|
||||||
|
|
||||||
|
$position = $this->activeBoxes[$place];
|
||||||
|
|
||||||
|
$hirarchy = PositionHirarchie::load();
|
||||||
|
|
||||||
|
$fitered = $players->where('pos', $position)->whereNotIn('id', $id_used)->sortByDesc('min')->first();
|
||||||
|
|
||||||
|
if (isset($fitered['id'])) {
|
||||||
|
|
||||||
|
if ($log) {
|
||||||
|
Log::debug("A $place - $position", $fitered);
|
||||||
|
}
|
||||||
|
|
||||||
|
$lineup[$fitered['id']] = ['id' => $fitered['id'], 'min' => $fitered['min'], 'place' => $place, 'position' => $position];
|
||||||
|
$id_used[] = $fitered['id'];
|
||||||
|
} else {
|
||||||
|
if (isset($hirarchy[$position])) {
|
||||||
|
$position2 = $hirarchy[$position][0];
|
||||||
|
$fitered = $players->where('pos', $position2)->whereNotIn('id', $id_used)->sortByDesc('min')->first();
|
||||||
|
|
||||||
|
if (isset($fitered['id'])) {
|
||||||
|
$lineup[$fitered['id']] = ['id' => $fitered['id'], 'min' => $fitered['min'], 'place' => $place, 'position' => $position];
|
||||||
|
$id_used[] = $fitered['id'];
|
||||||
|
if ($log) {
|
||||||
|
Log::debug("B $place - $position $position2", $fitered);
|
||||||
|
}
|
||||||
|
|
||||||
|
} elseif (isset($hirarchy[$position][1])) {
|
||||||
|
$position3 = $hirarchy[$position][1];
|
||||||
|
$fitered = $players->where('pos', $position3)->whereNotIn('id', $id_used)->sortByDesc('min')->first();
|
||||||
|
|
||||||
|
if (isset($fitered['id'])) {
|
||||||
|
if ($log) {
|
||||||
|
Log::debug("C $place - $position $position2 $position3", $fitered);
|
||||||
|
}
|
||||||
|
|
||||||
|
$lineup[$fitered['id']] = ['id' => $fitered['id'], 'min' => $fitered['min'], 'place' => $place, 'position' => $position];
|
||||||
|
$id_used[] = $fitered['id'];
|
||||||
|
} elseif (isset($hirarchy[$position][2])) {
|
||||||
|
$position4 = $hirarchy[$position][2];
|
||||||
|
$fitered = $players->where('pos', $position4)->whereNotIn('id', $id_used)->sortByDesc('min')->first();
|
||||||
|
|
||||||
|
if (isset($fitered['id'])) {
|
||||||
|
if ($log) {
|
||||||
|
Log::debug("D $place - $position $position2 $position3 $position4", $fitered);
|
||||||
|
}
|
||||||
|
|
||||||
|
$lineup[$fitered['id']] = ['id' => $fitered['id'], 'min' => $fitered['min'], 'place' => $place, 'position' => $position];
|
||||||
|
$id_used[] = $fitered['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function loadAverages(): array
|
||||||
|
{
|
||||||
|
if (! $this->team_id) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
// Log::debug('loadAverages', ['team_id' => $this->team_id]);
|
||||||
|
|
||||||
|
$players = StatistikoDetail::where('ss_team_id', $this->team_id)->where('is_active', 1)->get();
|
||||||
|
|
||||||
|
$player_ids = [];
|
||||||
|
|
||||||
|
foreach ($players as $player) {
|
||||||
|
$player_ids[] = $player->ss_player_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Log::debug('loadAverages', ['player_ids' => $player_ids]);
|
||||||
|
|
||||||
|
$start_date = null;
|
||||||
|
$end_date = null;
|
||||||
|
if ($this->season_or_date == 'season') {
|
||||||
|
$now = Carbon::now();
|
||||||
|
if ($this->season_mode == 'halfyear') {
|
||||||
|
if ((int) $now->month > 6) {
|
||||||
|
$season_start = $now->startOfYear()->addMonths(7);
|
||||||
|
} else {
|
||||||
|
$season_start = $now->startOfYear()->subMonths(7);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$season_start = $now->startOfYear();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$season_start = '';
|
||||||
|
$start_date = Carbon::parse($this->start_date);
|
||||||
|
$end_date = Carbon::parse($this->end_date);
|
||||||
|
// Log::debug('start end', [$start_date->format('Y-m-d').' - '.$end_date->format('Y-m-d')]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$match_ids = StatistikoEvent::when($start_date, function ($query) use ($start_date) {
|
||||||
|
return $query->whereDate('starttime', '>', $start_date);
|
||||||
|
})->when($end_date, function ($query) use ($end_date) {
|
||||||
|
return $query->whereDate('starttime', '<', $end_date);
|
||||||
|
})->when($season_start, function ($query) use ($season_start) {
|
||||||
|
return $query->whereDate('starttime', '>', $season_start);
|
||||||
|
})->pluck('match_id')->toArray();
|
||||||
|
|
||||||
|
// Log::debug('loadAverages', ['match_ids' => $match_ids]);
|
||||||
|
|
||||||
|
$res = StatistikoPlayer::with('details')
|
||||||
|
->whereIn('ss_player_id', $player_ids)
|
||||||
|
->whereIn('match_id', $match_ids)
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$arr = [];
|
||||||
|
foreach ($res as $val) {
|
||||||
|
|
||||||
|
$ss_player_id = (int) $val->ss_player_id;
|
||||||
|
$activeteam_id = (int) $val->activeteam_id;
|
||||||
|
$minutes_played = (int) $val->minutes_played;
|
||||||
|
$home_id = (int) $val->event->home_id;
|
||||||
|
$away_id = (int) $val->event->away_id;
|
||||||
|
|
||||||
|
if (! isset($arr[$ss_player_id])) {
|
||||||
|
self::array_template($arr, $ss_player_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($activeteam_id == $home_id) {
|
||||||
|
$arr[$ss_player_id]['events_played_home'] += 1;
|
||||||
|
$arr[$ss_player_id]['minutes_played_home'] += $minutes_played;
|
||||||
|
$arr[$ss_player_id]['events_played_home'] += 1;
|
||||||
|
$arr[$ss_player_id]['minutes_played_home'] += $minutes_played;
|
||||||
|
} elseif ($activeteam_id == $away_id) {
|
||||||
|
$arr[$ss_player_id]['events_played_away'] += 1;
|
||||||
|
$arr[$ss_player_id]['minutes_played_away'] += $minutes_played;
|
||||||
|
$arr[$ss_player_id]['events_played_away'] += 1;
|
||||||
|
$arr[$ss_player_id]['minutes_played_away'] += $minutes_played;
|
||||||
|
}
|
||||||
|
$cards = $val->card_yellow + $val->card_yellowred;
|
||||||
|
|
||||||
|
$arr[$ss_player_id]['ss_player_id'] = $ss_player_id;
|
||||||
|
$arr[$ss_player_id]['total_events']++;
|
||||||
|
$arr[$ss_player_id]['total_min'] += $minutes_played;
|
||||||
|
$arr[$ss_player_id]['average_min'] = round($arr[$ss_player_id]['total_min'] / $arr[$ss_player_id]['total_events']);
|
||||||
|
$arr[$ss_player_id]['goals'] += $val->goals;
|
||||||
|
$arr[$ss_player_id]['fouls'] += $val->fouls;
|
||||||
|
$arr[$ss_player_id]['cards'] += $cards;
|
||||||
|
$arr[$ss_player_id]['offsides'] += $val->offsides;
|
||||||
|
$arr[$ss_player_id]['shots_on_target'] += $val->shots_on_target;
|
||||||
|
$arr[$ss_player_id]['shots_off_target'] += $val->shots_off_target;
|
||||||
|
$arr[$ss_player_id]['shots_blocked'] += $val->shots_blocked;
|
||||||
|
$arr[$ss_player_id]['total_shots'] += $val->shots_on_target + $val->shots_off_target + $val->shots_blocked;
|
||||||
|
$arr[$ss_player_id]['was_fouled'] += $val->was_fouled;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($players as $value) {
|
||||||
|
if (isset($arr[$value->ss_player_id])) {
|
||||||
|
$arr[$value->ss_player_id]['position'] = $value->position;
|
||||||
|
$arr[$value->ss_player_id]['player_name'] = $value->player_name;
|
||||||
|
$arr[$value->ss_player_id]['preferred_foot'] = $value->preferred_foot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Log::debug('loadAverages final', $arr);
|
||||||
|
|
||||||
|
return $arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function array_template(array &$arr, int $ss_player_id)
|
||||||
|
{
|
||||||
|
$arr[$ss_player_id]['ss_player_id'] = 0;
|
||||||
|
$arr[$ss_player_id]['total_events'] = 0;
|
||||||
|
$arr[$ss_player_id]['total_min'] = 0;
|
||||||
|
$arr[$ss_player_id]['average_min'] = 0;
|
||||||
|
$arr[$ss_player_id]['events_played_home'] = 0;
|
||||||
|
$arr[$ss_player_id]['events_played_away'] = 0;
|
||||||
|
$arr[$ss_player_id]['minutes_played_home'] = 0;
|
||||||
|
$arr[$ss_player_id]['minutes_played_away'] = 0;
|
||||||
|
$arr[$ss_player_id]['goals'] = 0;
|
||||||
|
$arr[$ss_player_id]['fouls'] = 0;
|
||||||
|
$arr[$ss_player_id]['offsides'] = 0;
|
||||||
|
$arr[$ss_player_id]['shots_on_target'] = 0;
|
||||||
|
$arr[$ss_player_id]['shots_off_target'] = 0;
|
||||||
|
$arr[$ss_player_id]['shots_blocked'] = 0;
|
||||||
|
$arr[$ss_player_id]['total_shots'] = 0;
|
||||||
|
$arr[$ss_player_id]['was_fouled'] = 0;
|
||||||
|
$arr[$ss_player_id]['cards'] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -33,17 +33,23 @@ class PlayerPropsTable extends TableWidget
|
|||||||
{
|
{
|
||||||
|
|
||||||
return new HtmlString('
|
return new HtmlString('
|
||||||
<div class="w-full grid grid-cols-15 text-[10px] items-center gap-1" style="position: relative; left: -10px; bottom: -13px;">
|
<div class="w-full grid grid-cols-18 text-xs items-center gap-1">
|
||||||
<div>Gls</div>
|
<div class="text-green-600 dark:text-green-500">Gls</div>
|
||||||
<div>Fls</div>
|
<div>Fls</div>
|
||||||
<div>Ofs</div>
|
<div class="text-green-600 dark:text-green-500">Ofs</div>
|
||||||
<div>Crd</div>
|
<div>Crd</div>
|
||||||
<div>Snt</div>
|
<div class="text-green-600 dark:text-green-500">Snt</div>
|
||||||
<div>Tsh</div>
|
<div>Tsh</div>
|
||||||
<div>Foot</div>
|
<div class="text-green-600 dark:text-green-500">Wfl</div>
|
||||||
|
<div class="text-blue-600 dark:text-blue-500">Foot</div>
|
||||||
<div>Evt</div>
|
<div>Evt</div>
|
||||||
<div>Min</div>
|
<div>Min</div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
</div>');
|
</div>');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +63,7 @@ class PlayerPropsTable extends TableWidget
|
|||||||
->emptyStateHeading('No team selected')
|
->emptyStateHeading('No team selected')
|
||||||
->columns([
|
->columns([
|
||||||
ViewColumn::make('drag_card')
|
ViewColumn::make('drag_card')
|
||||||
->label(fn() => $this->getHeadingTable())
|
->label(fn () => $this->getHeadingTable())
|
||||||
->view('filament.tables.columns.drag-card'),
|
->view('filament.tables.columns.drag-card'),
|
||||||
])->extraAttributes([
|
])->extraAttributes([
|
||||||
'id' => 'playerdragtable',
|
'id' => 'playerdragtable',
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ class LoadGridPositions
|
|||||||
$arr[] = 'DM';
|
$arr[] = 'DM';
|
||||||
$arr[] = 0;
|
$arr[] = 0;
|
||||||
|
|
||||||
$arr[] = 'MR';
|
|
||||||
$arr[] = 'MC';
|
|
||||||
$arr[] = 'MC';
|
|
||||||
$arr[] = 'MC';
|
|
||||||
$arr[] = 'ML';
|
$arr[] = 'ML';
|
||||||
|
$arr[] = 'MC';
|
||||||
|
$arr[] = 'MC';
|
||||||
|
$arr[] = 'MC';
|
||||||
|
$arr[] = 'MR';
|
||||||
|
|
||||||
$arr[] = 0;
|
$arr[] = 0;
|
||||||
$arr[] = 'AM';
|
$arr[] = 'AM';
|
||||||
|
|||||||
@@ -1,95 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Livewire;
|
|
||||||
|
|
||||||
use App\Filament\Pages\Selections\LoadPositions;
|
|
||||||
use App\Models\SofaScorePlayerPerSeason;
|
|
||||||
use Livewire\Component;
|
|
||||||
|
|
||||||
class PlayerCalculator extends Component
|
|
||||||
{
|
|
||||||
public static function load(int $team_id)
|
|
||||||
{
|
|
||||||
$positions_map = LoadPositions::load();
|
|
||||||
|
|
||||||
$player = SofaScorePlayerPerSeason::with('details')->where('season', '=', 'total')->where('ss_team_id', '=', $team_id)->get();
|
|
||||||
|
|
||||||
$result = [];
|
|
||||||
foreach ($player as $val) {
|
|
||||||
if ($val->details != null && $val->details->is_active) {
|
|
||||||
|
|
||||||
$tmp = [];
|
|
||||||
$tmp['id'] = $val->ss_player_id;
|
|
||||||
if (! isset($val->details)) {
|
|
||||||
$tmp['name'] = $val->ss_player_id;
|
|
||||||
$tmp['pos_ori'] = 'GK';
|
|
||||||
$tmp['foot'] = 'Both';
|
|
||||||
} else {
|
|
||||||
$tmp['name'] = $val->details->player_name;
|
|
||||||
$tmp['pos_ori'] = $val->details->position;
|
|
||||||
$tmp['foot'] = $val->details->preferred_foot;
|
|
||||||
}
|
|
||||||
$tmp['pos'] = '';
|
|
||||||
$tmp['active'] = 0;
|
|
||||||
$tmp['tot_evt'] = $val->total_events;
|
|
||||||
$tmp['tot_min'] = $val->total_min;
|
|
||||||
$tmp['ave_min'] = $val->average_min;
|
|
||||||
$tmp['gls'] = $val->goals;
|
|
||||||
$tmp['fls'] = $val->fouls;
|
|
||||||
$tmp['ofs'] = $val->offsides;
|
|
||||||
$tmp['crd'] = $val->cards;
|
|
||||||
$tmp['snt'] = $val->shots_on_target;
|
|
||||||
$tmp['tsh'] = $val->shots_off_target;
|
|
||||||
|
|
||||||
$level = round($val->total_events / 3);
|
|
||||||
if ($val->total_events) {
|
|
||||||
if ($level > 1 && $val->total_events < $level) {
|
|
||||||
$tmp['color_evt'] = 'danger';
|
|
||||||
} elseif ($val->total_events < $level * 2) {
|
|
||||||
$tmp['color_evt'] = 'info';
|
|
||||||
} else {
|
|
||||||
$tmp['color_evt'] = 'success';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! isset($val->details)) {
|
|
||||||
$tmp['area'] = 'goalkeeper';
|
|
||||||
$tmp['color_pos'] = 'gray';
|
|
||||||
$tmp['order'] = 5;
|
|
||||||
} else {
|
|
||||||
if (in_array($val->details->position, $positions_map['MIDFIELD'])) {
|
|
||||||
$tmp['area'] = 'midfield';
|
|
||||||
$tmp['color_pos'] = 'info';
|
|
||||||
$tmp['order'] = 2;
|
|
||||||
} elseif (in_array($val->details->position, $positions_map['DEFENCE'])) {
|
|
||||||
$tmp['area'] = 'defence';
|
|
||||||
$tmp['color_pos'] = 'success';
|
|
||||||
$tmp['order'] = 1;
|
|
||||||
} elseif (in_array($val->details->position, $positions_map['ATTACK'])) {
|
|
||||||
$tmp['area'] = 'attack';
|
|
||||||
$tmp['color_pos'] = 'warning';
|
|
||||||
$tmp['order'] = 3;
|
|
||||||
} elseif (in_array($val->details->position, $positions_map['GOALKEEPER'])) {
|
|
||||||
$tmp['area'] = 'goalkeeper';
|
|
||||||
$tmp['color_pos'] = 'gray';
|
|
||||||
$tmp['order'] = 4;
|
|
||||||
} else {
|
|
||||||
$tmp['area'] = 'defence';
|
|
||||||
$tmp['color_pos'] = 'success';
|
|
||||||
$tmp['order'] = 5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$result[] = $tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// dd($result);
|
|
||||||
|
|
||||||
// $pos = array_column($result, 'pos');
|
|
||||||
// $area = array_column($result, 'area');
|
|
||||||
// array_multisort($area, SORT_ASC, $pos, SORT_ASC, $result);
|
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,7 +13,9 @@ class SimpleMail extends Mailable
|
|||||||
use Queueable, SerializesModels;
|
use Queueable, SerializesModels;
|
||||||
|
|
||||||
// Optionale Daten, die an das Blade-Template übergeben werden
|
// Optionale Daten, die an das Blade-Template übergeben werden
|
||||||
|
// this is a test
|
||||||
public string $title;
|
public string $title;
|
||||||
|
|
||||||
public string $body;
|
public string $body;
|
||||||
|
|
||||||
public function __construct(string $title, string $body)
|
public function __construct(string $title, string $body)
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
|
|
||||||
class SofaScoreDayTournament extends Model
|
class SofaScoreDayTournament extends Model
|
||||||
{
|
{
|
||||||
|
protected $connection = 'mariadb';
|
||||||
|
|
||||||
|
protected $table = 'sofa_score_day_tournaments';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'id',
|
'id',
|
||||||
'tournament_id',
|
'tournament_id',
|
||||||
|
|||||||
Loaded 100 of 160 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user