diff --git a/beike/Shop/Services/TotalService.php b/beike/Shop/Services/TotalService.php index adaefe72..c6501b92 100644 --- a/beike/Shop/Services/TotalService.php +++ b/beike/Shop/Services/TotalService.php @@ -11,10 +11,14 @@ namespace Beike\Shop\Services; +use \Beike\Shop\Services\TotalServices; +use Illuminate\Support\Str; + class TotalService { const TOTAL_CODES = [ 'subtotal', + 'tax', 'shipping', 'total' ]; @@ -26,11 +30,11 @@ class TotalService { $totals = []; foreach (self::TOTAL_CODES as $code) { - $totals[] = 11; + $serviceName = Str::studly($code); + $service = "TotalServices\{$serviceName}"; + $totals[] = $service::getTotal(); } - // hook= [subtotal, shipping] - - return []; + return $totals; } } diff --git a/beike/Shop/Services/TotalServices/ShippingService.php b/beike/Shop/Services/TotalServices/ShippingService.php index 97571689..6945b240 100644 --- a/beike/Shop/Services/TotalServices/ShippingService.php +++ b/beike/Shop/Services/TotalServices/ShippingService.php @@ -9,7 +9,13 @@ * @created 2022-07-22 17:58:14 * @modified 2022-07-22 17:58:14 */ + +namespace Beike\Shop\Services\TotalServices; + class ShippingService { + public static function getTotal() + { + } } diff --git a/beike/Shop/Services/TotalServices/SubtotalService.php b/beike/Shop/Services/TotalServices/SubtotalService.php index d85b604f..bfa36841 100644 --- a/beike/Shop/Services/TotalServices/SubtotalService.php +++ b/beike/Shop/Services/TotalServices/SubtotalService.php @@ -9,7 +9,13 @@ * @created 2022-07-22 17:58:25 * @modified 2022-07-22 17:58:25 */ + +namespace Beike\Shop\Services\TotalServices; + class SubtotalService { + public static function getTotal() + { + } } diff --git a/beike/Shop/Services/TotalServices/TaxService.php b/beike/Shop/Services/TotalServices/TaxService.php new file mode 100644 index 00000000..b8e1e9f6 --- /dev/null +++ b/beike/Shop/Services/TotalServices/TaxService.php @@ -0,0 +1,21 @@ + + * @created 2022-07-27 14:24:05 + * @modified 2022-07-27 14:24:05 + */ + +namespace Beike\Shop\Services\TotalServices; + +class TaxService +{ + public static function getTotal() + { + + } +}