Manage.php 1.2 KB

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