diff --git a/app/Controller/v3/HomeController.php b/app/Controller/v3/HomeController.php index 5a0bc2f..8811f33 100644 --- a/app/Controller/v3/HomeController.php +++ b/app/Controller/v3/HomeController.php @@ -173,4 +173,30 @@ class HomeController extends BaseController return $this->success($data); } + + /** + * 关于懒族 + * about lanzu + */ + public function aboutLanzu() + { + $data = [ + [ + 'id' => 1, + 'title' => '关于懒族', + 'sub_title' => '懒族生活678', + 'path' => 'https://www.baidu.com/s?wd=%E6%87%92%E6%97%8F%E7%94%9F%E6%B4%BB', + 'path_type' => 'webview' + ], + [ + 'id' => 1, + 'title' => '隐私政策', + 'sub_title' => '隐私政策123', + 'path' => 'https://www.baidu.com/s?wd=%E9%9A%90%E7%A7%81%E6%94%BF%E7%AD%96', + 'path_type' => 'webview' + ] + ]; + + return $this->success(['data' => $data]); + } } \ No newline at end of file diff --git a/app/Service/v3/Implementations/OrderOnlineService.php b/app/Service/v3/Implementations/OrderOnlineService.php index 3bcca12..b6be44c 100644 --- a/app/Service/v3/Implementations/OrderOnlineService.php +++ b/app/Service/v3/Implementations/OrderOnlineService.php @@ -28,6 +28,7 @@ use App\Service\v3\Interfaces\DeliveryMoneyServiceInterface; use App\Service\v3\Interfaces\GoodsActivityServiceInterface; use App\Service\v3\Interfaces\GoodsServiceInterface; use App\Service\v3\Interfaces\PaymentServiceInterface; +use App\Service\v3\Interfaces\ShopCartUpdateServiceInterface; use App\TaskWorker\SSDBTask; use Exception; use Hyperf\Database\Model\Model; @@ -82,6 +83,12 @@ class OrderOnlineService implements OrderOnlineServiceInterface */ protected $paymentService; + /** + * @Inject + * @var ShopCartUpdateServiceInterface + */ + protected $shopCartUpdateService; + /** * 下单 * @param $marketId @@ -320,6 +327,9 @@ class OrderOnlineService implements OrderOnlineServiceInterface Db::commit(); + // 清除购物车 + $this->shopCartUpdateService->doClear($userId, $marketId); + // 支付 return $this->paymentService->do($globalOrderId, $totalAmount, $userId, config('wechat.notify_url.online')); } catch (Exception $e) { diff --git a/app/Service/v3/Implementations/ShopCartUpdateService.php b/app/Service/v3/Implementations/ShopCartUpdateService.php index 7ce4e95..c032150 100644 --- a/app/Service/v3/Implementations/ShopCartUpdateService.php +++ b/app/Service/v3/Implementations/ShopCartUpdateService.php @@ -46,4 +46,14 @@ class ShopCartUpdateService implements ShopCartUpdateServiceInterface { return true; } + + /** + * 清空购物车 + * @param $userId + * @param $marketId + */ + public function doClear($userId, $marketId) + { + + } } \ No newline at end of file diff --git a/app/Service/v3/Interfaces/ShopCartUpdateServiceInterface.php b/app/Service/v3/Interfaces/ShopCartUpdateServiceInterface.php index dcd4893..0ee3195 100644 --- a/app/Service/v3/Interfaces/ShopCartUpdateServiceInterface.php +++ b/app/Service/v3/Interfaces/ShopCartUpdateServiceInterface.php @@ -9,4 +9,6 @@ interface ShopCartUpdateServiceInterface public function check(); public function undo($params); + + public function doClear($userId, $marketId); } \ No newline at end of file diff --git a/config/routes.php b/config/routes.php index f8babb9..152691b 100644 --- a/config/routes.php +++ b/config/routes.php @@ -92,6 +92,7 @@ Router::addGroup('/v3/', function () { Router::post('store/index', 'App\Controller\v3\StoreController@index'); Router::post('Search/market', 'App\Controller\v3\SearchController@market'); Router::post('market/services', 'App\Controller\v3\LocationController@getMarketsInfo'); + Router::post('home/aboutLanzu', 'App\Controller\v3\HomeController@aboutLanzu'); },['middleware' => [\App\Middleware\Auth\ApiMiddleware::class]]); // 需要登录的路由