PreMemberCart.php 742 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\common\modules\memberCart;
  3. use app\common\models\MemberCart;
  4. class PreMemberCart extends MemberCart
  5. {
  6. public function getUniacidAttribute()
  7. {
  8. if (!$this->attributes['uniacid']) {
  9. $this->attributes['uniacid'] = \YunShop::app()->uniacid;
  10. }
  11. return $this->attributes['uniacid'];
  12. }
  13. public function getOptionIdAttribute()
  14. {
  15. if (!$this->attributes['option']) {
  16. $this->attributes['option'] = 0;
  17. }
  18. return $this->attributes['option'];
  19. }
  20. public function getTotalAttribute()
  21. {
  22. if (!$this->attributes['total']) {
  23. $this->attributes['total'] = 1;
  24. }
  25. return $this->attributes['total'];
  26. }
  27. }