update total service

This commit is contained in:
Edward Yang 2022-07-27 14:57:14 +08:00
parent a7a8c5c844
commit 72ff8f34bb
4 changed files with 41 additions and 4 deletions

View File

@ -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;
}
}

View File

@ -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()
{
}
}

View File

@ -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()
{
}
}

View File

@ -0,0 +1,21 @@
<?php
/**
* TaxService.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @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()
{
}
}