Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for SourceGuardian Encoder)
  6. *
  7. * @ Version : 4.0.8.9
  8. * @ Author : DeZender
  9. * @ Release on : 10.05.2019
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace Admin\Controller;
  15.  
  16. class AdminController extends \Think\Controller
  17. {
  18. public function index()
  19. {
  20. if (IS_POST) {
  21. $configs = M('config')->where(['id' => PT])->field('id,authCode,account')->find();
  22. $update = ['account' => I('post.account'), 'authCode' => I('post.authCode'), 'password' => md5(I('post.password'))];
  23.  
  24. if (M('config')->where(['id' => PT])->save($update) !== false) {
  25. $this->success('修改成功');
  26. }
  27. else {
  28. $this->error('修改失败!');
  29. }
  30. }
  31. else {
  32. $this->configs = M('config')->where(['id' => PT])->field('authCode,account,rewardPercent')->find();
  33.  
  34. if (!$this->configs) {
  35. $data = M('config')->order('id asc')->find();
  36. $data['id'] = PT;
  37. $data['users'] = 0;
  38. $data['mans'] = 0;
  39. $data['girls'] = 0;
  40. $data['income'] = 0;
  41. $data['money'] = 0;
  42. M('config')->add($data);
  43. $this->configs = $data;
  44. }
  45.  
  46. if ($this->configs['rewardPercent']) {
  47. M('config')->where(['id' => PT])->save(['rewardPercent' => 0]);
  48. }
  49.  
  50. $this->url = qrcodeUrl('index/index');
  51. $this->add = qrcodeUrl('wxq/add');
  52. $this->display();
  53. }
  54. }
  55.  
  56. public function address()
  57. {
  58. if (is_file(MODULE_ROOT . '/address.sql')) {
  59. set_time_limit(0);
  60. ignore_user_abort(true);
  61. $sql = file_get_contents(MODULE_ROOT . '/address.sql');
  62. M()->execute($sql);
  63. $this->success('数据导入完毕!');
  64. }
  65. }
  66.  
  67. public function update()
  68. {
  69. $data = M()->query('show tables');
  70. $tablesOld = [];
  71.  
  72. foreach ($data as $key => $value) {
  73. if ((strpos($value['Tables_in_' . C('DB_NAME')], WEIYOU_NAME) !== false) && !strpos($value['Tables_in_' . C('DB_NAME')], 'bak')) {
  74. $tablesOld[] = $value['Tables_in_' . C('DB_NAME')];
  75. }
  76. }
  77.  
  78. $string = '';
  79.  
  80. foreach ($tablesOld as $key => $value) {
  81. $string .= 'DROP TABLE IF EXISTS ' . $value . 'bak;' . "\r\n";
  82. }
  83.  
  84. if (0) {
  85. $string .= "\r\n\r\n\r\n\r\n\r\n";
  86.  
  87. foreach ($tablesOld as $value) {
  88. $string .= 'truncate ' . $value . ';' . "\r\n";
  89. }
  90. }
  91.  
  92. $string .= "\r\n\r\n\r\n\r\n\r\n";
  93.  
  94. foreach ($tablesOld as $value) {
  95. $string .= 'rename table ' . $value . ' to ' . $value . 'bak;' . "\r\n";
  96. }
  97.  
  98. $string .= "\r\n\r\n\r\n\r\n\r\n";
  99. ....................................................................
  100. ....................................
  101. ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement