GroupDataService.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2018/01/15
  6. */
  7. namespace crmeb\services;
  8. use app\admin\model\system\SystemGroupData;
  9. use think\facade\Cache;
  10. class GroupDataService
  11. {
  12. /**
  13. * 获取单个组数据
  14. *
  15. * @param $config_name
  16. * @param int $limit
  17. * @return array|bool|\think\Model|null
  18. * @throws \think\db\exception\DataNotFoundException
  19. * @throws \think\db\exception\ModelNotFoundException
  20. * @throws \think\exception\DbException
  21. */
  22. public static function getGroupData($config_name, $limit = 0)
  23. {
  24. return SystemGroupData::getGroupData($config_name, $limit);
  25. }
  26. /**
  27. * 获取单个值
  28. *
  29. * @param $config_name
  30. * @param int $limit
  31. * @return array
  32. * @throws \think\db\exception\DataNotFoundException
  33. * @throws \think\db\exception\ModelNotFoundException
  34. * @throws \think\exception\DbException
  35. */
  36. public static function getData($config_name, $limit = 0)
  37. {
  38. return SystemGroupData::getAllValue($config_name, $limit);
  39. }
  40. /**
  41. * 获取单个值 根据id
  42. *
  43. * @param $id
  44. * @param string $cacheA
  45. * @return mixed
  46. * @throws \think\db\exception\DataNotFoundException
  47. * @throws \think\db\exception\ModelNotFoundException
  48. * @throws \think\exception\DbException
  49. */
  50. public static function getDataNumber($id)
  51. {
  52. return SystemGroupData::getDateValue($id);
  53. }
  54. }