AdSortModel.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Laravel框架 [ Laravel ]
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2017~2021 Laravel研发中心
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://www.laravel.cn
  8. // +----------------------------------------------------------------------
  9. // | Author: wesmiler <12345678@qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace App\Models;
  12. /**
  13. * 广告位管理-模型
  14. * @author wesmiler
  15. * @since 2020/11/11
  16. * Class AdSortModel
  17. * @package App\Models
  18. */
  19. class AdSortModel extends BaseModel
  20. {
  21. // 设置数据表
  22. protected $table = 'ad_sort';
  23. public function getInfo($id)
  24. {
  25. $info = parent::getInfo($id); // TODO: Change the autogenerated stub
  26. if ($info) {
  27. // 获取栏目名称
  28. if ($info['cate_id']) {
  29. $itemCateModel = new ItemCateModel();
  30. $itemCateName = $itemCateModel->getCateName($info['cate_id'], ">>");
  31. $info['item_cate_name'] = $itemCateName;
  32. }
  33. }
  34. return $info;
  35. }
  36. }