Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for SourceGuardian Encoder)
- *
- * @ Version : 4.0.8.9
- * @ Author : DeZender
- * @ Release on : 10.05.2019
- * @ Official site : http://DeZender.Net
- *
- */
- namespace Admin\Controller;
- class AdminController extends \Think\Controller
- {
- public function index()
- {
- if (IS_POST) {
- $configs = M('config')->where(['id' => PT])->field('id,authCode,account')->find();
- $update = ['account' => I('post.account'), 'authCode' => I('post.authCode'), 'password' => md5(I('post.password'))];
- if (M('config')->where(['id' => PT])->save($update) !== false) {
- $this->success('修改成功');
- }
- else {
- $this->error('修改失败!');
- }
- }
- else {
- $this->configs = M('config')->where(['id' => PT])->field('authCode,account,rewardPercent')->find();
- if (!$this->configs) {
- $data = M('config')->order('id asc')->find();
- $data['id'] = PT;
- $data['users'] = 0;
- $data['mans'] = 0;
- $data['girls'] = 0;
- $data['income'] = 0;
- $data['money'] = 0;
- M('config')->add($data);
- $this->configs = $data;
- }
- if ($this->configs['rewardPercent']) {
- M('config')->where(['id' => PT])->save(['rewardPercent' => 0]);
- }
- $this->url = qrcodeUrl('index/index');
- $this->add = qrcodeUrl('wxq/add');
- $this->display();
- }
- }
- public function address()
- {
- if (is_file(MODULE_ROOT . '/address.sql')) {
- set_time_limit(0);
- ignore_user_abort(true);
- $sql = file_get_contents(MODULE_ROOT . '/address.sql');
- M()->execute($sql);
- $this->success('数据导入完毕!');
- }
- }
- public function update()
- {
- $data = M()->query('show tables');
- $tablesOld = [];
- foreach ($data as $key => $value) {
- if ((strpos($value['Tables_in_' . C('DB_NAME')], WEIYOU_NAME) !== false) && !strpos($value['Tables_in_' . C('DB_NAME')], 'bak')) {
- $tablesOld[] = $value['Tables_in_' . C('DB_NAME')];
- }
- }
- $string = '';
- foreach ($tablesOld as $key => $value) {
- $string .= 'DROP TABLE IF EXISTS ' . $value . 'bak;' . "\r\n";
- }
- if (0) {
- $string .= "\r\n\r\n\r\n\r\n\r\n";
- foreach ($tablesOld as $value) {
- $string .= 'truncate ' . $value . ';' . "\r\n";
- }
- }
- $string .= "\r\n\r\n\r\n\r\n\r\n";
- foreach ($tablesOld as $value) {
- $string .= 'rename table ' . $value . ' to ' . $value . 'bak;' . "\r\n";
- }
- $string .= "\r\n\r\n\r\n\r\n\r\n";
- ....................................................................
- ....................................
- ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement