Sitemap.php 755 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2021 勾股工作室
  4. * @license https://opensource.org/licenses/Apache-2.0
  5. * @link https://www.gougucms.com
  6. */
  7. namespace app\admin\model;
  8. use think\Model;
  9. class Sitemap extends Model
  10. {
  11. protected $append = ['pc_img_url', 'mobile_img_url'];
  12. protected $resultSetType = 'collection';
  13. /**
  14. * 获取pc图片链接
  15. * @param string $pc_img_url 转换pc图片链接
  16. */
  17. public function getPcImgUrlAttr($value, $data)
  18. {
  19. return get_file($data['pc_img']);
  20. }
  21. /**
  22. * 获mobile图片链接
  23. * @param string mobile_img_url 转mobile图片链接
  24. */
  25. public function getMobileImgUrlAttr($value, $data)
  26. {
  27. return get_file($data['mobile_img']);
  28. }
  29. }