Browse Source

商品购物车数量

master
weigang 5 years ago
parent
commit
ede12992c8
  1. 3
      app/Model/v3/Goods.php
  2. 3
      app/Model/v3/GoodsActivity.php

3
app/Model/v3/Goods.php

@ -100,7 +100,8 @@ class Goods extends Model
public function getCartNumAttribute()
{
return 0;
$userId = $this->request->user->id ?? 0;
return $userId ? (integer)$this->shopCartService->check($userId, $this->id,1) : 0;
}
public function getIsEffectiveAttribute()

3
app/Model/v3/GoodsActivity.php

@ -68,7 +68,8 @@ class GoodsActivity extends Model
public function getCartNumAttribute()
{
return 0;
$userId = $this->request->user->id ?? 0;
return $userId ? (integer)$this->shopCartService->check($userId, $this->id,1) : 0;
}
public function getIsEffectiveAttribute()

Loading…
Cancel
Save