Browse Source

FIxe

master
weigang 5 years ago
parent
commit
e9a92d5a09
  1. 14
      app/Controller/v3/ShopCartController.php
  2. 4
      app/Service/v3/Implementations/GoodsActivityService.php
  3. 4
      app/Service/v3/Implementations/GoodsService.php

14
app/Controller/v3/ShopCartController.php

@ -20,13 +20,13 @@ class ShopCartController extends BaseController
return $this->success($this->shopCartService->allForUser($userId, $marketId));
//获取购物车商品信息
$res['store_lists'] = $this->shopCartService->do($userId,$marketId);
//获取购物车失效商品信息
$res['store_lists_invalid'] = $this->shopCartService->undo($userId,$marketId);
//计算购物车价格
$res['total'] = $this->shopCartService->getTotal($userId,$marketId);
return $this->success($res);
// //获取购物车商品信息
// $res['store_lists'] = $this->shopCartService->do($userId,$marketId);
// //获取购物车失效商品信息
// $res['store_lists_invalid'] = $this->shopCartService->undo($userId,$marketId);
// //计算购物车价格
// $res['total'] = $this->shopCartService->getTotal($userId,$marketId);
// return $this->success($res);
}
public function info()

4
app/Service/v3/Implementations/GoodsActivityService.php

@ -23,6 +23,10 @@ class GoodsActivityService implements GoodsActivityServiceInterface
public function check(GoodsActivity $goods, $num, $userId)
{
if (empty($goods)) {
return ErrorCode::GOODS_ACTIVITY_ON_SALE_NO;
}
// 活动是否已经结束
if ($goods->expire_time < time()) {
return ErrorCode::GOODS_ACTIVITY_EXPIRED;

4
app/Service/v3/Implementations/GoodsService.php

@ -20,6 +20,10 @@ class GoodsService implements GoodsServiceInterface
public function check(Goods $goods,$num = 1)
{
if (empty($goods)) {
return ErrorCode::GOODS_ON_SALE_NO;
}
// 商户歇业
if($goods->store->is_rest == 1){
return ErrorCode::GOODS_ON_SALE_NO;

Loading…
Cancel
Save