Manage.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace Setting\Lib;
  3. use Dever;
  4. class Manage
  5. {
  6. public function role()
  7. {
  8. $data = Dever::db('setting/role')->state();
  9. if ($data) {
  10. foreach ($data as $k => $v) {
  11. if ($v['isbuy'] == 2 && $v['id'] > 1) {
  12. $data[$k]['name'] .= '(已关停)';
  13. } else {
  14. $data[$k]['name'] = $v['name'];
  15. }
  16. }
  17. }
  18. return $data;
  19. }
  20. public function getAgreementData()
  21. {
  22. $data = Dever::db('setting/agreement')->select();
  23. if ($data) {
  24. $config = Dever::db('setting/agreement')->config['config_type'];
  25. foreach ($data as $k => $v) {
  26. $data[$k]['name'] = $config[$v['type']];
  27. }
  28. }
  29. return $data;
  30. }
  31. public function showSource($id)
  32. {
  33. $url = 'http://daili.churenyiliao.com/pages/dailishang/apply/apply/';
  34. $url .= '?source_id=' . $id;
  35. $code = Dever::url('setting/lib/code.show?id=' . $id);
  36. $table['二维码'] = '<img src="'.$code.'" width="150"/>';
  37. $table['链接'] = $url;
  38. return Dever::table($table);
  39. }
  40. public function showReward($id)
  41. {
  42. $info = Dever::db('setting/role_reward')->one($id);
  43. if ($info) {
  44. $role = Dever::db('setting/role')->one($info['role_id']);
  45. $t_role = Dever::db('setting/role')->one($info['t_role_id']);
  46. return $role['name'] . ' 邀请 ' . $t_role['name'];
  47. }
  48. return '';
  49. }
  50. }