Remixicon.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\admin\controller\base\other;
  3. /**
  4. * @title:vue-admin-beautiful使用的图标
  5. * @Description:
  6. * @Author: goldenrock 112049337@qq.com
  7. * @Date: 2024-08-24 09:40:45
  8. * @LastEditTime: 2024-09-23 15:30:48
  9. * @LastEditors: goldenrock 112049337@qq.com
  10. * @FilePath: \OA_hbdrwhe:\HBDRWHCODE\DRSERVER_dev\app\admin\controller\base\other\Remixicon.php
  11. */
  12. use app\admin\controller\Base;
  13. use app\common\model\base\other\Remixicon as remixiconModel;
  14. class Remixicon extends Base
  15. {
  16. protected $remixiconModel = null;
  17. protected $noNeedAuth = ['getList'];
  18. public function initialize()
  19. {
  20. parent::initialize();
  21. $this->remixiconModel = new remixiconModel;
  22. }
  23. /**
  24. * @title: 图标列表
  25. * @param {int} {pageNo} {非必填,默认值为1} {页码}
  26. * @param {int} {pageSize} {非必填,默认值为10} {每页数量}
  27. * @param {string} {title} {非必填} {名称字段搜索}
  28. * @return array
  29. * @Author: wangkewei
  30. * @Date: 2021/5/18 9:33
  31. */
  32. public function getList()
  33. {
  34. $data = $this->request->param();
  35. $pageNo = $data['pageNo']??1;
  36. $pageSize = $data['pageSize']??20;
  37. $title = $data['title'];
  38. $where = [];
  39. if(!empty($title)){
  40. $where[] = ['icon','LIKE',"%$title%"];
  41. }
  42. $list = $this->remixiconModel->where($where)->cache(86400)->paginate(['page'=>$pageNo,'list_rows'=>$pageSize]);
  43. $list = FieldConverList($list);
  44. $data = array_column($list['data'],'icon');
  45. return pageRes(1,"获取成功",$list['total'],$data);
  46. }
  47. }