PreOrderCoinExchange.php 651 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\frontend\models\order;
  3. use app\common\models\order\OrderCoinExchange;
  4. class PreOrderCoinExchange extends OrderCoinExchange
  5. {
  6. public function __construct(array $attributes = [])
  7. {
  8. parent::__construct($attributes);
  9. $this->appends = array_merge(['show_style'],$this->appends);
  10. }
  11. /**
  12. * 前端显示样式:1左右布局(积分全额抵扣 xxx),0文字叙述(例:177.00积分a全额 抵扣66.02元)
  13. * @return int
  14. */
  15. public function getShowStyleAttribute()
  16. {
  17. if (in_array($this->code,['point'])) {
  18. return 1;
  19. }
  20. return 0;
  21. }
  22. }