AdModel.php 524 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * 广告模型.
  4. * @author ningque
  5. * @date 2020-02-21 17:56:26
  6. */
  7. declare (strict_types=1);
  8. namespace App\Model;
  9. use Hyperf\Database\Model\SoftDeletes;
  10. class AdModel extends BaseModel
  11. {
  12. use SoftDeletes;
  13. protected $table = 'ad';
  14. /**
  15. * 统一处理0x0的情况.
  16. * @param $value
  17. * @return string
  18. */
  19. public function getResolutionAttribute($value)
  20. {
  21. if ($value == '0x0') {
  22. return '1x1';
  23. } else {
  24. return $value;
  25. }
  26. }
  27. }