first commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\common\service\pharmacy;
|
||||
|
||||
final class PharmacySupplyMode
|
||||
{
|
||||
/** @param array<string,mixed> $order */
|
||||
public static function resolve(array $order): string
|
||||
{
|
||||
if (strtolower(trim((string) ($order['ship_mode'] ?? ''))) === 'direct') {
|
||||
return 'direct';
|
||||
}
|
||||
if (trim((string) ($order['gancao_reciperl_order_no'] ?? '')) !== '') {
|
||||
return 'gancao';
|
||||
}
|
||||
|
||||
return 'self';
|
||||
}
|
||||
|
||||
public static function label(string $mode): string
|
||||
{
|
||||
return match (strtolower(trim($mode))) {
|
||||
'direct' => '洛阳直发',
|
||||
'gancao' => '甘草',
|
||||
default => '自营',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user