作者 魏强

上传

1 -<?php  
2 -// +----------------------------------------------------------------------  
3 -// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]  
4 -// +----------------------------------------------------------------------  
5 -// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.  
6 -// +----------------------------------------------------------------------  
7 -// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )  
8 -// +----------------------------------------------------------------------  
9 -// | Author: 老猫 <thinkcmf@126.com>  
10 -// +----------------------------------------------------------------------  
11 -function sp_testwrite($d)  
12 -{  
13 - $tfile = "_test.txt";  
14 - $fp = @fopen($d . "/" . $tfile, "w");  
15 - if (!$fp) {  
16 - return false;  
17 - }  
18 - fclose($fp);  
19 - $rs = @unlink($d . "/" . $tfile);  
20 - if ($rs) {  
21 - return true;  
22 - }  
23 - return false;  
24 -}  
25 -  
26 -function sp_dir_create($path, $mode = 0777)  
27 -{  
28 - if (is_dir($path))  
29 - return true;  
30 - $ftp_enable = 0;  
31 - $path = sp_dir_path($path);  
32 - $temp = explode('/', $path);  
33 - $cur_dir = '';  
34 - $max = count($temp) - 1;  
35 - for ($i = 0; $i < $max; $i++) {  
36 - $cur_dir .= $temp[$i] . '/';  
37 - if (@is_dir($cur_dir))  
38 - continue;  
39 - @mkdir($cur_dir, 0777, true);  
40 - @chmod($cur_dir, 0777);  
41 - }  
42 - return is_dir($path);  
43 -}  
44 -  
45 -function sp_dir_path($path)  
46 -{  
47 - $path = str_replace('\\', '/', $path);  
48 - if (substr($path, -1) != '/')  
49 - $path = $path . '/';  
50 - return $path;  
51 -}  
52 -  
53 -function sp_execute_sql($db, $sql)  
54 -{  
55 - $sql = trim($sql);  
56 - preg_match('/CREATE TABLE .+ `([^ ]*)`/', $sql, $matches);  
57 - if ($matches) {  
58 - $table_name = $matches[1];  
59 - $msg = "创建数据表{$table_name}";  
60 - try {  
61 - $db->execute($sql);  
62 - return [  
63 - 'error' => 0,  
64 - 'message' => $msg . ' 成功!'  
65 - ];  
66 - } catch (\Exception $e) {  
67 - return [  
68 - 'error' => 1,  
69 - 'message' => $msg . ' 失败!',  
70 - 'exception' => $e->getTraceAsString()  
71 - ];  
72 - }  
73 -  
74 - } else {  
75 - try {  
76 - $db->execute($sql);  
77 - return [  
78 - 'error' => 0,  
79 - 'message' => 'SQL执行成功!'  
80 - ];  
81 - } catch (\Exception $e) {  
82 - return [  
83 - 'error' => 1,  
84 - 'message' => 'SQL执行失败!',  
85 - 'exception' => $e->getTraceAsString()  
86 - ];  
87 - }  
88 - }  
89 -}  
90 -  
91 -/**  
92 - * 显示提示信息  
93 - * @param string $msg 提示信息  
94 - */  
95 -function sp_show_msg($msg, $class = '')  
96 -{  
97 - echo "<script type=\"text/javascript\">showmsg(\"{$msg}\", \"{$class}\")</script>";  
98 - flush();  
99 - ob_flush();  
100 -}  
101 -  
102 -function sp_update_site_configs($db, $table_prefix)  
103 -{  
104 - $sitename = I("post.sitename");  
105 - $email = I("post.manager_email");  
106 - $siteurl = I("post.siteurl");  
107 - $seo_keywords = I("post.sitekeywords");  
108 - $seo_description = I("post.siteinfo");  
109 - $site_options = <<<helllo  
110 - {  
111 - "site_name":"$sitename",  
112 - "site_host":"$siteurl",  
113 - "site_root":"",  
114 - "site_icp":"",  
115 - "site_admin_email":"$email",  
116 - "site_tongji":"",  
117 - "site_copyright":"",  
118 - "site_seo_title":"$sitename",  
119 - "site_seo_keywords":"$seo_keywords",  
120 - "site_seo_description":"$seo_description"  
121 - }  
122 -helllo;  
123 - $sql = "INSERT INTO `{$table_prefix}options` (option_value,option_name) VALUES ('$site_options','site_options')";  
124 - $db->execute($sql);  
125 - sp_show_msg("网站信息配置成功!");  
126 -}  
127 -  
128 -function sp_create_admin_account($db, $table_prefix, $authcode)  
129 -{  
130 - $username = I("post.manager");  
131 - $password = sp_password(I("post.manager_pwd"), $authcode);  
132 - $email = I("post.manager_email");  
133 - $create_date = date("Y-m-d h:i:s");  
134 - $ip = get_client_ip(0, true);  
135 - $sql = <<<hello  
136 - INSERT INTO `{$table_prefix}users`  
137 - (id,user_login,user_pass,user_nicename,user_email,user_url,create_time,user_activation_key,user_status,last_login_ip,last_login_time) VALUES  
138 - ('1', '{$username}', '{$password}', 'admin', '{$email}', '', '{$create_date}', '', '1', '{$ip}','{$create_date}');;  
139 -hello;  
140 - $db->execute($sql);  
141 - sp_show_msg("管理员账号创建成功!");  
142 -}  
143 -  
144 -  
145 -/**  
146 - * 写入配置文件  
147 - * @param array $config 配置信息  
148 - */  
149 -function sp_create_config($config, $authcode)  
150 -{  
151 - if (is_array($config)) {  
152 - //读取配置内容  
153 - $conf = file_get_contents(MODULE_PATH . 'Data/config.php');  
154 -  
155 - //替换配置项  
156 - foreach ($config as $key => $value) {  
157 - $conf = str_replace("#{$key}#", $value, $conf);  
158 - }  
159 -  
160 - $conf = str_replace('#AUTHCODE#', $authcode, $conf);  
161 - $conf = str_replace('#COOKIE_PREFIX#', sp_random_string(6) . "_", $conf);  
162 -  
163 - //写入应用配置文件  
164 - if (file_put_contents('data/conf/db.php', $conf)) {  
165 - sp_show_msg('配置文件写入成功');  
166 - } else {  
167 - sp_show_msg('配置文件写入失败!', 'error');  
168 - }  
169 - return '';  
170 -  
171 - }  
172 -}  
173 -  
174 -  
175 -function sp_create_db_config($config)  
176 -{  
177 - if (is_array($config)) {  
178 - //读取配置内容  
179 - $conf = file_get_contents(APP_PATH . 'install/data/config.php');  
180 -  
181 - //替换配置项  
182 - foreach ($config as $key => $value) {  
183 - $conf = str_replace("#{$key}#", $value, $conf);  
184 - }  
185 -  
186 - try {  
187 - $confDir = CMF_ROOT . 'data/conf/';  
188 - if (!file_exists($confDir)) {  
189 - mkdir($confDir, 0777, true);  
190 - }  
191 - file_put_contents(CMF_ROOT . 'data/conf/database.php', $conf);  
192 - } catch (\Exception $e) {  
193 -  
194 - return false;  
195 -  
196 - }  
197 -  
198 - return true;  
199 -  
200 - }  
201 -}  
1 -<?php  
2 -// +----------------------------------------------------------------------  
3 -// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]  
4 -// +----------------------------------------------------------------------  
5 -// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.  
6 -// +----------------------------------------------------------------------  
7 -// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )  
8 -// +----------------------------------------------------------------------  
9 -// | Author: 老猫 <thinkcmf@126.com>  
10 -// +----------------------------------------------------------------------  
11 -return [];  
12 -  
1 -<?php  
2 -// +----------------------------------------------------------------------  
3 -// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]  
4 -// +----------------------------------------------------------------------  
5 -// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.  
6 -// +----------------------------------------------------------------------  
7 -// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )  
8 -// +----------------------------------------------------------------------  
9 -// | Author: 老猫 <thinkcmf@126.com>  
10 -// +----------------------------------------------------------------------  
11 -namespace app\install\controller;  
12 -  
13 -use app\admin\model\ThemeModel;  
14 -use think\Controller;  
15 -use think\Db;  
16 -  
17 -class IndexController extends Controller  
18 -{  
19 -  
20 - public function _initialize()  
21 - {  
22 - if (cmf_is_installed()) {  
23 - $this->error('网站已经安装', cmf_get_root() . '/');  
24 - }  
25 - }  
26 -  
27 - // 安装首页  
28 - public function index()  
29 - {  
30 - return $this->fetch(":index");  
31 - }  
32 -  
33 - public function step2()  
34 - {  
35 -// if (file_exists_case('data/conf/config.php')) {  
36 -// @unlink('data/conf/config.php');  
37 -// }  
38 - $data = [];  
39 - $data['phpversion'] = @phpversion();  
40 - $data['os'] = PHP_OS;  
41 - $tmp = function_exists('gd_info') ? gd_info() : [];  
42 -// $server = $_SERVER["SERVER_SOFTWARE"];  
43 -// $host = $this->request->host();  
44 -// $name = $_SERVER["SERVER_NAME"];  
45 -// $max_execution_time = ini_get('max_execution_time');  
46 -// $allow_reference = (ini_get('allow_call_time_pass_reference') ? '<font color=green>[√]On</font>' : '<font color=red>[×]Off</font>');  
47 -// $allow_url_fopen = (ini_get('allow_url_fopen') ? '<font color=green>[√]On</font>' : '<font color=red>[×]Off</font>');  
48 -// $safe_mode = (ini_get('safe_mode') ? '<font color=red>[×]On</font>' : '<font color=green>[√]Off</font>');  
49 -  
50 - $err = 0;  
51 - if (empty($tmp['GD Version'])) {  
52 - $gd = '<font color=red>[×]Off</font>';  
53 - $err++;  
54 - } else {  
55 - $gd = '<font color=green>[√]On</font> ' . $tmp['GD Version'];  
56 - }  
57 -  
58 - if (class_exists('pdo')) {  
59 - $data['pdo'] = '<i class="fa fa-check correct"></i> 已开启';  
60 - } else {  
61 - $data['pdo'] = '<i class="fa fa-remove error"></i> 未开启';  
62 - $err++;  
63 - }  
64 -  
65 - if (extension_loaded('pdo_mysql')) {  
66 - $data['pdo_mysql'] = '<i class="fa fa-check correct"></i> 已开启';  
67 - } else {  
68 - $data['pdo_mysql'] = '<i class="fa fa-remove error"></i> 未开启';  
69 - $err++;  
70 - }  
71 -  
72 - if (extension_loaded('curl')) {  
73 - $data['curl'] = '<i class="fa fa-check correct"></i> 已开启';  
74 - } else {  
75 - $data['curl'] = '<i class="fa fa-remove error"></i> 未开启';  
76 - $err++;  
77 - }  
78 -  
79 - if (extension_loaded('gd')) {  
80 - $data['gd'] = '<i class="fa fa-check correct"></i> 已开启';  
81 - } else {  
82 - $data['gd'] = '<i class="fa fa-remove error"></i> 未开启';  
83 - if (function_exists('imagettftext')) {  
84 - $data['gd'] .= '<br><i class="fa fa-remove error"></i> FreeType Support未开启';  
85 - }  
86 - $err++;  
87 - }  
88 -  
89 - if (extension_loaded('mbstring')) {  
90 - $data['mbstring'] = '<i class="fa fa-check correct"></i> 已开启';  
91 - } else {  
92 - $data['mbstring'] = '<i class="fa fa-remove error"></i> 未开启';  
93 - if (function_exists('imagettftext')) {  
94 - $data['mbstring'] .= '<br><i class="fa fa-remove error"></i> FreeType Support未开启';  
95 - }  
96 - $err++;  
97 - }  
98 -  
99 - if (extension_loaded('fileinfo')) {  
100 - $data['fileinfo'] = '<i class="fa fa-check correct"></i> 已开启';  
101 - } else {  
102 - $data['fileinfo'] = '<i class="fa fa-remove error"></i> 未开启';  
103 - $err++;  
104 - }  
105 -  
106 - if (ini_get('file_uploads')) {  
107 - $data['upload_size'] = '<i class="fa fa-check correct"></i> ' . ini_get('upload_max_filesize');  
108 - } else {  
109 - $data['upload_size'] = '<i class="fa fa-remove error"></i> 禁止上传';  
110 - }  
111 -  
112 - if (function_exists('session_start')) {  
113 - $data['session'] = '<i class="fa fa-check correct"></i> 支持';  
114 - } else {  
115 - $data['session'] = '<i class="fa fa-remove error"></i> 不支持';  
116 - $err++;  
117 - }  
118 -  
119 - if (version_compare(phpversion(), '5.6.0', '>=') && version_compare(phpversion(), '7.0.0', '<') && ini_get('always_populate_raw_post_data') != -1) {  
120 - $data['always_populate_raw_post_data'] = '<i class="fa fa-remove error"></i> 未关闭';  
121 - $data['show_always_populate_raw_post_data_tip'] = true;  
122 - $err++;  
123 - } else {  
124 -  
125 - $data['always_populate_raw_post_data'] = '<i class="fa fa-check correct"></i> 已关闭';  
126 - }  
127 -  
128 - $folders = [  
129 - realpath(CMF_ROOT . 'data') . DS,  
130 - realpath('./upload') . DS,  
131 - ];  
132 - $newFolders = [];  
133 - foreach ($folders as $dir) {  
134 - $testDir = $dir;  
135 - sp_dir_create($testDir);  
136 - if (sp_testwrite($testDir)) {  
137 - $newFolders[$dir]['w'] = true;  
138 - } else {  
139 - $newFolders[$dir]['w'] = false;  
140 - $err++;  
141 - }  
142 - if (is_readable($testDir)) {  
143 - $newFolders[$dir]['r'] = true;  
144 - } else {  
145 - $newFolders[$dir]['r'] = false;  
146 - $err++;  
147 - }  
148 - }  
149 - $data['folders'] = $newFolders;  
150 -  
151 - $this->assign($data);  
152 - return $this->fetch(":step2");  
153 - }  
154 -  
155 - public function step3()  
156 - {  
157 - return $this->fetch(":step3");  
158 - }  
159 -  
160 - public function step4()  
161 - {  
162 - session(null);  
163 - if ($this->request->isPost()) {  
164 - //创建数据库  
165 - $dbConfig = [];  
166 - $dbConfig['type'] = "mysql";  
167 - $dbConfig['hostname'] = $this->request->param('dbhost');  
168 - $dbConfig['username'] = $this->request->param('dbuser');  
169 - $dbConfig['password'] = $this->request->param('dbpw');  
170 - $dbConfig['hostport'] = $this->request->param('dbport');  
171 - $dbConfig['charset'] = $this->request->param('dbcharset', 'utf8mb4');  
172 -  
173 - $userLogin = $this->request->param('manager');  
174 - $userPass = $this->request->param('manager_pwd');  
175 - $userEmail = $this->request->param('manager_email');  
176 - //检查密码。空 6-32字符。  
177 - empty($userPass) && $this->error("密码不可以为空");  
178 - strlen($userPass) < 6 && $this->error("密码长度最少6位");  
179 - strlen($userPass) > 32 && $this->error("密码长度最多32位");  
180 -  
181 - $db = Db::connect($dbConfig);  
182 - $dbName = $this->request->param('dbname');  
183 - $sql = "CREATE DATABASE IF NOT EXISTS `{$dbName}` DEFAULT CHARACTER SET " . $dbConfig['charset'];  
184 - $db->execute($sql) || $this->error($db->getError());  
185 -  
186 - $dbConfig['database'] = $dbName;  
187 -  
188 - $dbConfig['prefix'] = $this->request->param('dbprefix', '', 'trim');  
189 -  
190 - session('install.db_config', $dbConfig);  
191 -  
192 - $sql = cmf_split_sql(APP_PATH . 'install/data/thinkcmf.sql', $dbConfig['prefix'], $dbConfig['charset']);  
193 - session('install.sql', $sql);  
194 -  
195 - $this->assign('sql_count', count($sql));  
196 -  
197 - session('install.error', 0);  
198 -  
199 - $siteName = $this->request->param('sitename');  
200 - $seoKeywords = $this->request->param('sitekeywords');  
201 - $siteInfo = $this->request->param('siteinfo');  
202 -  
203 - session('install.site_info', [  
204 - 'site_name' => $siteName,  
205 - 'site_seo_title' => $siteName,  
206 - 'site_seo_keywords' => $seoKeywords,  
207 - 'site_seo_description' => $siteInfo  
208 - ]);  
209 -  
210 - session('install.admin_info', [  
211 - 'user_login' => $userLogin,  
212 - 'user_pass' => $userPass,  
213 - 'user_email' => $userEmail  
214 - ]);  
215 -  
216 - return $this->fetch(":step4");  
217 -  
218 - } else {  
219 - exit;  
220 - }  
221 - }  
222 -  
223 - public function install()  
224 - {  
225 - $dbConfig = session('install.db_config');  
226 - $sql = session('install.sql');  
227 -  
228 - if (empty($dbConfig) || empty($sql)) {  
229 - $this->error("非法安装!");  
230 - }  
231 -  
232 - $sqlIndex = $this->request->param('sql_index', 0, 'intval');  
233 -  
234 - $db = Db::connect($dbConfig);  
235 -  
236 - if ($sqlIndex >= count($sql)) {  
237 - $installError = session('install.error');  
238 - $this->success("安装完成!", '', ['done' => 1, 'error' => $installError]);  
239 - }  
240 -  
241 - $sqlToExec = $sql[$sqlIndex] . ';';  
242 -  
243 - $result = sp_execute_sql($db, $sqlToExec);  
244 -  
245 - if (!empty($result['error'])) {  
246 - $installError = session('install.error');  
247 - $installError = empty($installError) ? 0 : $installError;  
248 -  
249 - session('install.error', $installError + 1);  
250 - $this->error($result['message'], '', [  
251 - 'sql' => $sqlToExec,  
252 - 'exception' => $result['exception']  
253 - ]);  
254 - } else {  
255 - $this->success($result['message'], '', [  
256 - 'sql' => $sqlToExec  
257 - ]);  
258 - }  
259 -  
260 - }  
261 -  
262 - public function setDbConfig()  
263 - {  
264 - $dbConfig = session('install.db_config');  
265 -  
266 - $dbConfig['authcode'] = cmf_random_string(18);  
267 -  
268 - $result = sp_create_db_config($dbConfig);  
269 -  
270 - if ($result) {  
271 - $this->success("数据配置文件写入成功!");  
272 - } else {  
273 - $this->error("数据配置文件写入失败!");  
274 - }  
275 - }  
276 -  
277 - public function setSite()  
278 - {  
279 - $dbConfig = session('install.db_config');  
280 -  
281 - if (empty($dbConfig)) {  
282 - $this->error("非法安装!");  
283 - }  
284 -  
285 - $siteInfo = session('install.site_info');  
286 - $admin = session('install.admin_info');  
287 - $admin['id'] = 1;  
288 - $admin['user_pass'] = cmf_password($admin['user_pass']);  
289 - $admin['user_type'] = 1;  
290 - $admin['create_time'] = time();  
291 - $admin['user_status'] = 1;  
292 - $admin['user_nickname'] = $admin['user_login'];  
293 -  
294 - try {  
295 - cmf_set_option('site_info', $siteInfo);  
296 - Db::name('user')->insert($admin);  
297 - } catch (\Exception $e) {  
298 - $this->error("网站创建失败!");  
299 - }  
300 -  
301 - $this->success("网站创建完成!");  
302 -  
303 - }  
304 -  
305 - public function installTheme()  
306 - {  
307 - $themeModel = new ThemeModel();  
308 - $result = $themeModel->installTheme(config('cmf_default_theme'));  
309 - if ($result === false) {  
310 - $this->error('模板不存在!');  
311 - }  
312 -  
313 - session("install.step", 4);  
314 - $this->success("模板安装成功");  
315 - }  
316 -  
317 - public function step5()  
318 - {  
319 - if (session("install.step") == 4) {  
320 - @touch(CMF_ROOT . 'data/install.lock');  
321 - return $this->fetch(":step5");  
322 - } else {  
323 - $this->error("非法安装!");  
324 - }  
325 - }  
326 -  
327 - public function testDbPwd()  
328 - {  
329 - if ($this->request->isPost()) {  
330 - $dbConfig = $this->request->param();  
331 - $dbConfig['type'] = "mysql";  
332 -  
333 - $supportInnoDb = false;  
334 -  
335 - try {  
336 - Db::connect($dbConfig)->query("SELECT VERSION();");  
337 - $engines = Db::connect($dbConfig)->query("SHOW ENGINES;");  
338 -  
339 - foreach ($engines as $engine) {  
340 - if ($engine['Engine'] == 'InnoDB' && $engine['Support'] != 'NO') {  
341 - $supportInnoDb = true;  
342 - break;  
343 - }  
344 - }  
345 - } catch (\Exception $e) {  
346 - $this->error('数据库账号或密码不正确!');  
347 - }  
348 - if($supportInnoDb){  
349 - $this->success('验证成功!');  
350 - }else{  
351 - $this->error('数据库账号密码验证通过,但不支持InnoDb!');  
352 - }  
353 - } else {  
354 - $this->error('非法请求方式!');  
355 - }  
356 -  
357 - }  
358 -  
359 - public function testRewrite()  
360 - {  
361 - $this->success('success');  
362 - }  
363 -  
364 -}  
365 -  
1 -<?php  
2 -/**  
3 - * 配置文件  
4 - */  
5 -  
6 -return [  
7 - // 数据库类型  
8 - 'type' => 'mysql',  
9 - // 服务器地址  
10 - 'hostname' => '#hostname#',  
11 - // 数据库名  
12 - 'database' => '#database#',  
13 - // 用户名  
14 - 'username' => '#username#',  
15 - // 密码  
16 - 'password' => '#password#',  
17 - // 端口  
18 - 'hostport' => '#hostport#',  
19 - // 数据库编码默认采用utf8  
20 - 'charset' => '#charset#',  
21 - // 数据库表前缀  
22 - 'prefix' => '#prefix#',  
23 - "authcode" => '#authcode#',  
24 - //#COOKIE_PREFIX#  
25 -];  
1 ---  
2 --- 表的结构 `cmf_admin_menu`  
3 ---  
4 -  
5 -CREATE TABLE IF NOT EXISTS `cmf_admin_menu` (  
6 - `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,  
7 - `parent_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '父菜单id',  
8 - `type` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '菜单类型;1:有界面可访问菜单,2:无界面可访问菜单,0:只作为菜单',  
9 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '状态;1:显示,0:不显示',  
10 - `list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',  
11 - `app` varchar(40) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '应用名',  
12 - `controller` varchar(30) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '控制器名',  
13 - `action` varchar(30) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '操作名称',  
14 - `param` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '额外参数',  
15 - `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '菜单名称',  
16 - `icon` varchar(20) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '菜单图标',  
17 - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '备注',  
18 - PRIMARY KEY (`id`),  
19 - KEY `status` (`status`),  
20 - KEY `parent_id` (`parent_id`),  
21 - KEY `controller` (`controller`)  
22 -) ENGINE=InnoDB AUTO_INCREMENT=162 DEFAULT CHARSET=utf8mb4 COMMENT='后台菜单表';  
23 -  
24 ---  
25 --- 转存表中的数据 `cmf_admin_menu`  
26 ---  
27 -  
28 -INSERT INTO `cmf_admin_menu` (`id`, `parent_id`, `type`, `status`, `list_order`, `app`, `controller`, `action`, `param`, `name`, `icon`, `remark`) VALUES  
29 -(1, 0, 0, 1, 20, 'admin', 'Plugin', 'default', '', '插件中心', 'cloud', '插件中心'),  
30 -(2, 1, 1, 1, 10000, 'admin', 'Hook', 'index', '', '钩子管理', '', '钩子管理'),  
31 -(3, 2, 1, 0, 10000, 'admin', 'Hook', 'plugins', '', '钩子插件管理', '', '钩子插件管理'),  
32 -(4, 2, 2, 0, 10000, 'admin', 'Hook', 'pluginListOrder', '', '钩子插件排序', '', '钩子插件排序'),  
33 -(5, 2, 1, 0, 10000, 'admin', 'Hook', 'sync', '', '同步钩子', '', '同步钩子'),  
34 -(6, 0, 0, 1, 0, 'admin', 'Setting', 'default', '', '设置', 'cogs', '系统设置入口'),  
35 -(7, 6, 1, 1, 50, 'admin', 'Link', 'index', '', '友情链接', '', '友情链接管理'),  
36 -(8, 7, 1, 0, 10000, 'admin', 'Link', 'add', '', '添加友情链接', '', '添加友情链接'),  
37 -(9, 7, 2, 0, 10000, 'admin', 'Link', 'addPost', '', '添加友情链接提交保存', '', '添加友情链接提交保存'),  
38 -(10, 7, 1, 0, 10000, 'admin', 'Link', 'edit', '', '编辑友情链接', '', '编辑友情链接'),  
39 -(11, 7, 2, 0, 10000, 'admin', 'Link', 'editPost', '', '编辑友情链接提交保存', '', '编辑友情链接提交保存'),  
40 -(12, 7, 2, 0, 10000, 'admin', 'Link', 'delete', '', '删除友情链接', '', '删除友情链接'),  
41 -(13, 7, 2, 0, 10000, 'admin', 'Link', 'listOrder', '', '友情链接排序', '', '友情链接排序'),  
42 -(14, 7, 2, 0, 10000, 'admin', 'Link', 'toggle', '', '友情链接显示隐藏', '', '友情链接显示隐藏'),  
43 -(15, 6, 1, 1, 10, 'admin', 'Mailer', 'index', '', '邮箱配置', '', '邮箱配置'),  
44 -(16, 15, 2, 0, 10000, 'admin', 'Mailer', 'indexPost', '', '邮箱配置提交保存', '', '邮箱配置提交保存'),  
45 -(17, 15, 1, 0, 10000, 'admin', 'Mailer', 'template', '', '邮件模板', '', '邮件模板'),  
46 -(18, 15, 2, 0, 10000, 'admin', 'Mailer', 'templatePost', '', '邮件模板提交', '', '邮件模板提交'),  
47 -(19, 15, 1, 0, 10000, 'admin', 'Mailer', 'test', '', '邮件发送测试', '', '邮件发送测试'),  
48 -(20, 6, 1, 0, 10000, 'admin', 'Menu', 'index', '', '后台菜单', '', '后台菜单管理'),  
49 -(21, 20, 1, 0, 10000, 'admin', 'Menu', 'lists', '', '所有菜单', '', '后台所有菜单列表'),  
50 -(22, 20, 1, 0, 10000, 'admin', 'Menu', 'add', '', '后台菜单添加', '', '后台菜单添加'),  
51 -(23, 20, 2, 0, 10000, 'admin', 'Menu', 'addPost', '', '后台菜单添加提交保存', '', '后台菜单添加提交保存'),  
52 -(24, 20, 1, 0, 10000, 'admin', 'Menu', 'edit', '', '后台菜单编辑', '', '后台菜单编辑'),  
53 -(25, 20, 2, 0, 10000, 'admin', 'Menu', 'editPost', '', '后台菜单编辑提交保存', '', '后台菜单编辑提交保存'),  
54 -(26, 20, 2, 0, 10000, 'admin', 'Menu', 'delete', '', '后台菜单删除', '', '后台菜单删除'),  
55 -(27, 20, 2, 0, 10000, 'admin', 'Menu', 'listOrder', '', '后台菜单排序', '', '后台菜单排序'),  
56 -(28, 20, 1, 0, 10000, 'admin', 'Menu', 'getActions', '', '导入新后台菜单', '', '导入新后台菜单'),  
57 -(29, 6, 1, 1, 30, 'admin', 'Nav', 'index', '', '导航管理', '', '导航管理'),  
58 -(30, 29, 1, 0, 10000, 'admin', 'Nav', 'add', '', '添加导航', '', '添加导航'),  
59 -(31, 29, 2, 0, 10000, 'admin', 'Nav', 'addPost', '', '添加导航提交保存', '', '添加导航提交保存'),  
60 -(32, 29, 1, 0, 10000, 'admin', 'Nav', 'edit', '', '编辑导航', '', '编辑导航'),  
61 -(33, 29, 2, 0, 10000, 'admin', 'Nav', 'editPost', '', '编辑导航提交保存', '', '编辑导航提交保存'),  
62 -(34, 29, 2, 0, 10000, 'admin', 'Nav', 'delete', '', '删除导航', '', '删除导航'),  
63 -(35, 29, 1, 0, 10000, 'admin', 'NavMenu', 'index', '', '导航菜单', '', '导航菜单'),  
64 -(36, 35, 1, 0, 10000, 'admin', 'NavMenu', 'add', '', '添加导航菜单', '', '添加导航菜单'),  
65 -(37, 35, 2, 0, 10000, 'admin', 'NavMenu', 'addPost', '', '添加导航菜单提交保存', '', '添加导航菜单提交保存'),  
66 -(38, 35, 1, 0, 10000, 'admin', 'NavMenu', 'edit', '', '编辑导航菜单', '', '编辑导航菜单'),  
67 -(39, 35, 2, 0, 10000, 'admin', 'NavMenu', 'editPost', '', '编辑导航菜单提交保存', '', '编辑导航菜单提交保存'),  
68 -(40, 35, 2, 0, 10000, 'admin', 'NavMenu', 'delete', '', '删除导航菜单', '', '删除导航菜单'),  
69 -(41, 35, 2, 0, 10000, 'admin', 'NavMenu', 'listOrder', '', '导航菜单排序', '', '导航菜单排序'),  
70 -(42, 1, 1, 1, 10000, 'admin', 'Plugin', 'index', '', '插件列表', '', '插件列表'),  
71 -(43, 42, 2, 0, 10000, 'admin', 'Plugin', 'toggle', '', '插件启用禁用', '', '插件启用禁用'),  
72 -(44, 42, 1, 0, 10000, 'admin', 'Plugin', 'setting', '', '插件设置', '', '插件设置'),  
73 -(45, 42, 2, 0, 10000, 'admin', 'Plugin', 'settingPost', '', '插件设置提交', '', '插件设置提交'),  
74 -(46, 42, 2, 0, 10000, 'admin', 'Plugin', 'install', '', '插件安装', '', '插件安装'),  
75 -(47, 42, 2, 0, 10000, 'admin', 'Plugin', 'update', '', '插件更新', '', '插件更新'),  
76 -(48, 42, 2, 0, 10000, 'admin', 'Plugin', 'uninstall', '', '卸载插件', '', '卸载插件'),  
77 -(49, 109, 0, 1, 10000, 'admin', 'User', 'default', '', '管理组', '', '管理组'),  
78 -(50, 49, 1, 1, 10000, 'admin', 'Rbac', 'index', '', '角色管理', '', '角色管理'),  
79 -(51, 50, 1, 0, 10000, 'admin', 'Rbac', 'roleAdd', '', '添加角色', '', '添加角色'),  
80 -(52, 50, 2, 0, 10000, 'admin', 'Rbac', 'roleAddPost', '', '添加角色提交', '', '添加角色提交'),  
81 -(53, 50, 1, 0, 10000, 'admin', 'Rbac', 'roleEdit', '', '编辑角色', '', '编辑角色'),  
82 -(54, 50, 2, 0, 10000, 'admin', 'Rbac', 'roleEditPost', '', '编辑角色提交', '', '编辑角色提交'),  
83 -(55, 50, 2, 0, 10000, 'admin', 'Rbac', 'roleDelete', '', '删除角色', '', '删除角色'),  
84 -(56, 50, 1, 0, 10000, 'admin', 'Rbac', 'authorize', '', '设置角色权限', '', '设置角色权限'),  
85 -(57, 50, 2, 0, 10000, 'admin', 'Rbac', 'authorizePost', '', '角色授权提交', '', '角色授权提交'),  
86 -(58, 0, 1, 0, 10000, 'admin', 'RecycleBin', 'index', '', '回收站', '', '回收站'),  
87 -(59, 58, 2, 0, 10000, 'admin', 'RecycleBin', 'restore', '', '回收站还原', '', '回收站还原'),  
88 -(60, 58, 2, 0, 10000, 'admin', 'RecycleBin', 'delete', '', '回收站彻底删除', '', '回收站彻底删除'),  
89 -(61, 6, 1, 1, 10000, 'admin', 'Route', 'index', '', 'URL美化', '', 'URL规则管理'),  
90 -(62, 61, 1, 0, 10000, 'admin', 'Route', 'add', '', '添加路由规则', '', '添加路由规则'),  
91 -(63, 61, 2, 0, 10000, 'admin', 'Route', 'addPost', '', '添加路由规则提交', '', '添加路由规则提交'),  
92 -(64, 61, 1, 0, 10000, 'admin', 'Route', 'edit', '', '路由规则编辑', '', '路由规则编辑'),  
93 -(65, 61, 2, 0, 10000, 'admin', 'Route', 'editPost', '', '路由规则编辑提交', '', '路由规则编辑提交'),  
94 -(66, 61, 2, 0, 10000, 'admin', 'Route', 'delete', '', '路由规则删除', '', '路由规则删除'),  
95 -(67, 61, 2, 0, 10000, 'admin', 'Route', 'ban', '', '路由规则禁用', '', '路由规则禁用'),  
96 -(68, 61, 2, 0, 10000, 'admin', 'Route', 'open', '', '路由规则启用', '', '路由规则启用'),  
97 -(69, 61, 2, 0, 10000, 'admin', 'Route', 'listOrder', '', '路由规则排序', '', '路由规则排序'),  
98 -(70, 61, 1, 0, 10000, 'admin', 'Route', 'select', '', '选择URL', '', '选择URL'),  
99 -(71, 6, 1, 1, 0, 'admin', 'Setting', 'site', '', '网站信息', '', '网站信息'),  
100 -(72, 71, 2, 0, 10000, 'admin', 'Setting', 'sitePost', '', '网站信息设置提交', '', '网站信息设置提交'),  
101 -(73, 6, 1, 0, 10000, 'admin', 'Setting', 'password', '', '密码修改', '', '密码修改'),  
102 -(74, 73, 2, 0, 10000, 'admin', 'Setting', 'passwordPost', '', '密码修改提交', '', '密码修改提交'),  
103 -(75, 6, 1, 1, 10000, 'admin', 'Setting', 'upload', '', '上传设置', '', '上传设置'),  
104 -(76, 75, 2, 0, 10000, 'admin', 'Setting', 'uploadPost', '', '上传设置提交', '', '上传设置提交'),  
105 -(77, 6, 1, 0, 10000, 'admin', 'Setting', 'clearCache', '', '清除缓存', '', '清除缓存'),  
106 -(78, 6, 1, 1, 40, 'admin', 'Slide', 'index', '', '幻灯片管理', '', '幻灯片管理'),  
107 -(79, 78, 1, 0, 10000, 'admin', 'Slide', 'add', '', '添加幻灯片', '', '添加幻灯片'),  
108 -(80, 78, 2, 0, 10000, 'admin', 'Slide', 'addPost', '', '添加幻灯片提交', '', '添加幻灯片提交'),  
109 -(81, 78, 1, 0, 10000, 'admin', 'Slide', 'edit', '', '编辑幻灯片', '', '编辑幻灯片'),  
110 -(82, 78, 2, 0, 10000, 'admin', 'Slide', 'editPost', '', '编辑幻灯片提交', '', '编辑幻灯片提交'),  
111 -(83, 78, 2, 0, 10000, 'admin', 'Slide', 'delete', '', '删除幻灯片', '', '删除幻灯片'),  
112 -(84, 78, 1, 0, 10000, 'admin', 'SlideItem', 'index', '', '幻灯片页面列表', '', '幻灯片页面列表'),  
113 -(85, 84, 1, 0, 10000, 'admin', 'SlideItem', 'add', '', '幻灯片页面添加', '', '幻灯片页面添加'),  
114 -(86, 84, 2, 0, 10000, 'admin', 'SlideItem', 'addPost', '', '幻灯片页面添加提交', '', '幻灯片页面添加提交'),  
115 -(87, 84, 1, 0, 10000, 'admin', 'SlideItem', 'edit', '', '幻灯片页面编辑', '', '幻灯片页面编辑'),  
116 -(88, 84, 2, 0, 10000, 'admin', 'SlideItem', 'editPost', '', '幻灯片页面编辑提交', '', '幻灯片页面编辑提交'),  
117 -(89, 84, 2, 0, 10000, 'admin', 'SlideItem', 'delete', '', '幻灯片页面删除', '', '幻灯片页面删除'),  
118 -(90, 84, 2, 0, 10000, 'admin', 'SlideItem', 'ban', '', '幻灯片页面隐藏', '', '幻灯片页面隐藏'),  
119 -(91, 84, 2, 0, 10000, 'admin', 'SlideItem', 'cancelBan', '', '幻灯片页面显示', '', '幻灯片页面显示'),  
120 -(92, 84, 2, 0, 10000, 'admin', 'SlideItem', 'listOrder', '', '幻灯片页面排序', '', '幻灯片页面排序'),  
121 -(93, 6, 1, 1, 10000, 'admin', 'Storage', 'index', '', '文件存储', '', '文件存储'),  
122 -(94, 93, 2, 0, 10000, 'admin', 'Storage', 'settingPost', '', '文件存储设置提交', '', '文件存储设置提交'),  
123 -(95, 6, 1, 1, 20, 'admin', 'Theme', 'index', '', '模板管理', '', '模板管理'),  
124 -(96, 95, 1, 0, 10000, 'admin', 'Theme', 'install', '', '安装模板', '', '安装模板'),  
125 -(97, 95, 2, 0, 10000, 'admin', 'Theme', 'uninstall', '', '卸载模板', '', '卸载模板'),  
126 -(98, 95, 2, 0, 10000, 'admin', 'Theme', 'installTheme', '', '模板安装', '', '模板安装'),  
127 -(99, 95, 2, 0, 10000, 'admin', 'Theme', 'update', '', '模板更新', '', '模板更新'),  
128 -(100, 95, 2, 0, 10000, 'admin', 'Theme', 'active', '', '启用模板', '', '启用模板'),  
129 -(101, 95, 1, 0, 10000, 'admin', 'Theme', 'files', '', '模板文件列表', '', '启用模板'),  
130 -(102, 95, 1, 0, 10000, 'admin', 'Theme', 'fileSetting', '', '模板文件设置', '', '模板文件设置'),  
131 -(103, 95, 1, 0, 10000, 'admin', 'Theme', 'fileArrayData', '', '模板文件数组数据列表', '', '模板文件数组数据列表'),  
132 -(104, 95, 2, 0, 10000, 'admin', 'Theme', 'fileArrayDataEdit', '', '模板文件数组数据添加编辑', '', '模板文件数组数据添加编辑'),  
133 -(105, 95, 2, 0, 10000, 'admin', 'Theme', 'fileArrayDataEditPost', '', '模板文件数组数据添加编辑提交保存', '', '模板文件数组数据添加编辑提交保存'),  
134 -(106, 95, 2, 0, 10000, 'admin', 'Theme', 'fileArrayDataDelete', '', '模板文件数组数据删除', '', '模板文件数组数据删除'),  
135 -(107, 95, 2, 0, 10000, 'admin', 'Theme', 'settingPost', '', '模板文件编辑提交保存', '', '模板文件编辑提交保存'),  
136 -(108, 95, 1, 0, 10000, 'admin', 'Theme', 'dataSource', '', '模板文件设置数据源', '', '模板文件设置数据源'),  
137 -(109, 0, 0, 1, 10, 'user', 'AdminIndex', 'default', '', '用户管理', 'group', '用户管理'),  
138 -(110, 49, 1, 1, 10000, 'admin', 'User', 'index', '', '管理员', '', '管理员管理'),  
139 -(111, 110, 1, 0, 10000, 'admin', 'User', 'add', '', '管理员添加', '', '管理员添加'),  
140 -(112, 110, 2, 0, 10000, 'admin', 'User', 'addPost', '', '管理员添加提交', '', '管理员添加提交'),  
141 -(113, 110, 1, 0, 10000, 'admin', 'User', 'edit', '', '管理员编辑', '', '管理员编辑'),  
142 -(114, 110, 2, 0, 10000, 'admin', 'User', 'editPost', '', '管理员编辑提交', '', '管理员编辑提交'),  
143 -(115, 110, 1, 0, 10000, 'admin', 'User', 'userInfo', '', '个人信息', '', '管理员个人信息修改'),  
144 -(116, 110, 2, 0, 10000, 'admin', 'User', 'userInfoPost', '', '管理员个人信息修改提交', '', '管理员个人信息修改提交'),  
145 -(117, 110, 2, 0, 10000, 'admin', 'User', 'delete', '', '管理员删除', '', '管理员删除'),  
146 -(118, 110, 2, 0, 10000, 'admin', 'User', 'ban', '', '停用管理员', '', '停用管理员'),  
147 -(119, 110, 2, 0, 10000, 'admin', 'User', 'cancelBan', '', '启用管理员', '', '启用管理员'),  
148 -(120, 0, 0, 1, 30, 'portal', 'AdminIndex', 'default', '', '门户管理', 'th', '门户管理'),  
149 -(121, 120, 1, 1, 10000, 'portal', 'AdminArticle', 'index', '', '文章管理', '', '文章列表'),  
150 -(122, 121, 1, 0, 10000, 'portal', 'AdminArticle', 'add', '', '添加文章', '', '添加文章'),  
151 -(123, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'addPost', '', '添加文章提交', '', '添加文章提交'),  
152 -(124, 121, 1, 0, 10000, 'portal', 'AdminArticle', 'edit', '', '编辑文章', '', '编辑文章'),  
153 -(125, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'editPost', '', '编辑文章提交', '', '编辑文章提交'),  
154 -(126, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'delete', '', '文章删除', '', '文章删除'),  
155 -(127, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'publish', '', '文章发布', '', '文章发布'),  
156 -(128, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'top', '', '文章置顶', '', '文章置顶'),  
157 -(129, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'recommend', '', '文章推荐', '', '文章推荐'),  
158 -(130, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'listOrder', '', '文章排序', '', '文章排序'),  
159 -(131, 120, 1, 1, 10000, 'portal', 'AdminCategory', 'index', '', '分类管理', '', '文章分类列表'),  
160 -(132, 131, 1, 0, 10000, 'portal', 'AdminCategory', 'add', '', '添加文章分类', '', '添加文章分类'),  
161 -(133, 131, 2, 0, 10000, 'portal', 'AdminCategory', 'addPost', '', '添加文章分类提交', '', '添加文章分类提交'),  
162 -(134, 131, 1, 0, 10000, 'portal', 'AdminCategory', 'edit', '', '编辑文章分类', '', '编辑文章分类'),  
163 -(135, 131, 2, 0, 10000, 'portal', 'AdminCategory', 'editPost', '', '编辑文章分类提交', '', '编辑文章分类提交'),  
164 -(136, 131, 1, 0, 10000, 'portal', 'AdminCategory', 'select', '', '文章分类选择对话框', '', '文章分类选择对话框'),  
165 -(137, 131, 2, 0, 10000, 'portal', 'AdminCategory', 'listOrder', '', '文章分类排序', '', '文章分类排序'),  
166 -(138, 131, 2, 0, 10000, 'portal', 'AdminCategory', 'delete', '', '删除文章分类', '', '删除文章分类'),  
167 -(139, 120, 1, 1, 10000, 'portal', 'AdminPage', 'index', '', '页面管理', '', '页面管理'),  
168 -(140, 139, 1, 0, 10000, 'portal', 'AdminPage', 'add', '', '添加页面', '', '添加页面'),  
169 -(141, 139, 2, 0, 10000, 'portal', 'AdminPage', 'addPost', '', '添加页面提交', '', '添加页面提交'),  
170 -(142, 139, 1, 0, 10000, 'portal', 'AdminPage', 'edit', '', '编辑页面', '', '编辑页面'),  
171 -(143, 139, 2, 0, 10000, 'portal', 'AdminPage', 'editPost', '', '编辑页面提交', '', '编辑页面提交'),  
172 -(144, 139, 2, 0, 10000, 'portal', 'AdminPage', 'delete', '', '删除页面', '', '删除页面'),  
173 -(145, 120, 1, 1, 10000, 'portal', 'AdminTag', 'index', '', '文章标签', '', '文章标签'),  
174 -(146, 145, 1, 0, 10000, 'portal', 'AdminTag', 'add', '', '添加文章标签', '', '添加文章标签'),  
175 -(147, 145, 2, 0, 10000, 'portal', 'AdminTag', 'addPost', '', '添加文章标签提交', '', '添加文章标签提交'),  
176 -(148, 145, 2, 0, 10000, 'portal', 'AdminTag', 'upStatus', '', '更新标签状态', '', '更新标签状态'),  
177 -(149, 145, 2, 0, 10000, 'portal', 'AdminTag', 'delete', '', '删除文章标签', '', '删除文章标签'),  
178 -(150, 0, 1, 0, 10000, 'user', 'AdminAsset', 'index', '', '资源管理', 'file', '资源管理列表'),  
179 -(151, 150, 2, 0, 10000, 'user', 'AdminAsset', 'delete', '', '删除文件', '', '删除文件'),  
180 -(152, 109, 0, 1, 10000, 'user', 'AdminIndex', 'default1', '', '用户组', '', '用户组'),  
181 -(153, 152, 1, 1, 10000, 'user', 'AdminIndex', 'index', '', '本站用户', '', '本站用户'),  
182 -(154, 153, 2, 0, 10000, 'user', 'AdminIndex', 'ban', '', '本站用户拉黑', '', '本站用户拉黑'),  
183 -(155, 153, 2, 0, 10000, 'user', 'AdminIndex', 'cancelBan', '', '本站用户启用', '', '本站用户启用'),  
184 -(156, 152, 1, 1, 10000, 'user', 'AdminOauth', 'index', '', '第三方用户', '', '第三方用户'),  
185 -(157, 156, 2, 0, 10000, 'user', 'AdminOauth', 'delete', '', '删除第三方用户绑定', '', '删除第三方用户绑定'),  
186 -(158, 6, 1, 1, 10000, 'user', 'AdminUserAction', 'index', '', '用户操作管理', '', '用户操作管理'),  
187 -(159, 158, 1, 0, 10000, 'user', 'AdminUserAction', 'edit', '', '编辑用户操作', '', '编辑用户操作'),  
188 -(160, 158, 2, 0, 10000, 'user', 'AdminUserAction', 'editPost', '', '编辑用户操作提交', '', '编辑用户操作提交'),  
189 -(161, 158, 1, 0, 10000, 'user', 'AdminUserAction', 'sync', '', '同步用户操作', '', '同步用户操作');  
190 -  
191 --- --------------------------------------------------------  
192 -  
193 ---  
194 --- 表的结构 `cmf_asset`  
195 ---  
196 -  
197 -CREATE TABLE IF NOT EXISTS `cmf_asset` (  
198 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
199 - `user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户id',  
200 - `file_size` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '文件大小,单位B',  
201 - `create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上传时间',  
202 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态;1:可用,0:不可用',  
203 - `download_times` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '下载次数',  
204 - `file_key` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '文件惟一码',  
205 - `filename` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '文件名',  
206 - `file_path` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '文件路径,相对于upload目录,可以为url',  
207 - `file_md5` varchar(32) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '文件md5值',  
208 - `file_sha1` varchar(40) CHARACTER SET utf8 NOT NULL DEFAULT '',  
209 - `suffix` varchar(10) NOT NULL DEFAULT '' COMMENT '文件后缀名,不包括点',  
210 - `more` text COMMENT '其它详细信息,JSON格式',  
211 - PRIMARY KEY (`id`)  
212 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='资源表';  
213 -  
214 --- --------------------------------------------------------  
215 -  
216 ---  
217 --- 表的结构 `cmf_auth_access`  
218 ---  
219 -  
220 -CREATE TABLE IF NOT EXISTS `cmf_auth_access` (  
221 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
222 - `role_id` int(10) UNSIGNED NOT NULL COMMENT '角色',  
223 - `rule_name` varchar(100) NOT NULL DEFAULT '' COMMENT '规则唯一英文标识,全小写',  
224 - `type` varchar(30) NOT NULL DEFAULT '' COMMENT '权限规则分类,请加应用前缀,如admin_',  
225 - PRIMARY KEY (`id`),  
226 - KEY `role_id` (`role_id`),  
227 - KEY `rule_name` (`rule_name`) USING BTREE  
228 -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='权限授权表';  
229 -  
230 --- --------------------------------------------------------  
231 -  
232 ---  
233 --- 表的结构 `cmf_auth_rule`  
234 ---  
235 -  
236 -CREATE TABLE IF NOT EXISTS `cmf_auth_rule` (  
237 - `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '规则id,自增主键',  
238 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '是否有效(0:无效,1:有效)',  
239 - `app` varchar(15) NOT NULL COMMENT '规则所属module',  
240 - `type` varchar(30) NOT NULL DEFAULT '' COMMENT '权限规则分类,请加应用前缀,如admin_',  
241 - `name` varchar(100) NOT NULL DEFAULT '' COMMENT '规则唯一英文标识,全小写',  
242 - `param` varchar(100) NOT NULL DEFAULT '' COMMENT '额外url参数',  
243 - `title` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '规则描述',  
244 - `condition` varchar(200) NOT NULL DEFAULT '' COMMENT '规则附加条件',  
245 - PRIMARY KEY (`id`),  
246 - UNIQUE KEY `name` (`name`) USING BTREE,  
247 - KEY `module` (`app`,`status`,`type`)  
248 -) ENGINE=InnoDB AUTO_INCREMENT=162 DEFAULT CHARSET=utf8mb4 COMMENT='权限规则表';  
249 -  
250 ---  
251 --- 转存表中的数据 `cmf_auth_rule`  
252 ---  
253 -  
254 -INSERT INTO `cmf_auth_rule` (`id`, `status`, `app`, `type`, `name`, `param`, `title`, `condition`) VALUES  
255 -(1, 1, 'admin', 'admin_url', 'admin/Hook/index', '', '钩子管理', ''),  
256 -(2, 1, 'admin', 'admin_url', 'admin/Hook/plugins', '', '钩子插件管理', ''),  
257 -(3, 1, 'admin', 'admin_url', 'admin/Hook/pluginListOrder', '', '钩子插件排序', ''),  
258 -(4, 1, 'admin', 'admin_url', 'admin/Hook/sync', '', '同步钩子', ''),  
259 -(5, 1, 'admin', 'admin_url', 'admin/Link/index', '', '友情链接', ''),  
260 -(6, 1, 'admin', 'admin_url', 'admin/Link/add', '', '添加友情链接', ''),  
261 -(7, 1, 'admin', 'admin_url', 'admin/Link/addPost', '', '添加友情链接提交保存', ''),  
262 -(8, 1, 'admin', 'admin_url', 'admin/Link/edit', '', '编辑友情链接', ''),  
263 -(9, 1, 'admin', 'admin_url', 'admin/Link/editPost', '', '编辑友情链接提交保存', ''),  
264 -(10, 1, 'admin', 'admin_url', 'admin/Link/delete', '', '删除友情链接', ''),  
265 -(11, 1, 'admin', 'admin_url', 'admin/Link/listOrder', '', '友情链接排序', ''),  
266 -(12, 1, 'admin', 'admin_url', 'admin/Link/toggle', '', '友情链接显示隐藏', ''),  
267 -(13, 1, 'admin', 'admin_url', 'admin/Mailer/index', '', '邮箱配置', ''),  
268 -(14, 1, 'admin', 'admin_url', 'admin/Mailer/indexPost', '', '邮箱配置提交保存', ''),  
269 -(15, 1, 'admin', 'admin_url', 'admin/Mailer/template', '', '邮件模板', ''),  
270 -(16, 1, 'admin', 'admin_url', 'admin/Mailer/templatePost', '', '邮件模板提交', ''),  
271 -(17, 1, 'admin', 'admin_url', 'admin/Mailer/test', '', '邮件发送测试', ''),  
272 -(18, 1, 'admin', 'admin_url', 'admin/Menu/index', '', '后台菜单', ''),  
273 -(19, 1, 'admin', 'admin_url', 'admin/Menu/lists', '', '所有菜单', ''),  
274 -(20, 1, 'admin', 'admin_url', 'admin/Menu/add', '', '后台菜单添加', ''),  
275 -(21, 1, 'admin', 'admin_url', 'admin/Menu/addPost', '', '后台菜单添加提交保存', ''),  
276 -(22, 1, 'admin', 'admin_url', 'admin/Menu/edit', '', '后台菜单编辑', ''),  
277 -(23, 1, 'admin', 'admin_url', 'admin/Menu/editPost', '', '后台菜单编辑提交保存', ''),  
278 -(24, 1, 'admin', 'admin_url', 'admin/Menu/delete', '', '后台菜单删除', ''),  
279 -(25, 1, 'admin', 'admin_url', 'admin/Menu/listOrder', '', '后台菜单排序', ''),  
280 -(26, 1, 'admin', 'admin_url', 'admin/Menu/getActions', '', '导入新后台菜单', ''),  
281 -(27, 1, 'admin', 'admin_url', 'admin/Nav/index', '', '导航管理', ''),  
282 -(28, 1, 'admin', 'admin_url', 'admin/Nav/add', '', '添加导航', ''),  
283 -(29, 1, 'admin', 'admin_url', 'admin/Nav/addPost', '', '添加导航提交保存', ''),  
284 -(30, 1, 'admin', 'admin_url', 'admin/Nav/edit', '', '编辑导航', ''),  
285 -(31, 1, 'admin', 'admin_url', 'admin/Nav/editPost', '', '编辑导航提交保存', ''),  
286 -(32, 1, 'admin', 'admin_url', 'admin/Nav/delete', '', '删除导航', ''),  
287 -(33, 1, 'admin', 'admin_url', 'admin/NavMenu/index', '', '导航菜单', ''),  
288 -(34, 1, 'admin', 'admin_url', 'admin/NavMenu/add', '', '添加导航菜单', ''),  
289 -(35, 1, 'admin', 'admin_url', 'admin/NavMenu/addPost', '', '添加导航菜单提交保存', ''),  
290 -(36, 1, 'admin', 'admin_url', 'admin/NavMenu/edit', '', '编辑导航菜单', ''),  
291 -(37, 1, 'admin', 'admin_url', 'admin/NavMenu/editPost', '', '编辑导航菜单提交保存', ''),  
292 -(38, 1, 'admin', 'admin_url', 'admin/NavMenu/delete', '', '删除导航菜单', ''),  
293 -(39, 1, 'admin', 'admin_url', 'admin/NavMenu/listOrder', '', '导航菜单排序', ''),  
294 -(40, 1, 'admin', 'admin_url', 'admin/Plugin/default', '', '插件管理', ''),  
295 -(41, 1, 'admin', 'admin_url', 'admin/Plugin/index', '', '插件列表', ''),  
296 -(42, 1, 'admin', 'admin_url', 'admin/Plugin/toggle', '', '插件启用禁用', ''),  
297 -(43, 1, 'admin', 'admin_url', 'admin/Plugin/setting', '', '插件设置', ''),  
298 -(44, 1, 'admin', 'admin_url', 'admin/Plugin/settingPost', '', '插件设置提交', ''),  
299 -(45, 1, 'admin', 'admin_url', 'admin/Plugin/install', '', '插件安装', ''),  
300 -(46, 1, 'admin', 'admin_url', 'admin/Plugin/update', '', '插件更新', ''),  
301 -(47, 1, 'admin', 'admin_url', 'admin/Plugin/uninstall', '', '卸载插件', ''),  
302 -(48, 1, 'admin', 'admin_url', 'admin/Rbac/index', '', '角色管理', ''),  
303 -(49, 1, 'admin', 'admin_url', 'admin/Rbac/roleAdd', '', '添加角色', ''),  
304 -(50, 1, 'admin', 'admin_url', 'admin/Rbac/roleAddPost', '', '添加角色提交', ''),  
305 -(51, 1, 'admin', 'admin_url', 'admin/Rbac/roleEdit', '', '编辑角色', ''),  
306 -(52, 1, 'admin', 'admin_url', 'admin/Rbac/roleEditPost', '', '编辑角色提交', ''),  
307 -(53, 1, 'admin', 'admin_url', 'admin/Rbac/roleDelete', '', '删除角色', ''),  
308 -(54, 1, 'admin', 'admin_url', 'admin/Rbac/authorize', '', '设置角色权限', ''),  
309 -(55, 1, 'admin', 'admin_url', 'admin/Rbac/authorizePost', '', '角色授权提交', ''),  
310 -(56, 1, 'admin', 'admin_url', 'admin/RecycleBin/index', '', '回收站', ''),  
311 -(57, 1, 'admin', 'admin_url', 'admin/RecycleBin/restore', '', '回收站还原', ''),  
312 -(58, 1, 'admin', 'admin_url', 'admin/RecycleBin/delete', '', '回收站彻底删除', ''),  
313 -(59, 1, 'admin', 'admin_url', 'admin/Route/index', '', 'URL美化', ''),  
314 -(60, 1, 'admin', 'admin_url', 'admin/Route/add', '', '添加路由规则', ''),  
315 -(61, 1, 'admin', 'admin_url', 'admin/Route/addPost', '', '添加路由规则提交', ''),  
316 -(62, 1, 'admin', 'admin_url', 'admin/Route/edit', '', '路由规则编辑', ''),  
317 -(63, 1, 'admin', 'admin_url', 'admin/Route/editPost', '', '路由规则编辑提交', ''),  
318 -(64, 1, 'admin', 'admin_url', 'admin/Route/delete', '', '路由规则删除', ''),  
319 -(65, 1, 'admin', 'admin_url', 'admin/Route/ban', '', '路由规则禁用', ''),  
320 -(66, 1, 'admin', 'admin_url', 'admin/Route/open', '', '路由规则启用', ''),  
321 -(67, 1, 'admin', 'admin_url', 'admin/Route/listOrder', '', '路由规则排序', ''),  
322 -(68, 1, 'admin', 'admin_url', 'admin/Route/select', '', '选择URL', ''),  
323 -(69, 1, 'admin', 'admin_url', 'admin/Setting/default', '', '设置', ''),  
324 -(70, 1, 'admin', 'admin_url', 'admin/Setting/site', '', '网站信息', ''),  
325 -(71, 1, 'admin', 'admin_url', 'admin/Setting/sitePost', '', '网站信息设置提交', ''),  
326 -(72, 1, 'admin', 'admin_url', 'admin/Setting/password', '', '密码修改', ''),  
327 -(73, 1, 'admin', 'admin_url', 'admin/Setting/passwordPost', '', '密码修改提交', ''),  
328 -(74, 1, 'admin', 'admin_url', 'admin/Setting/upload', '', '上传设置', ''),  
329 -(75, 1, 'admin', 'admin_url', 'admin/Setting/uploadPost', '', '上传设置提交', ''),  
330 -(76, 1, 'admin', 'admin_url', 'admin/Setting/clearCache', '', '清除缓存', ''),  
331 -(77, 1, 'admin', 'admin_url', 'admin/Slide/index', '', '幻灯片管理', ''),  
332 -(78, 1, 'admin', 'admin_url', 'admin/Slide/add', '', '添加幻灯片', ''),  
333 -(79, 1, 'admin', 'admin_url', 'admin/Slide/addPost', '', '添加幻灯片提交', ''),  
334 -(80, 1, 'admin', 'admin_url', 'admin/Slide/edit', '', '编辑幻灯片', ''),  
335 -(81, 1, 'admin', 'admin_url', 'admin/Slide/editPost', '', '编辑幻灯片提交', ''),  
336 -(82, 1, 'admin', 'admin_url', 'admin/Slide/delete', '', '删除幻灯片', ''),  
337 -(83, 1, 'admin', 'admin_url', 'admin/SlideItem/index', '', '幻灯片页面列表', ''),  
338 -(84, 1, 'admin', 'admin_url', 'admin/SlideItem/add', '', '幻灯片页面添加', ''),  
339 -(85, 1, 'admin', 'admin_url', 'admin/SlideItem/addPost', '', '幻灯片页面添加提交', ''),  
340 -(86, 1, 'admin', 'admin_url', 'admin/SlideItem/edit', '', '幻灯片页面编辑', ''),  
341 -(87, 1, 'admin', 'admin_url', 'admin/SlideItem/editPost', '', '幻灯片页面编辑提交', ''),  
342 -(88, 1, 'admin', 'admin_url', 'admin/SlideItem/delete', '', '幻灯片页面删除', ''),  
343 -(89, 1, 'admin', 'admin_url', 'admin/SlideItem/ban', '', '幻灯片页面隐藏', ''),  
344 -(90, 1, 'admin', 'admin_url', 'admin/SlideItem/cancelBan', '', '幻灯片页面显示', ''),  
345 -(91, 1, 'admin', 'admin_url', 'admin/SlideItem/listOrder', '', '幻灯片页面排序', ''),  
346 -(92, 1, 'admin', 'admin_url', 'admin/Storage/index', '', '文件存储', ''),  
347 -(93, 1, 'admin', 'admin_url', 'admin/Storage/settingPost', '', '文件存储设置提交', ''),  
348 -(94, 1, 'admin', 'admin_url', 'admin/Theme/index', '', '模板管理', ''),  
349 -(95, 1, 'admin', 'admin_url', 'admin/Theme/install', '', '安装模板', ''),  
350 -(96, 1, 'admin', 'admin_url', 'admin/Theme/uninstall', '', '卸载模板', ''),  
351 -(97, 1, 'admin', 'admin_url', 'admin/Theme/installTheme', '', '模板安装', ''),  
352 -(98, 1, 'admin', 'admin_url', 'admin/Theme/update', '', '模板更新', ''),  
353 -(99, 1, 'admin', 'admin_url', 'admin/Theme/active', '', '启用模板', ''),  
354 -(100, 1, 'admin', 'admin_url', 'admin/Theme/files', '', '模板文件列表', ''),  
355 -(101, 1, 'admin', 'admin_url', 'admin/Theme/fileSetting', '', '模板文件设置', ''),  
356 -(102, 1, 'admin', 'admin_url', 'admin/Theme/fileArrayData', '', '模板文件数组数据列表', ''),  
357 -(103, 1, 'admin', 'admin_url', 'admin/Theme/fileArrayDataEdit', '', '模板文件数组数据添加编辑', ''),  
358 -(104, 1, 'admin', 'admin_url', 'admin/Theme/fileArrayDataEditPost', '', '模板文件数组数据添加编辑提交保存', ''),  
359 -(105, 1, 'admin', 'admin_url', 'admin/Theme/fileArrayDataDelete', '', '模板文件数组数据删除', ''),  
360 -(106, 1, 'admin', 'admin_url', 'admin/Theme/settingPost', '', '模板文件编辑提交保存', ''),  
361 -(107, 1, 'admin', 'admin_url', 'admin/Theme/dataSource', '', '模板文件设置数据源', ''),  
362 -(108, 1, 'admin', 'admin_url', 'admin/User/default', '', '管理组', ''),  
363 -(109, 1, 'admin', 'admin_url', 'admin/User/index', '', '管理员', ''),  
364 -(110, 1, 'admin', 'admin_url', 'admin/User/add', '', '管理员添加', ''),  
365 -(111, 1, 'admin', 'admin_url', 'admin/User/addPost', '', '管理员添加提交', ''),  
366 -(112, 1, 'admin', 'admin_url', 'admin/User/edit', '', '管理员编辑', ''),  
367 -(113, 1, 'admin', 'admin_url', 'admin/User/editPost', '', '管理员编辑提交', ''),  
368 -(114, 1, 'admin', 'admin_url', 'admin/User/userInfo', '', '个人信息', ''),  
369 -(115, 1, 'admin', 'admin_url', 'admin/User/userInfoPost', '', '管理员个人信息修改提交', ''),  
370 -(116, 1, 'admin', 'admin_url', 'admin/User/delete', '', '管理员删除', ''),  
371 -(117, 1, 'admin', 'admin_url', 'admin/User/ban', '', '停用管理员', ''),  
372 -(118, 1, 'admin', 'admin_url', 'admin/User/cancelBan', '', '启用管理员', ''),  
373 -(119, 1, 'portal', 'admin_url', 'portal/AdminArticle/index', '', '文章管理', ''),  
374 -(120, 1, 'portal', 'admin_url', 'portal/AdminArticle/add', '', '添加文章', ''),  
375 -(121, 1, 'portal', 'admin_url', 'portal/AdminArticle/addPost', '', '添加文章提交', ''),  
376 -(122, 1, 'portal', 'admin_url', 'portal/AdminArticle/edit', '', '编辑文章', ''),  
377 -(123, 1, 'portal', 'admin_url', 'portal/AdminArticle/editPost', '', '编辑文章提交', ''),  
378 -(124, 1, 'portal', 'admin_url', 'portal/AdminArticle/delete', '', '文章删除', ''),  
379 -(125, 1, 'portal', 'admin_url', 'portal/AdminArticle/publish', '', '文章发布', ''),  
380 -(126, 1, 'portal', 'admin_url', 'portal/AdminArticle/top', '', '文章置顶', ''),  
381 -(127, 1, 'portal', 'admin_url', 'portal/AdminArticle/recommend', '', '文章推荐', ''),  
382 -(128, 1, 'portal', 'admin_url', 'portal/AdminArticle/listOrder', '', '文章排序', ''),  
383 -(129, 1, 'portal', 'admin_url', 'portal/AdminCategory/index', '', '分类管理', ''),  
384 -(130, 1, 'portal', 'admin_url', 'portal/AdminCategory/add', '', '添加文章分类', ''),  
385 -(131, 1, 'portal', 'admin_url', 'portal/AdminCategory/addPost', '', '添加文章分类提交', ''),  
386 -(132, 1, 'portal', 'admin_url', 'portal/AdminCategory/edit', '', '编辑文章分类', ''),  
387 -(133, 1, 'portal', 'admin_url', 'portal/AdminCategory/editPost', '', '编辑文章分类提交', ''),  
388 -(134, 1, 'portal', 'admin_url', 'portal/AdminCategory/select', '', '文章分类选择对话框', ''),  
389 -(135, 1, 'portal', 'admin_url', 'portal/AdminCategory/listOrder', '', '文章分类排序', ''),  
390 -(136, 1, 'portal', 'admin_url', 'portal/AdminCategory/delete', '', '删除文章分类', ''),  
391 -(137, 1, 'portal', 'admin_url', 'portal/AdminIndex/default', '', '门户管理', ''),  
392 -(138, 1, 'portal', 'admin_url', 'portal/AdminPage/index', '', '页面管理', ''),  
393 -(139, 1, 'portal', 'admin_url', 'portal/AdminPage/add', '', '添加页面', ''),  
394 -(140, 1, 'portal', 'admin_url', 'portal/AdminPage/addPost', '', '添加页面提交', ''),  
395 -(141, 1, 'portal', 'admin_url', 'portal/AdminPage/edit', '', '编辑页面', ''),  
396 -(142, 1, 'portal', 'admin_url', 'portal/AdminPage/editPost', '', '编辑页面提交', ''),  
397 -(143, 1, 'portal', 'admin_url', 'portal/AdminPage/delete', '', '删除页面', ''),  
398 -(144, 1, 'portal', 'admin_url', 'portal/AdminTag/index', '', '文章标签', ''),  
399 -(145, 1, 'portal', 'admin_url', 'portal/AdminTag/add', '', '添加文章标签', ''),  
400 -(146, 1, 'portal', 'admin_url', 'portal/AdminTag/addPost', '', '添加文章标签提交', ''),  
401 -(147, 1, 'portal', 'admin_url', 'portal/AdminTag/upStatus', '', '更新标签状态', ''),  
402 -(148, 1, 'portal', 'admin_url', 'portal/AdminTag/delete', '', '删除文章标签', ''),  
403 -(149, 1, 'user', 'admin_url', 'user/AdminAsset/index', '', '资源管理', ''),  
404 -(150, 1, 'user', 'admin_url', 'user/AdminAsset/delete', '', '删除文件', ''),  
405 -(151, 1, 'user', 'admin_url', 'user/AdminIndex/default', '', '用户管理', ''),  
406 -(152, 1, 'user', 'admin_url', 'user/AdminIndex/default1', '', '用户组', ''),  
407 -(153, 1, 'user', 'admin_url', 'user/AdminIndex/index', '', '本站用户', ''),  
408 -(154, 1, 'user', 'admin_url', 'user/AdminIndex/ban', '', '本站用户拉黑', ''),  
409 -(155, 1, 'user', 'admin_url', 'user/AdminIndex/cancelBan', '', '本站用户启用', ''),  
410 -(156, 1, 'user', 'admin_url', 'user/AdminOauth/index', '', '第三方用户', ''),  
411 -(157, 1, 'user', 'admin_url', 'user/AdminOauth/delete', '', '删除第三方用户绑定', ''),  
412 -(158, 1, 'user', 'admin_url', 'user/AdminUserAction/index', '', '用户操作管理', ''),  
413 -(159, 1, 'user', 'admin_url', 'user/AdminUserAction/edit', '', '编辑用户操作', ''),  
414 -(160, 1, 'user', 'admin_url', 'user/AdminUserAction/editPost', '', '编辑用户操作提交', ''),  
415 -(161, 1, 'user', 'admin_url', 'user/AdminUserAction/sync', '', '同步用户操作', '');  
416 -  
417 --- --------------------------------------------------------  
418 -  
419 ---  
420 --- 表的结构 `cmf_comment`  
421 ---  
422 -  
423 -CREATE TABLE IF NOT EXISTS `cmf_comment` (  
424 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
425 - `parent_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '被回复的评论id',  
426 - `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '发表评论的用户id',  
427 - `to_user_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '被评论的用户id',  
428 - `object_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '评论内容 id',  
429 - `like_count` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '点赞数',  
430 - `dislike_count` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '不喜欢数',  
431 - `floor` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '楼层数',  
432 - `create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '评论时间',  
433 - `delete_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间',  
434 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:已审核,0:未审核',  
435 - `type` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '评论类型;1实名评论',  
436 - `table_name` varchar(64) NOT NULL DEFAULT '' COMMENT '评论内容所在表,不带表前缀',  
437 - `full_name` varchar(50) NOT NULL DEFAULT '' COMMENT '评论者昵称',  
438 - `email` varchar(255) NOT NULL DEFAULT '' COMMENT '评论者邮箱',  
439 - `path` varchar(255) NOT NULL DEFAULT '' COMMENT '层级关系',  
440 - `url` text COMMENT '原文地址',  
441 - `content` text CHARACTER SET utf8mb4 COMMENT '评论内容',  
442 - `more` text CHARACTER SET utf8mb4 COMMENT '扩展属性',  
443 - PRIMARY KEY (`id`),  
444 - KEY `table_id_status` (`table_name`,`object_id`,`status`),  
445 - KEY `object_id` (`object_id`) USING BTREE,  
446 - KEY `status` (`status`) USING BTREE,  
447 - KEY `parent_id` (`parent_id`) USING BTREE,  
448 - KEY `create_time` (`create_time`) USING BTREE  
449 -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='评论表';  
450 -  
451 --- --------------------------------------------------------  
452 -  
453 ---  
454 --- 表的结构 `cmf_hook`  
455 ---  
456 -  
457 -CREATE TABLE IF NOT EXISTS `cmf_hook` (  
458 - `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,  
459 - `type` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '钩子类型(1:系统钩子;2:应用钩子;3:模板钩子;4:后台模板钩子)',  
460 - `once` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否只允许一个插件运行(0:多个;1:一个)',  
461 - `name` varchar(50) NOT NULL DEFAULT '' COMMENT '钩子名称',  
462 - `hook` varchar(50) NOT NULL DEFAULT '' COMMENT '钩子',  
463 - `app` varchar(15) NOT NULL DEFAULT '' COMMENT '应用名(只有应用钩子才用)',  
464 - `description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述',  
465 - PRIMARY KEY (`id`)  
466 -) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COMMENT='系统钩子表';  
467 -  
468 ---  
469 --- 转存表中的数据 `cmf_hook`  
470 ---  
471 -  
472 -INSERT INTO `cmf_hook` (`id`, `type`, `once`, `name`, `hook`, `app`, `description`) VALUES  
473 -(1, 1, 0, '应用初始化', 'app_init', 'cmf', '应用初始化'),  
474 -(2, 1, 0, '应用开始', 'app_begin', 'cmf', '应用开始'),  
475 -(3, 1, 0, '模块初始化', 'module_init', 'cmf', '模块初始化'),  
476 -(4, 1, 0, '控制器开始', 'action_begin', 'cmf', '控制器开始'),  
477 -(5, 1, 0, '视图输出过滤', 'view_filter', 'cmf', '视图输出过滤'),  
478 -(6, 1, 0, '应用结束', 'app_end', 'cmf', '应用结束'),  
479 -(7, 1, 0, '日志write方法', 'log_write', 'cmf', '日志write方法'),  
480 -(8, 1, 0, '输出结束', 'response_end', 'cmf', '输出结束'),  
481 -(9, 1, 0, '后台控制器初始化', 'admin_init', 'cmf', '后台控制器初始化'),  
482 -(10, 1, 0, '前台控制器初始化', 'home_init', 'cmf', '前台控制器初始化'),  
483 -(11, 1, 1, '发送手机验证码', 'send_mobile_verification_code', 'cmf', '发送手机验证码'),  
484 -(12, 3, 0, '模板 body标签开始', 'body_start', '', '模板 body标签开始'),  
485 -(13, 3, 0, '模板 head标签结束前', 'before_head_end', '', '模板 head标签结束前'),  
486 -(14, 3, 0, '模板底部开始', 'footer_start', '', '模板底部开始'),  
487 -(15, 3, 0, '模板底部开始之前', 'before_footer', '', '模板底部开始之前'),  
488 -(16, 3, 0, '模板底部结束之前', 'before_footer_end', '', '模板底部结束之前'),  
489 -(17, 3, 0, '模板 body 标签结束之前', 'before_body_end', '', '模板 body 标签结束之前'),  
490 -(18, 3, 0, '模板左边栏开始', 'left_sidebar_start', '', '模板左边栏开始'),  
491 -(19, 3, 0, '模板左边栏结束之前', 'before_left_sidebar_end', '', '模板左边栏结束之前'),  
492 -(20, 3, 0, '模板右边栏开始', 'right_sidebar_start', '', '模板右边栏开始'),  
493 -(21, 3, 0, '模板右边栏结束之前', 'before_right_sidebar_end', '', '模板右边栏结束之前'),  
494 -(22, 3, 1, '评论区', 'comment', '', '评论区'),  
495 -(23, 3, 1, '留言区', 'guestbook', '', '留言区'),  
496 -(24, 2, 0, '后台首页仪表盘', 'admin_dashboard', 'admin', '后台首页仪表盘'),  
497 -(25, 4, 0, '后台模板 head标签结束前', 'admin_before_head_end', '', '后台模板 head标签结束前'),  
498 -(26, 4, 0, '后台模板 body 标签结束之前', 'admin_before_body_end', '', '后台模板 body 标签结束之前'),  
499 -(27, 2, 0, '后台登录页面', 'admin_login', 'admin', '后台登录页面'),  
500 -(28, 1, 1, '前台模板切换', 'switch_theme', 'cmf', '前台模板切换'),  
501 -(29, 3, 0, '主要内容之后', 'after_content', '', '主要内容之后'),  
502 -(30, 2, 0, '文章显示之前', 'portal_before_assign_article', 'portal', '文章显示之前'),  
503 -(31, 2, 0, '后台文章保存之后', 'portal_admin_after_save_article', 'portal', '后台文章保存之后'),  
504 -(32, 2, 1, '获取上传界面', 'fetch_upload_view', 'user', '获取上传界面'),  
505 -(33, 3, 0, '主要内容之前', 'before_content', 'cmf', '主要内容之前'),  
506 -(34, 1, 0, '日志写入完成', 'log_write_done', 'cmf', '日志写入完成'),  
507 -(35, 1, 1, '后台模板切换', 'switch_admin_theme', 'cmf', '后台模板切换');  
508 -  
509 --- --------------------------------------------------------  
510 -  
511 ---  
512 --- 表的结构 `cmf_hook_plugin`  
513 ---  
514 -  
515 -CREATE TABLE IF NOT EXISTS `cmf_hook_plugin` (  
516 - `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,  
517 - `list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',  
518 - `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态(0:禁用,1:启用)',  
519 - `hook` varchar(50) NOT NULL DEFAULT '' COMMENT '钩子名',  
520 - `plugin` varchar(50) NOT NULL DEFAULT '' COMMENT '插件',  
521 - PRIMARY KEY (`id`)  
522 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统钩子插件表';  
523 -  
524 --- --------------------------------------------------------  
525 -  
526 ---  
527 --- 表的结构 `cmf_link`  
528 ---  
529 -  
530 -CREATE TABLE IF NOT EXISTS `cmf_link` (  
531 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
532 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态;1:显示;0:不显示',  
533 - `rating` int(11) NOT NULL DEFAULT '0' COMMENT '友情链接评级',  
534 - `list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',  
535 - `description` varchar(255) NOT NULL DEFAULT '' COMMENT '友情链接描述',  
536 - `url` varchar(255) NOT NULL DEFAULT '' COMMENT '友情链接地址',  
537 - `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '友情链接名称',  
538 - `image` varchar(100) NOT NULL DEFAULT '' COMMENT '友情链接图标',  
539 - `target` varchar(10) NOT NULL DEFAULT '' COMMENT '友情链接打开方式',  
540 - `rel` varchar(50) NOT NULL DEFAULT '' COMMENT '链接与网站的关系',  
541 - PRIMARY KEY (`id`),  
542 - KEY `status` (`status`)  
543 -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='友情链接表';  
544 -  
545 ---  
546 --- 转存表中的数据 `cmf_link`  
547 ---  
548 -  
549 -INSERT INTO `cmf_link` (`id`, `status`, `rating`, `list_order`, `description`, `url`, `name`, `image`, `target`, `rel`) VALUES  
550 -(1, 1, 1, 8, 'thinkcmf官网', 'http://www.thinkcmf.com', 'ThinkCMF', '', '_blank', '');  
551 -  
552 --- --------------------------------------------------------  
553 -  
554 ---  
555 --- 表的结构 `cmf_nav`  
556 ---  
557 -  
558 -CREATE TABLE IF NOT EXISTS `cmf_nav` (  
559 - `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,  
560 - `is_main` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '是否为主导航;1:是;0:不是',  
561 - `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '导航位置名称',  
562 - `remark` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '备注',  
563 - PRIMARY KEY (`id`)  
564 -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='前台导航位置表';  
565 -  
566 ---  
567 --- 转存表中的数据 `cmf_nav`  
568 ---  
569 -  
570 -INSERT INTO `cmf_nav` (`id`, `is_main`, `name`, `remark`) VALUES  
571 -(1, 1, '主导航', '主导航'),  
572 -(2, 0, '底部导航', '');  
573 -  
574 --- --------------------------------------------------------  
575 -  
576 ---  
577 --- 表的结构 `cmf_nav_menu`  
578 ---  
579 -  
580 -CREATE TABLE IF NOT EXISTS `cmf_nav_menu` (  
581 - `id` int(11) NOT NULL AUTO_INCREMENT,  
582 - `nav_id` int(11) NOT NULL COMMENT '导航 id',  
583 - `parent_id` int(11) NOT NULL COMMENT '父 id',  
584 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态;1:显示;0:隐藏',  
585 - `list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',  
586 - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '菜单名称',  
587 - `target` varchar(10) NOT NULL DEFAULT '' COMMENT '打开方式',  
588 - `href` varchar(100) NOT NULL DEFAULT '' COMMENT '链接',  
589 - `icon` varchar(20) NOT NULL DEFAULT '' COMMENT '图标',  
590 - `path` varchar(255) NOT NULL DEFAULT '' COMMENT '层级关系',  
591 - PRIMARY KEY (`id`)  
592 -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='前台导航菜单表';  
593 -  
594 ---  
595 --- 转存表中的数据 `cmf_nav_menu`  
596 ---  
597 -  
598 -INSERT INTO `cmf_nav_menu` (`id`, `nav_id`, `parent_id`, `status`, `list_order`, `name`, `target`, `href`, `icon`, `path`) VALUES  
599 -(1, 1, 0, 1, 0, '首页', '', 'home', '', '0-1');  
600 -  
601 --- --------------------------------------------------------  
602 -  
603 ---  
604 --- 表的结构 `cmf_option`  
605 ---  
606 -  
607 -CREATE TABLE IF NOT EXISTS `cmf_option` (  
608 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
609 - `autoload` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '是否自动加载;1:自动加载;0:不自动加载',  
610 - `option_name` varchar(64) NOT NULL DEFAULT '' COMMENT '配置名',  
611 - `option_value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '配置值',  
612 - PRIMARY KEY (`id`),  
613 - UNIQUE KEY `option_name` (`option_name`)  
614 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='全站配置表' ROW_FORMAT=COMPACT;  
615 -  
616 --- --------------------------------------------------------  
617 -  
618 ---  
619 --- 表的结构 `cmf_plugin`  
620 ---  
621 -  
622 -CREATE TABLE IF NOT EXISTS `cmf_plugin` (  
623 - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增id',  
624 - `type` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '插件类型;1:网站;8:微信',  
625 - `has_admin` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否有后台管理,0:没有;1:有',  
626 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态;1:开启;0:禁用',  
627 - `create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '插件安装时间',  
628 - `name` varchar(50) NOT NULL DEFAULT '' COMMENT '插件标识名,英文字母(惟一)',  
629 - `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '插件名称',  
630 - `demo_url` varchar(50) NOT NULL DEFAULT '' COMMENT '演示地址,带协议',  
631 - `hooks` varchar(255) NOT NULL DEFAULT '' COMMENT '实现的钩子;以“,”分隔',  
632 - `author` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '插件作者',  
633 - `author_url` varchar(50) NOT NULL DEFAULT '' COMMENT '作者网站链接',  
634 - `version` varchar(20) NOT NULL DEFAULT '' COMMENT '插件版本号',  
635 - `description` varchar(255) NOT NULL COMMENT '插件描述',  
636 - `config` text COMMENT '插件配置',  
637 - PRIMARY KEY (`id`)  
638 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='插件表';  
639 -  
640 --- --------------------------------------------------------  
641 -  
642 ---  
643 --- 表的结构 `cmf_portal_category`  
644 ---  
645 -  
646 -CREATE TABLE IF NOT EXISTS `cmf_portal_category` (  
647 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '分类id',  
648 - `parent_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '分类父id',  
649 - `post_count` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '分类文章数',  
650 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:发布,0:不发布',  
651 - `delete_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间',  
652 - `list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',  
653 - `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '分类名称',  
654 - `description` varchar(255) NOT NULL DEFAULT '' COMMENT '分类描述',  
655 - `path` varchar(255) NOT NULL DEFAULT '' COMMENT '分类层级关系路径',  
656 - `seo_title` varchar(100) NOT NULL DEFAULT '',  
657 - `seo_keywords` varchar(255) NOT NULL DEFAULT '',  
658 - `seo_description` varchar(255) NOT NULL DEFAULT '',  
659 - `list_tpl` varchar(50) NOT NULL DEFAULT '' COMMENT '分类列表模板',  
660 - `one_tpl` varchar(50) NOT NULL DEFAULT '' COMMENT '分类文章页模板',  
661 - `more` text COMMENT '扩展属性',  
662 - PRIMARY KEY (`id`)  
663 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='portal应用 文章分类表';  
664 -  
665 --- --------------------------------------------------------  
666 -  
667 ---  
668 --- 表的结构 `cmf_portal_category_post`  
669 ---  
670 -  
671 -CREATE TABLE IF NOT EXISTS `cmf_portal_category_post` (  
672 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
673 - `post_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '文章id',  
674 - `category_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '分类id',  
675 - `list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',  
676 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:发布;0:不发布',  
677 - PRIMARY KEY (`id`),  
678 - KEY `term_taxonomy_id` (`category_id`)  
679 -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='portal应用 分类文章对应表';  
680 -  
681 --- --------------------------------------------------------  
682 -  
683 ---  
684 --- 表的结构 `cmf_portal_post`  
685 ---  
686 -  
687 -CREATE TABLE IF NOT EXISTS `cmf_portal_post` (  
688 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
689 - `parent_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '父级id',  
690 - `post_type` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '类型,1:文章;2:页面',  
691 - `post_format` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '内容格式;1:html;2:md',  
692 - `user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '发表者用户id',  
693 - `post_status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态;1:已发布;0:未发布;',  
694 - `comment_status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '评论状态;1:允许;0:不允许',  
695 - `is_top` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否置顶;1:置顶;0:不置顶',  
696 - `recommended` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否推荐;1:推荐;0:不推荐',  
697 - `post_hits` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '查看数',  
698 - `post_like` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '点赞数',  
699 - `comment_count` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '评论数',  
700 - `create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',  
701 - `update_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '更新时间',  
702 - `published_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '发布时间',  
703 - `delete_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间',  
704 - `post_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'post标题',  
705 - `post_keywords` varchar(150) NOT NULL DEFAULT '' COMMENT 'seo keywords',  
706 - `post_excerpt` varchar(500) NOT NULL DEFAULT '' COMMENT 'post摘要',  
707 - `post_source` varchar(150) NOT NULL DEFAULT '' COMMENT '转载文章的来源',  
708 - `post_content` text COMMENT '文章内容',  
709 - `post_content_filtered` text COMMENT '处理过的文章内容',  
710 - `more` text COMMENT '扩展属性,如缩略图;格式为json',  
711 - PRIMARY KEY (`id`),  
712 - KEY `type_status_date` (`post_type`,`post_status`,`create_time`,`id`),  
713 - KEY `parent_id` (`parent_id`),  
714 - KEY `user_id` (`user_id`),  
715 - KEY `create_time` (`create_time`) USING BTREE  
716 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='portal应用 文章表' ROW_FORMAT=COMPACT;  
717 -  
718 --- --------------------------------------------------------  
719 -  
720 ---  
721 --- 表的结构 `cmf_portal_tag`  
722 ---  
723 -  
724 -CREATE TABLE IF NOT EXISTS `cmf_portal_tag` (  
725 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '分类id',  
726 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:发布,0:不发布',  
727 - `recommended` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否推荐;1:推荐;0:不推荐',  
728 - `post_count` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '标签文章数',  
729 - `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '标签名称',  
730 - PRIMARY KEY (`id`)  
731 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='portal应用 文章标签表';  
732 -  
733 --- --------------------------------------------------------  
734 -  
735 ---  
736 --- 表的结构 `cmf_portal_tag_post`  
737 ---  
738 -  
739 -CREATE TABLE IF NOT EXISTS `cmf_portal_tag_post` (  
740 - `id` bigint(20) NOT NULL AUTO_INCREMENT,  
741 - `tag_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '标签 id',  
742 - `post_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '文章 id',  
743 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:发布;0:不发布',  
744 - PRIMARY KEY (`id`),  
745 - KEY `post_id` (`post_id`)  
746 -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='portal应用 标签文章对应表';  
747 -  
748 --- --------------------------------------------------------  
749 -  
750 ---  
751 --- 表的结构 `cmf_recycle_bin`  
752 ---  
753 -  
754 -CREATE TABLE IF NOT EXISTS `cmf_recycle_bin` (  
755 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
756 - `object_id` int(11) DEFAULT '0' COMMENT '删除内容 id',  
757 - `create_time` int(10) UNSIGNED DEFAULT '0' COMMENT '创建时间',  
758 - `table_name` varchar(60) DEFAULT '' COMMENT '删除内容所在表名',  
759 - `name` varchar(255) DEFAULT '' COMMENT '删除内容名称',  
760 - `user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户id',  
761 - PRIMARY KEY (`id`)  
762 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=' 回收站';  
763 -  
764 --- --------------------------------------------------------  
765 -  
766 ---  
767 --- 表的结构 `cmf_role`  
768 ---  
769 -  
770 -CREATE TABLE IF NOT EXISTS `cmf_role` (  
771 - `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,  
772 - `parent_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '父角色ID',  
773 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '状态;0:禁用;1:正常',  
774 - `create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',  
775 - `update_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '更新时间',  
776 - `list_order` float NOT NULL DEFAULT '0' COMMENT '排序',  
777 - `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '角色名称',  
778 - `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',  
779 - PRIMARY KEY (`id`),  
780 - KEY `parent_id` (`parent_id`),  
781 - KEY `status` (`status`)  
782 -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='角色表';  
783 -  
784 ---  
785 --- 转存表中的数据 `cmf_role`  
786 ---  
787 -  
788 -INSERT INTO `cmf_role` (`id`, `parent_id`, `status`, `create_time`, `update_time`, `list_order`, `name`, `remark`) VALUES  
789 -(1, 0, 1, 1329633709, 1329633709, 0, '超级管理员', '拥有网站最高管理员权限!'),  
790 -(2, 0, 1, 1329633709, 1329633709, 0, '普通管理员', '权限由最高管理员分配!');  
791 -  
792 --- --------------------------------------------------------  
793 -  
794 ---  
795 --- 表的结构 `cmf_role_user`  
796 ---  
797 -  
798 -CREATE TABLE IF NOT EXISTS `cmf_role_user` (  
799 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
800 - `role_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '角色 id',  
801 - `user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户id',  
802 - PRIMARY KEY (`id`),  
803 - KEY `role_id` (`role_id`),  
804 - KEY `user_id` (`user_id`)  
805 -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户角色对应表';  
806 -  
807 --- --------------------------------------------------------  
808 -  
809 ---  
810 --- 表的结构 `cmf_route`  
811 ---  
812 -  
813 -CREATE TABLE IF NOT EXISTS `cmf_route` (  
814 - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '路由id',  
815 - `list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',  
816 - `status` tinyint(2) NOT NULL DEFAULT '1' COMMENT '状态;1:启用,0:不启用',  
817 - `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT 'URL规则类型;1:用户自定义;2:别名添加',  
818 - `full_url` varchar(255) NOT NULL DEFAULT '' COMMENT '完整url',  
819 - `url` varchar(255) NOT NULL DEFAULT '' COMMENT '实际显示的url',  
820 - PRIMARY KEY (`id`)  
821 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='url路由表';  
822 -  
823 --- --------------------------------------------------------  
824 -  
825 ---  
826 --- 表的结构 `cmf_slide`  
827 ---  
828 -  
829 -CREATE TABLE IF NOT EXISTS `cmf_slide` (  
830 - `id` int(11) NOT NULL AUTO_INCREMENT,  
831 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:显示,0不显示',  
832 - `delete_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间',  
833 - `name` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '幻灯片分类',  
834 - `remark` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '分类备注',  
835 - PRIMARY KEY (`id`)  
836 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='幻灯片表';  
837 -  
838 --- --------------------------------------------------------  
839 -  
840 ---  
841 --- 表的结构 `cmf_slide_item`  
842 ---  
843 -  
844 -CREATE TABLE IF NOT EXISTS `cmf_slide_item` (  
845 - `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,  
846 - `slide_id` int(11) NOT NULL DEFAULT '0' COMMENT '幻灯片id',  
847 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:显示;0:隐藏',  
848 - `list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',  
849 - `title` varchar(50) NOT NULL DEFAULT '' COMMENT '幻灯片名称',  
850 - `image` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '幻灯片图片',  
851 - `url` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '幻灯片链接',  
852 - `target` varchar(10) NOT NULL DEFAULT '' COMMENT '友情链接打开方式',  
853 - `description` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '幻灯片描述',  
854 - `content` text CHARACTER SET utf8 COMMENT '幻灯片内容',  
855 - `more` text COMMENT '链接打开方式',  
856 - PRIMARY KEY (`id`),  
857 - KEY `slide_id` (`slide_id`)  
858 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='幻灯片子项表';  
859 -  
860 --- --------------------------------------------------------  
861 -  
862 ---  
863 --- 表的结构 `cmf_theme`  
864 ---  
865 -  
866 -CREATE TABLE IF NOT EXISTS `cmf_theme` (  
867 - `id` int(11) NOT NULL AUTO_INCREMENT,  
868 - `create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '安装时间',  
869 - `update_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '最后升级时间',  
870 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '模板状态,1:正在使用;0:未使用',  
871 - `is_compiled` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否为已编译模板',  
872 - `theme` varchar(20) NOT NULL DEFAULT '' COMMENT '主题目录名,用于主题的维一标识',  
873 - `name` varchar(20) NOT NULL DEFAULT '' COMMENT '主题名称',  
874 - `version` varchar(20) NOT NULL DEFAULT '' COMMENT '主题版本号',  
875 - `demo_url` varchar(50) NOT NULL DEFAULT '' COMMENT '演示地址,带协议',  
876 - `thumbnail` varchar(100) NOT NULL DEFAULT '' COMMENT '缩略图',  
877 - `author` varchar(20) NOT NULL DEFAULT '' COMMENT '主题作者',  
878 - `author_url` varchar(50) NOT NULL DEFAULT '' COMMENT '作者网站链接',  
879 - `lang` varchar(10) NOT NULL DEFAULT '' COMMENT '支持语言',  
880 - `keywords` varchar(50) NOT NULL DEFAULT '' COMMENT '主题关键字',  
881 - `description` varchar(100) NOT NULL DEFAULT '' COMMENT '主题描述',  
882 - PRIMARY KEY (`id`)  
883 -) ENGINE=InnoDB DEFAULT CHARSET=utf8;  
884 -  
885 --- --------------------------------------------------------  
886 -  
887 ---  
888 --- 表的结构 `cmf_theme_file`  
889 ---  
890 -  
891 -CREATE TABLE IF NOT EXISTS `cmf_theme_file` (  
892 - `id` int(11) NOT NULL AUTO_INCREMENT,  
893 - `is_public` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否公共的模板文件',  
894 - `list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',  
895 - `theme` varchar(20) NOT NULL DEFAULT '' COMMENT '模板名称',  
896 - `name` varchar(20) NOT NULL DEFAULT '' COMMENT '模板文件名',  
897 - `action` varchar(50) NOT NULL DEFAULT '' COMMENT '操作',  
898 - `file` varchar(50) NOT NULL DEFAULT '' COMMENT '模板文件,相对于模板根目录,如Portal/index.html',  
899 - `description` varchar(100) NOT NULL DEFAULT '' COMMENT '模板文件描述',  
900 - `more` text COMMENT '模板更多配置,用户自己后台设置的',  
901 - `config_more` text COMMENT '模板更多配置,来源模板的配置文件',  
902 - `draft_more` text COMMENT '模板更多配置,用户临时保存的配置',  
903 - PRIMARY KEY (`id`)  
904 -) ENGINE=InnoDB DEFAULT CHARSET=utf8;  
905 -  
906 --- --------------------------------------------------------  
907 -  
908 ---  
909 --- 表的结构 `cmf_third_party_user`  
910 ---  
911 -  
912 -CREATE TABLE IF NOT EXISTS `cmf_third_party_user` (  
913 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
914 - `user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '本站用户id',  
915 - `last_login_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '最后登录时间',  
916 - `expire_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'access_token过期时间',  
917 - `create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '绑定时间',  
918 - `login_times` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '登录次数',  
919 - `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态;1:正常;0:禁用',  
920 - `nickname` varchar(50) NOT NULL DEFAULT '' COMMENT '用户昵称',  
921 - `third_party` varchar(20) NOT NULL DEFAULT '' COMMENT '第三方惟一码',  
922 - `app_id` varchar(64) NOT NULL DEFAULT '' COMMENT '第三方应用 id',  
923 - `last_login_ip` varchar(15) NOT NULL DEFAULT '' COMMENT '最后登录ip',  
924 - `access_token` varchar(512) NOT NULL DEFAULT '' COMMENT '第三方授权码',  
925 - `openid` varchar(40) NOT NULL DEFAULT '' COMMENT '第三方用户id',  
926 - `union_id` varchar(64) NOT NULL DEFAULT '' COMMENT '第三方用户多个产品中的惟一 id,(如:微信平台)',  
927 - `more` text COMMENT '扩展信息',  
928 - PRIMARY KEY (`id`)  
929 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='第三方用户表';  
930 -  
931 --- --------------------------------------------------------  
932 -  
933 ---  
934 --- 表的结构 `cmf_user`  
935 ---  
936 -  
937 -CREATE TABLE IF NOT EXISTS `cmf_user` (  
938 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
939 - `user_type` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '用户类型;1:admin;2:会员',  
940 - `sex` tinyint(2) NOT NULL DEFAULT '0' COMMENT '性别;0:保密,1:男,2:女',  
941 - `birthday` int(11) NOT NULL DEFAULT '0' COMMENT '生日',  
942 - `last_login_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后登录时间',  
943 - `score` int(11) NOT NULL DEFAULT '0' COMMENT '用户积分',  
944 - `coin` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '金币',  
945 - `balance` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '余额',  
946 - `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '注册时间',  
947 - `user_status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '用户状态;0:禁用,1:正常,2:未验证',  
948 - `user_login` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '用户名',  
949 - `user_pass` varchar(64) NOT NULL DEFAULT '' COMMENT '登录密码;cmf_password加密',  
950 - `user_nickname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '用户昵称',  
951 - `user_email` varchar(100) NOT NULL DEFAULT '' COMMENT '用户登录邮箱',  
952 - `user_url` varchar(100) NOT NULL DEFAULT '' COMMENT '用户个人网址',  
953 - `avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '用户头像',  
954 - `signature` varchar(255) NOT NULL DEFAULT '' COMMENT '个性签名',  
955 - `last_login_ip` varchar(15) NOT NULL DEFAULT '' COMMENT '最后登录ip',  
956 - `user_activation_key` varchar(60) NOT NULL DEFAULT '' COMMENT '激活码',  
957 - `mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '用户手机号',  
958 - `more` text COMMENT '扩展属性',  
959 - PRIMARY KEY (`id`),  
960 - KEY `user_login` (`user_login`),  
961 - KEY `user_nickname` (`user_nickname`)  
962 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';  
963 -  
964 --- --------------------------------------------------------  
965 -  
966 ---  
967 --- 表的结构 `cmf_user_action`  
968 ---  
969 -  
970 -CREATE TABLE IF NOT EXISTS `cmf_user_action` (  
971 - `id` int(11) NOT NULL AUTO_INCREMENT,  
972 - `score` int(11) NOT NULL DEFAULT '0' COMMENT '更改积分,可以为负',  
973 - `coin` int(11) NOT NULL DEFAULT '0' COMMENT '更改金币,可以为负',  
974 - `reward_number` int(11) NOT NULL DEFAULT '0' COMMENT '奖励次数',  
975 - `cycle_type` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '周期类型;0:不限;1:按天;2:按小时;3:永久',  
976 - `cycle_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '周期时间值',  
977 - `name` varchar(50) NOT NULL DEFAULT '' COMMENT '用户操作名称',  
978 - `action` varchar(50) NOT NULL DEFAULT '' COMMENT '用户操作名称',  
979 - `app` varchar(50) NOT NULL DEFAULT '' COMMENT '操作所在应用名或插件名等',  
980 - `url` text COMMENT '执行操作的url',  
981 - PRIMARY KEY (`id`)  
982 -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='用户操作表';  
983 -  
984 ---  
985 --- 转存表中的数据 `cmf_user_action`  
986 ---  
987 -  
988 -INSERT INTO `cmf_user_action` VALUES ('1', '1', '1', '1', '2', '1', '用户登录', 'login', 'user', '');  
989 -  
990 --- --------------------------------------------------------  
991 -  
992 ---  
993 --- 表的结构 `cmf_user_action_log`  
994 ---  
995 -  
996 -CREATE TABLE IF NOT EXISTS `cmf_user_action_log` (  
997 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
998 - `user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户id',  
999 - `count` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '访问次数',  
1000 - `last_visit_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '最后访问时间',  
1001 - `object` varchar(100) NOT NULL DEFAULT '' COMMENT '访问对象的id,格式:不带前缀的表名+id;如posts1表示xx_posts表里id为1的记录',  
1002 - `action` varchar(50) NOT NULL DEFAULT '' COMMENT '操作名称;格式:应用名+控制器+操作名,也可自己定义格式只要不发生冲突且惟一;',  
1003 - `ip` varchar(15) NOT NULL DEFAULT '' COMMENT '用户ip',  
1004 - PRIMARY KEY (`id`),  
1005 - KEY `user_object_action` (`user_id`,`object`,`action`),  
1006 - KEY `user_object_action_ip` (`user_id`,`object`,`action`,`ip`)  
1007 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='访问记录表';  
1008 -  
1009 --- --------------------------------------------------------  
1010 -  
1011 ---  
1012 --- 表的结构 `cmf_user_balance_log`  
1013 ---  
1014 -  
1015 -CREATE TABLE IF NOT EXISTS `cmf_user_balance_log` (  
1016 - `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,  
1017 - `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '用户 id',  
1018 - `create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',  
1019 - `change` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '更改余额',  
1020 - `balance` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '更改后余额',  
1021 - `description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述',  
1022 - `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',  
1023 - PRIMARY KEY (`id`)  
1024 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户余额变更日志表';  
1025 -  
1026 --- --------------------------------------------------------  
1027 -  
1028 ---  
1029 --- 表的结构 `cmf_user_favorite`  
1030 ---  
1031 -  
1032 -CREATE TABLE IF NOT EXISTS `cmf_user_favorite` (  
1033 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
1034 - `user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户 id',  
1035 - `title` varchar(100) NOT NULL DEFAULT '' COMMENT '收藏内容的标题',  
1036 - `url` varchar(255) CHARACTER SET utf8 DEFAULT '' COMMENT '收藏内容的原文地址,不带域名',  
1037 - `description` varchar(500) CHARACTER SET utf8 DEFAULT '' COMMENT '收藏内容的描述',  
1038 - `table_name` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '收藏实体以前所在表,不带前缀',  
1039 - `object_id` int(10) UNSIGNED DEFAULT '0' COMMENT '收藏内容原来的主键id',  
1040 - `create_time` int(10) UNSIGNED DEFAULT '0' COMMENT '收藏时间',  
1041 - PRIMARY KEY (`id`),  
1042 - KEY `uid` (`user_id`)  
1043 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户收藏表';  
1044 -  
1045 --- --------------------------------------------------------  
1046 -  
1047 ---  
1048 --- 表的结构 `cmf_user_login_attempt`  
1049 ---  
1050 -  
1051 -CREATE TABLE IF NOT EXISTS `cmf_user_login_attempt` (  
1052 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,  
1053 - `login_attempts` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '尝试次数',  
1054 - `attempt_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '尝试登录时间',  
1055 - `locked_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '锁定时间',  
1056 - `ip` varchar(15) NOT NULL DEFAULT '' COMMENT '用户 ip',  
1057 - `account` varchar(100) NOT NULL DEFAULT '' COMMENT '用户账号,手机号,邮箱或用户名',  
1058 - PRIMARY KEY (`id`)  
1059 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户登录尝试表' ROW_FORMAT=COMPACT;  
1060 -  
1061 --- --------------------------------------------------------  
1062 -  
1063 ---  
1064 --- 表的结构 `cmf_user_score_log`  
1065 ---  
1066 -  
1067 -CREATE TABLE IF NOT EXISTS `cmf_user_score_log` (  
1068 - `id` int(11) NOT NULL AUTO_INCREMENT,  
1069 - `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '用户 id',  
1070 - `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',  
1071 - `action` varchar(50) NOT NULL DEFAULT '' COMMENT '用户操作名称',  
1072 - `score` int(11) NOT NULL DEFAULT '0' COMMENT '更改积分,可以为负',  
1073 - `coin` int(11) NOT NULL DEFAULT '0' COMMENT '更改金币,可以为负',  
1074 - PRIMARY KEY (`id`)  
1075 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户操作积分等奖励日志表';  
1076 -  
1077 --- --------------------------------------------------------  
1078 -  
1079 ---  
1080 --- 表的结构 `cmf_user_token`  
1081 ---  
1082 -  
1083 -CREATE TABLE IF NOT EXISTS `cmf_user_token` (  
1084 - `id` bigint(20) NOT NULL AUTO_INCREMENT,  
1085 - `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '用户id',  
1086 - `expire_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT ' 过期时间',  
1087 - `create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',  
1088 - `token` varchar(64) NOT NULL DEFAULT '' COMMENT 'token',  
1089 - `device_type` varchar(10) NOT NULL DEFAULT '' COMMENT '设备类型;mobile,android,iphone,ipad,web,pc,mac,wxapp',  
1090 - PRIMARY KEY (`id`)  
1091 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户客户端登录 token 表';  
1092 -  
1093 --- --------------------------------------------------------  
1094 -  
1095 ---  
1096 --- 表的结构 `cmf_verification_code`  
1097 ---  
1098 -  
1099 -CREATE TABLE IF NOT EXISTS `cmf_verification_code` (  
1100 - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '表id',  
1101 - `count` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '当天已经发送成功的次数',  
1102 - `send_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '最后发送成功时间',  
1103 - `expire_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '验证码过期时间',  
1104 - `code` varchar(8) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '最后发送成功的验证码',  
1105 - `account` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '手机号或者邮箱',  
1106 - PRIMARY KEY (`id`)  
1107 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='手机邮箱数字验证码表';  
1 -<?php  
2 -// +----------------------------------------------------------------------  
3 -// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]  
4 -// +----------------------------------------------------------------------  
5 -// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.  
6 -// +----------------------------------------------------------------------  
7 -// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )  
8 -// +----------------------------------------------------------------------  
9 -// | Author: 老猫 <thinkcmf@126.com>  
10 -// +----------------------------------------------------------------------  
11 -return [  
12 - 'ACCEPT' => 'ACCEPT'  
13 -];  
1 -<?php  
2 -// +----------------------------------------------------------------------  
3 -// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]  
4 -// +----------------------------------------------------------------------  
5 -// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.  
6 -// +----------------------------------------------------------------------  
7 -// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )  
8 -// +----------------------------------------------------------------------  
9 -// | Author: 老猫 <thinkcmf@126.com>  
10 -// +----------------------------------------------------------------------  
11 -return [  
12 - 'ACCEPT' => '接 受'  
13 -];  
1 -<!doctype html>  
2 -<html>  
3 -<head>  
4 -<include file="public/head" />  
5 -</head>  
6 -<body>  
7 - <div class="wrap">  
8 - <include file="public/header" />  
9 - <div class="section">  
10 - <div class="main">  
11 - <pre class="agreement">ThinkCMF软件使用协议  
12 -  
13 -版权所有 ©2013-{:date("Y")},ThinkCMF开源社区  
14 -  
15 -感谢您选择ThinkCMF内容管理框架, 希望我们的产品能够帮您把网站发展的更快、更好、更强!  
16 -  
17 -ThinkCMF遵循Apache Lisense 2.0开源协议发布,并提供免费使用。  
18 -  
19 -ThinkCMF建站系统由简约风网络科技(以下简称简约风,官网http://www.thinkcmf.com)发起并开源发布。  
20 -简约风网络科技包含以下网站:  
21 -ThinkCMF官网: http://www.thinkcmf.com  
22 -  
23 -ThinkCMF免责声明  
24 - 1、使用ThinkCMF构建的网站的任何信息内容以及导致的任何版权纠纷和法律争议及后果,ThinkCMF官方不承担任何责任。  
25 - 2、您一旦安装使用ThinkCMF,即被视为完全理解并接受本协议的各项条款,在享有上述条款授予的权力的同时,受到相关的约束和限制。</pre>  
26 - </div>  
27 - <div class="bottom text-center">  
28 - <a href="__ROOT__/?s=install/index/step2" class="btn btn-primary">{:lang('ACCEPT')}</a>  
29 - </div>  
30 - </div>  
31 - </div>  
32 - <include file="public/footer" />  
33 -</body>  
34 -</html>  
1 -<div class="footer">  
2 - &copy; 2013-{:date('Y')} <a href="http://www.thinkcmf.com" target="_blank">ThinkCMF Team</a>  
3 -</div>  
1 -<meta charset="utf-8" />  
2 -<title>ThinkCMF安装</title>  
3 -<link rel="stylesheet" href="__STATIC__/install/simpleboot/themes/flat/theme.min.css" />  
4 -<link rel="stylesheet" href="__STATIC__/install/css/install.css" />  
5 -<link rel="stylesheet" href="__STATIC__/font-awesome/css/font-awesome.min.css" type="text/css">  
6 -  
1 -<div class="header">  
2 - <h1 class="logo">ThinkCMF 安装向导</h1>  
3 - <div class="version">{$Think.THINKCMF_VERSION}</div>  
4 -</div>  
1 -<!doctype html>  
2 -<html>  
3 -<head>  
4 - <include file="public/head"/>  
5 - <script src="__STATIC__/js/jquery.js"></script>  
6 - <style>  
7 - .rewrite-correct, .rewrite-error {  
8 - display: none;  
9 - }  
10 - </style>  
11 -</head>  
12 -<body>  
13 -<div class="wrap">  
14 - <include file="public/header"/>  
15 - <section class="section">  
16 - <div class="step">  
17 - <ul class="unstyled">  
18 - <li class="current"><em>1</em>检测环境</li>  
19 - <li><em>2</em>创建数据</li>  
20 - <li><em>3</em>完成安装</li>  
21 - </ul>  
22 - </div>  
23 - <div class="server">  
24 - <table width="100%">  
25 - <tr>  
26 - <td class="td1">环境检测</td>  
27 - <td class="td1" width="25%">推荐配置</td>  
28 - <td class="td1" width="25%">当前状态</td>  
29 - <td class="td1" width="25%">最低要求</td>  
30 - </tr>  
31 - <tr>  
32 - <td>操作系统</td>  
33 - <td>类UNIX</td>  
34 - <td><i class="fa fa-check correct"></i> {$os}</td>  
35 - <td>不限制</td>  
36 - </tr>  
37 - <tr>  
38 - <td>PHP版本</td>  
39 - <td>>5.6.x</td>  
40 - <td><i class="fa fa-check correct"></i> {$phpversion}</td>  
41 - <td>5.4.0</td>  
42 - </tr>  
43 - <!-- 模块检测 -->  
44 - <tr>  
45 - <td class="td1" colspan="4">  
46 - 模块检测  
47 - </td>  
48 - </tr>  
49 - <tr>  
50 - <td>session</td>  
51 - <td>开启</td>  
52 - <td>  
53 - {$session}  
54 - </td>  
55 - <td>开启</td>  
56 - </tr>  
57 - <tr>  
58 - <td>  
59 - PDO  
60 - <a href="https://www.baidu.com/s?wd=开启PDO,PDO_MYSQL扩展" target="_blank">  
61 - <i class="fa fa-question-circle question"></i>  
62 - </a>  
63 - </td>  
64 - <td>开启</td>  
65 - <td>  
66 - {$pdo}  
67 - </td>  
68 - <td>开启</td>  
69 - </tr>  
70 - <tr>  
71 - <td>  
72 - PDO_MySQL  
73 - <a href="https://www.baidu.com/s?wd=开启PDO,PDO_MYSQL扩展" target="_blank">  
74 - <i class="fa fa-question-circle question"></i>  
75 - </a>  
76 - </td>  
77 - <td>开启</td>  
78 - <td>  
79 - {$pdo_mysql}  
80 - </td>  
81 - <td>开启</td>  
82 - </tr>  
83 - <tr>  
84 - <td>  
85 - CURL  
86 - <a href="https://www.baidu.com/s?wd=开启PHP CURL扩展" target="_blank">  
87 - <i class="fa fa-question-circle question"></i>  
88 - </a>  
89 - </td>  
90 - <td>开启</td>  
91 - <td>  
92 - {$curl}  
93 - </td>  
94 - <td>开启</td>  
95 - </tr>  
96 - <tr>  
97 - <td>  
98 - GD  
99 - <a href="https://www.baidu.com/s?wd=开启PHP GD扩展" target="_blank">  
100 - <i class="fa fa-question-circle question"></i>  
101 - </a>  
102 - </td>  
103 - <td>开启</td>  
104 - <td>  
105 - {$gd}  
106 - </td>  
107 - <td>开启</td>  
108 - </tr>  
109 - <tr>  
110 - <td>  
111 - MBstring  
112 - <a href="https://www.baidu.com/s?wd=开启PHP MBstring扩展" target="_blank">  
113 - <i class="fa fa-question-circle question"></i>  
114 - </a>  
115 - </td>  
116 - <td>开启</td>  
117 - <td>  
118 - {$mbstring}  
119 - </td>  
120 - <td>开启</td>  
121 - </tr>  
122 - <tr>  
123 - <td>  
124 - fileinfo  
125 - <a href="https://www.baidu.com/s?wd=开启PHP fileinfo扩展" target="_blank">  
126 - <i class="fa fa-question-circle question"></i>  
127 - </a>  
128 - </td>  
129 - <td>开启</td>  
130 - <td>  
131 - {$fileinfo}  
132 - </td>  
133 - <td>开启</td>  
134 - </tr>  
135 - <notempty name="show_always_populate_raw_post_data_tip">  
136 - <tr>  
137 - <td>  
138 - $HTTP_RAW_POST_DATA关闭检测  
139 - <a href="https://www.baidu.com/s?wd=开启PHP fileinfo扩展" target="_blank">  
140 - <i class="fa fa-question-circle question"></i>  
141 - </a>  
142 - </td>  
143 - <td>关闭</td>  
144 - <td>  
145 - {$always_populate_raw_post_data}  
146 -  
147 - </td>  
148 - <td>关闭</td>  
149 - </tr>  
150 - <tr>  
151 - <td>$HTTP_RAW_POST_DATA未关闭解决</td>  
152 - <td colspan="3">  
153 - <pre>  
154 - ;php.ini 找到 always_populate_raw_post_data设置如下:  
155 - always_populate_raw_post_data = -1  
156 - </pre>  
157 - </td>  
158 - </tr>  
159 - </notempty>  
160 - <!-- rewrite检测 -->  
161 - <tr>  
162 - <td class="td1" colspan="4">  
163 - rewrite检测(开启rewrite更利于网站SEO优化)  
164 - </td>  
165 - </tr>  
166 - <tr>  
167 - <td>  
168 - 服务器rewrite  
169 - <a href="https://www.kancloud.cn/thinkcmf/faq/493492" target="_blank">  
170 - <i class="fa fa-question-circle question"></i>  
171 - </a>  
172 - </td>  
173 - <td>开启</td>  
174 - <td>  
175 - <span class="rewrite-checking">正在检测...</span>  
176 - <span class="rewrite-correct"><i class="fa fa-check correct"></i> 支持</span>  
177 - <span class="rewrite-error"><i class="fa fa-remove error"></i> 不支持</span>  
178 - </td>  
179 - <td>开启</td>  
180 - </tr>  
181 - <!-- 大小限制检测 -->  
182 - <tr>  
183 - <td class="td1" colspan="4">  
184 - 大小限制检测  
185 - </td>  
186 - </tr>  
187 - <tr>  
188 - <td>附件上传</td>  
189 - <td>>2M</td>  
190 - <td>  
191 - {$upload_size}  
192 - </td>  
193 - <td>不限制</td>  
194 - </tr>  
195 - </table>  
196 - <table width="100%">  
197 - <tr>  
198 - <td class="td1">目录、文件权限检查</td>  
199 - <td class="td1" width="25%">写入</td>  
200 - <td class="td1" width="25%">读取</td>  
201 - </tr>  
202 - <foreach name="folders" item="vo" key="dir">  
203 - <tr>  
204 - <td>  
205 - {$dir}  
206 - </td>  
207 - <td>  
208 - <if condition="$vo['w']">  
209 - <i class="fa fa-check correct"></i> 可写  
210 - <else/>  
211 - <i class="fa fa-remove error"></i> 不可写  
212 - </if>  
213 - </td>  
214 - <td>  
215 - <if condition="$vo['r']">  
216 - <i class="fa fa-check correct"></i> 可读  
217 - <else/>  
218 - <i class="fa fa-remove error"></i> 不可读  
219 - </if>  
220 - </td>  
221 - </tr>  
222 - </foreach>  
223 - </table>  
224 - </div>  
225 - <div class="bottom text-center">  
226 - <a href="__ROOT__/?s=install/index/step2" class="btn btn-primary">重新检测</a>  
227 - <a href="{:url('index/step3')}" class="btn btn-primary">下一步</a>  
228 - </div>  
229 - </section>  
230 -</div>  
231 -<include file="public/footer"/>  
232 -<script>  
233 - $.ajax({  
234 - url: "__ROOT__/install/index/testRewrite",  
235 - type: 'POST',  
236 - dataType: 'JSON',  
237 - success: function (data) {  
238 - if (data.code) {  
239 - $('.rewrite-correct').show();  
240 - $('.rewrite-checking').hide();  
241 - }  
242 - },  
243 - error: function () {  
244 - $('.rewrite-error').show();  
245 - $('.rewrite-checking').hide();  
246 - }  
247 - })  
248 -</script>  
249 -</body>  
250 -</html>  
1 -<!doctype html>  
2 -<html>  
3 -<head>  
4 - <include file="public/head"/>  
5 -</head>  
6 -<body>  
7 -<div class="wrap">  
8 - <include file="public/header"/>  
9 - <section class="section">  
10 - <div class="step">  
11 - <ul class="unstyled">  
12 - <li class="on"><em>1</em>检测环境</li>  
13 - <li class="current"><em>2</em>创建数据</li>  
14 - <li><em>3</em>完成安装</li>  
15 - </ul>  
16 - </div>  
17 - <form id="js-install-form" action="{:url('index/step4')}" method="post">  
18 - <input type="hidden" name="force" value="0"/>  
19 - <div class="server">  
20 - <table width="100%">  
21 - <tr>  
22 - <td class="td1" width="100">数据库信息</td>  
23 - <td class="td1" width="200">&nbsp;</td>  
24 - <td class="td1">&nbsp;</td>  
25 - </tr>  
26 - <tr>  
27 - <td class="text-left">数据库服务器:</td>  
28 - <td><input type="text" name="dbhost" id="dbhost" value="127.0.0.1" class="input"></td>  
29 - <td>  
30 - <div id="js-install-tip-dbhost">  
31 - <span class="gray">数据库服务器地址,一般为127.0.0.1或localhost</span>  
32 - </div>  
33 - </td>  
34 - </tr>  
35 - <tr>  
36 - <td class="text-left">数据库端口:</td>  
37 - <td><input type="text" name="dbport" id="dbport" value="3306" class="input"></td>  
38 - <td>  
39 - <div id="js-install-tip-dbport">  
40 - <span class="gray">数据库服务器端口,一般为3306</span>  
41 - </div>  
42 - </td>  
43 - </tr>  
44 - <tr>  
45 - <td class="text-left">数据库用户名:</td>  
46 - <td><input type="text" name="dbuser" id="dbuser" value="root" class="input"></td>  
47 - <td>  
48 - <div id="js-install-tip-dbuser"></div>  
49 - </td>  
50 - </tr>  
51 - <tr>  
52 - <td class="text-left">数据库密码:</td>  
53 - <td>  
54 - <input type="password" name="dbpw" id="dbpw" value="" class="input" autoComplete="off"  
55 - onblur="TestDbPwd()">  
56 - </td>  
57 - <td>  
58 - <div id="js-install-tip-dbpw"></div>  
59 - </td>  
60 - </tr>  
61 - <tr>  
62 - <td class="text-left">数据库名:</td>  
63 - <td><input type="text" name="dbname" id="dbname" value="thinkcmf5" class="input"></td>  
64 - <td>  
65 - <div id="js-install-tip-dbname">  
66 - <span class="gray">最好小写字母</span>  
67 - </div>  
68 - </td>  
69 - </tr>  
70 - <tr>  
71 - <td class="text-left">数据库表前缀:</td>  
72 - <td><input type="text" name="dbprefix" id="dbprefix" value="cmf_" class="input"></td>  
73 - <td>  
74 - <div id="js-install-tip-dbprefix">  
75 - <span class="gray">建议使用默认,同一数据库安装多个ThinkCMF时需修改</span>  
76 - </div>  
77 - </td>  
78 - </tr>  
79 - <tr>  
80 - <td class="text-left">数据库编码:</td>  
81 - <td>  
82 - <select type="text" name="dbcharset" id="dbcharset" value="" class="input">  
83 - <option value="utf8mb4">utf8mb4</option>  
84 - <option value="utf8">utf8</option>  
85 - </select>  
86 - </td>  
87 - <td>  
88 - <div id="js-install-tip-dbcharset">  
89 - <span class="gray">如果您的服务器是虚拟空间不支持uft8mb4,请选择 utf8</span>  
90 - </div>  
91 - </td>  
92 - </tr>  
93 - </table>  
94 - <table width="100%">  
95 - <tr>  
96 - <td class="td1" width="100">网站配置</td>  
97 - <td class="td1" width="200">&nbsp;</td>  
98 - <td class="td1">&nbsp;</td>  
99 - </tr>  
100 - <tr>  
101 - <td class="text-left">网站名称:</td>  
102 - <td><input type="text" name="sitename" value="ThinkCMF内容管理框架" class="input"></td>  
103 - <td>  
104 - <div id="js-install-tip-sitename"></div>  
105 - </td>  
106 - </tr>  
107 - <tr>  
108 - <td class="text-left">关键词:</td>  
109 - <td>  
110 - <input type="text" name="sitekeywords"  
111 - value="ThinkCMF,php,内容管理框架,cmf,cms,简约风, simplewind,framework" class="input"  
112 - autoComplete="off">  
113 - </td>  
114 - <td>  
115 - <div id="js-install-tip-sitekeywords"></div>  
116 - </td>  
117 - </tr>  
118 - <tr>  
119 - <td class="text-left">描述:</td>  
120 - <td>  
121 - <input type="text" name="siteinfo" class="input" value="ThinkCMF是简约风网络科技发布的一款用于快速开发的内容管理框架">  
122 - </td>  
123 - <td>  
124 - <div id="js-install-tip-siteinfo"></div>  
125 - </td>  
126 - </tr>  
127 - </table>  
128 - <table width="100%">  
129 - <tr>  
130 - <td class="td1" width="100">创始人信息</td>  
131 - <td class="td1" width="200">&nbsp;</td>  
132 - <td class="td1">&nbsp;</td>  
133 - </tr>  
134 - <tr>  
135 - <td class="text-left">管理员帐号:</td>  
136 - <td><input type="text" name="manager" value="admin" class="input"></td>  
137 - <td>  
138 - <div id="js-install-tip-manager"></div>  
139 - </td>  
140 - </tr>  
141 - <tr>  
142 - <td class="text-left">密码:</td>  
143 - <td>  
144 - <input type="password" name="manager_pwd" id="js-manager-pwd" class="input"  
145 - autoComplete="off">  
146 - </td>  
147 - <td>  
148 - <div id="js-install-tip-manager_pwd">  
149 - <span class="gray">  
150 - 密码长度不低于6位,不高于32位。  
151 - </span>  
152 - </div>  
153 - </td>  
154 - </tr>  
155 - <tr>  
156 - <td class="text-left">重复密码:</td>  
157 - <td>  
158 - <input type="password" name="manager_ckpwd" class="input" autoComplete="off">  
159 - </td>  
160 - <td>  
161 - <div id="js-install-tip-manager_ckpwd"></div>  
162 - </td>  
163 - </tr>  
164 - <tr>  
165 - <td class="text-left">Email:</td>  
166 - <td><input type="text" name="manager_email" class="input" value=""></td>  
167 - <td>  
168 - <div id="js-install-tip-manager_email"></div>  
169 - </td>  
170 - </tr>  
171 - </table>  
172 - <div id="js-response-tips" style="display: none;"></div>  
173 - </div>  
174 - <div class="bottom text-center">  
175 - <a href="{:url('index/step2')}" class="btn btn-primary">上一步</a>  
176 - <button type="submit" class="btn btn-primary">创建数据</button>  
177 - </div>  
178 - </form>  
179 - </section>  
180 - <script src="__STATIC__/js/jquery.js"></script>  
181 - <script src="__STATIC__/js/validate.js"></script>  
182 - <script src="__STATIC__/js/ajaxForm.js"></script>  
183 - <script>  
184 - function TestDbPwd() {  
185 - var dbHost = $('#dbhost').val();  
186 - var dbUser = $('#dbuser').val();  
187 - var dbPwd = $('#dbpw').val();  
188 - var dbName = $('#dbname').val();  
189 - var dbPort = $('#dbport').val();  
190 - data = {  
191 - 'hostname': dbHost,  
192 - 'username': dbUser,  
193 - 'password': dbPwd,  
194 - 'hostport': dbPort  
195 - };  
196 - var url = "{:url('index/testDbPwd')}";  
197 - $.ajax({  
198 - type: "POST",  
199 - url: url,  
200 - dataType: 'JSON',  
201 - data: data,  
202 - beforeSend: function () {  
203 - },  
204 - success: function (data) {  
205 - if (data.code) {  
206 -  
207 - } else {  
208 - $('#dbpw').val("");  
209 - //数据库链接配置失败  
210 - $('#js-install-tip-dbpw').html('<span for="dbname" generated="true" class="tips-error" style="">' + data.msg + '</span>');  
211 - }  
212 - },  
213 - complete: function () {  
214 - },  
215 - error: function () {  
216 - $('#js-install-tip-dbpw').html('<span for="dbname" generated="true" class="tips-error" style="">数据库链接配置失败</span>');  
217 - $('#dbpw').val("");  
218 - }  
219 - });  
220 - }  
221 -  
222 - $(function () {  
223 - //聚焦时默认提示  
224 - var focus_tips = {  
225 - dbhost: '数据库服务器地址,一般为127.0.0.1或localhost',  
226 - dbport: '数据库服务器端口,一般为3306',  
227 - dbuser: '',  
228 - dbpw: '',  
229 - dbname: '',  
230 - dbprefix: '建议使用默认,同一数据库安装多个ThinkCMF时需修改',  
231 - dbcharset: '如果您的服务器是虚拟空间不支持uft8mb4,请选择 utf8',  
232 - manager: '创始人帐号,拥有站点后台所有管理权限',  
233 - manager_pwd: '密码长度不低于6位,不高于32位',  
234 - manager_ckpwd: '',  
235 - sitename: '',  
236 - siteurl: '请以“/”结尾',  
237 - sitekeywords: '',  
238 - siteinfo: '',  
239 - manager_email: ''  
240 - };  
241 -  
242 - var install_form = $("#js-install-form");  
243 -  
244 - //validate插件修改了remote ajax验证返回的response处理方式;增加密码强度提示 passwordRank  
245 - install_form.validate({  
246 - //debug : true,  
247 - //onsubmit : false,  
248 - errorPlacement: function (error, element) {  
249 - //错误提示容器  
250 - $('#js-install-tip-' + element[0].name).html(error);  
251 - },  
252 - errorElement: 'span',  
253 - //invalidHandler : , 未验证通过 回调  
254 - //ignore : '.ignore' 忽略验证  
255 - //onkeyup : true,  
256 - errorClass: 'tips-error',  
257 - validClass: 'tips-error',  
258 - onkeyup: false,  
259 - focusInvalid: false,  
260 - rules: {  
261 - dbhost: {required: true},  
262 - dbport: {required: true},  
263 - dbuser: {required: true},  
264 - /* dbpw: {required : true}, */  
265 - dbname: {required: true},  
266 - dbprefix: {required: true},  
267 - manager: {required: true},  
268 - manager_pwd: {required: true, minlength: 6, maxlength: 32},  
269 - manager_ckpwd: {required: true, equalTo: '#js-manager-pwd'},  
270 - manager_email: {required: true, email: true}  
271 - },  
272 - highlight: false,  
273 - unhighlight: function (element, errorClass, validClass) {  
274 - var tip_elem = $('#js-install-tip-' + element.name);  
275 - tip_elem.html('<span class="' + validClass + '" data-text="text"><span>');  
276 - },  
277 - onfocusin: function (element) {  
278 - var name = element.name;  
279 - $('#js-install-tip-' + name).html('<span data-text="text">' + focus_tips[name] + '</span>');  
280 - $(element).parents('tr').addClass('current');  
281 - },  
282 - onfocusout: function (element) {  
283 - var _this = this;  
284 - $(element).parents('tr').removeClass('current');  
285 -  
286 - if (element.name === 'email') {  
287 - //邮箱匹配点击后,延时处理  
288 - setTimeout(function () {  
289 - _this.element(element);  
290 - }, 150);  
291 - } else {  
292 - _this.element(element);  
293 - }  
294 -  
295 - },  
296 - messages: {  
297 - dbhost: {required: '数据库服务器地址不能为空'},  
298 - dbport: {required: '数据库服务器端口不能为空'},  
299 - dbuser: {required: '数据库用户名不能为空'},  
300 - dbpw: {required: '数据库密码不能为空'},  
301 - dbname: {required: '数据库名不能为空'},  
302 - dbprefix: {required: '数据库表前缀不能为空'},  
303 - manager: {required: '管理员帐号不能为空'},  
304 - manager_pwd: {required: '密码不能为空', minlength: '密码长度不低于{0}位', maxlength: '密码长度不超过{0}位'},  
305 - manager_ckpwd: {required: '重复密码不能为空', equalTo: '两次输入的密码不一致,请重新输入.'},  
306 - manager_email: {required: 'Email不能为空', email: '请输入正确的电子邮箱地址'}  
307 - },  
308 - submitHandler: function (form) {  
309 - form.submit();  
310 - return true;  
311 - }  
312 - });  
313 - });  
314 - </script>  
315 -</div>  
316 -<include file="public/footer"/>  
317 -</body>  
318 -</html>  
1 -<!doctype html>  
2 -<html>  
3 -<head>  
4 - <include file="public/head"/>  
5 - <script type="text/javascript">  
6 - //全局变量  
7 - var GV = {  
8 - ROOT: "{:cmf_get_root()}/",  
9 - WEB_ROOT: "{:cmf_get_root()}/",  
10 - JS_ROOT: "static/js/"  
11 - };  
12 - </script>  
13 - <script src="__STATIC__/js/jquery.js"></script>  
14 - <script src="__STATIC__/js/wind.js"></script>  
15 - <script type="text/html" id="exec-success-msg-tpl">  
16 - <li>  
17 - <i class="fa fa-check correct"></i>  
18 - {message}<br>  
19 - <!--<pre>{sql}</pre>-->  
20 - </li>  
21 - </script>  
22 - <script type="text/html" id="exec-fail-msg-tpl">  
23 - <li>  
24 - <i class="fa fa-remove error"></i>  
25 - {message}<br>  
26 - <pre>{sql}</pre>  
27 - <!--<pre>{exception}</pre>-->  
28 - </li>  
29 - </script>  
30 -</head>  
31 -<body>  
32 -<div class="wrap">  
33 - <include file="public/header"/>  
34 - <section class="section">  
35 - <div class="step">  
36 - <ul class="unstyled">  
37 - <li class="on"><em>1</em>检测环境</li>  
38 - <li class="on"><em>2</em>创建数据</li>  
39 - <li class="current"><em>3</em>完成安装</li>  
40 - </ul>  
41 - </div>  
42 - <div class="install" id="log">  
43 - <ul id="install-msg-panel" class="unstyled"></ul>  
44 - </div>  
45 - <div class="bottom text-center">  
46 - <a href="javascript:;"><i class="fa fa-refresh fa-spin"></i>&nbsp;正在安装...</a>  
47 - </div>  
48 - </section>  
49 - <script type="text/javascript">  
50 - $(function () {  
51 - install(0);  
52 - });  
53 -  
54 - Wind.use("noty", function () {  
55 -  
56 - });  
57 -  
58 - var $installMsgPanel = $('#install-msg-panel');  
59 - var $log = $("#log");  
60 - var execSuccessTpl = $('#exec-success-msg-tpl').html();  
61 - var execFailTpl = $('#exec-fail-msg-tpl').html();  
62 - var sqlExecResult;  
63 -  
64 - function install(sqlIndex) {  
65 - $.ajax({  
66 - url: "{:url('install/index/install')}",  
67 - data: {sql_index: sqlIndex},  
68 - dataType: 'json',  
69 - type: 'post',  
70 - success: function (data) {  
71 -  
72 - console.log(data);  
73 - var line = sqlIndex + 1;  
74 - if (data.code == 1) {  
75 -  
76 - if (!(data.data && data.data.done)) {  
77 - var tpl = execSuccessTpl;  
78 - tpl = tpl.replace(/\{message\}/g, line + '.' + data.msg);  
79 - tpl = tpl.replace(/\{sql\}/g, data.data.sql);  
80 - $installMsgPanel.append(tpl);  
81 -  
82 - } else {  
83 - $installMsgPanel.append('<li><i class="fa fa-check correct"></i>数据库安装完成!</li>');  
84 -  
85 - sqlExecResult = data.data;  
86 -  
87 - if (data.data.error) {  
88 - noty({  
89 - text: "安装过程,共" + data.data.error + "个SQL执行错误,可能您在此数据库下已经安装过 CMF,请查看问题后重新安装,或者<br>"  
90 - + '<a target="_blank" href="https://github.com/thinkcmf/thinkcmf/issues">反馈问题</a>',  
91 - type: 'confirm',  
92 - layout: "center",  
93 - timeout: false,  
94 - modal: true,  
95 - buttons: [  
96 - {  
97 - addClass: 'btn btn-primary',  
98 - text: '确定',  
99 - onClick: function ($noty) {  
100 - $noty.close();  
101 -  
102 - //setDbConfig();  
103 -  
104 - }  
105 - },  
106 - {  
107 - addClass: 'btn btn-danger',  
108 - text: '取消',  
109 - onClick: function ($noty) {  
110 - $noty.close();  
111 -  
112 - }  
113 - }  
114 - ]  
115 - });  
116 - } else {  
117 - setDbConfig();  
118 - }  
119 - }  
120 -  
121 - } else if (data.code == 0) {  
122 -  
123 - var tpl = execFailTpl;  
124 - tpl = tpl.replace(/\{message\}/g, line + '.' + data.msg);  
125 - tpl = tpl.replace(/\{sql\}/g, data.data.sql);  
126 - tpl = tpl.replace(/\{exception\}/g, data.data.exception);  
127 - $installMsgPanel.append(tpl);  
128 - }  
129 -  
130 - $log.scrollTop(1000000000);  
131 -  
132 - if (!(data.data && data.data.done)) {  
133 - sqlIndex++;  
134 - install(sqlIndex);  
135 - }  
136 -  
137 -  
138 - },  
139 - error: function () {  
140 -  
141 - },  
142 - complete: function () {  
143 -  
144 - }  
145 - });  
146 - }  
147 -  
148 - function setDbConfig() {  
149 - $.ajax({  
150 - url: "{:url('install/index/setDbConfig')}",  
151 - dataType: 'json',  
152 - data:{_hithinkcmf:1},  
153 - type: 'post',  
154 - success: function (data) {  
155 - if (data.code == 1) {  
156 - $installMsgPanel.append('<li><i class="fa fa-check correct"></i>' + data.msg + '</li>');  
157 - $log.scrollTop(1000000000);  
158 - setSite();  
159 - } else {  
160 - $installMsgPanel.append('<li><i class="fa fa-remove error"></i>' + data.msg + '</li>');  
161 - $log.scrollTop(1000000000);  
162 - noty({  
163 - text: data.msg + ',请检查 data/conf/database.php 是否可写!',  
164 - type: 'confirm',  
165 - layout: "center",  
166 - timeout: false,  
167 - modal: true,  
168 - buttons: [  
169 - {  
170 - addClass: 'btn btn-primary',  
171 - text: '重试',  
172 - onClick: function ($noty) {  
173 - $noty.close();  
174 - setDbConfig();  
175 - }  
176 - },  
177 - {  
178 - addClass: 'btn btn-danger',  
179 - text: '取消',  
180 - onClick: function ($noty) {  
181 - $noty.close();  
182 - }  
183 - }  
184 - ]  
185 - });  
186 - }  
187 - },  
188 - error: function () {  
189 -  
190 - }  
191 - });  
192 - }  
193 -  
194 - function setSite() {  
195 - $.ajax({  
196 - url: "{:url('install/index/setSite')}",  
197 - dataType: 'json',  
198 - data:{_hithinkcmf:1},  
199 - type: 'post',  
200 - success: function (data) {  
201 -  
202 - if (data.code == 1) {  
203 - $installMsgPanel.append('<li><i class="fa fa-check correct"></i>' + data.msg + '</li>');  
204 - $log.scrollTop(1000000000);  
205 - installTheme();  
206 - } else {  
207 - $installMsgPanel.append('<li><i class="fa fa-remove error"></i>' + data.msg + '</li>');  
208 - $log.scrollTop(1000000000);  
209 - noty({  
210 - text: data.msg,  
211 - type: 'confirm',  
212 - layout: "center",  
213 - timeout: false,  
214 - modal: true,  
215 - buttons: [  
216 - {  
217 - addClass: 'btn btn-primary',  
218 - text: '重试',  
219 - onClick: function ($noty) {  
220 - $noty.close();  
221 - setSite();  
222 - }  
223 - },  
224 - {  
225 - addClass: 'btn btn-danger',  
226 - text: '取消',  
227 - onClick: function ($noty) {  
228 - $noty.close();  
229 - }  
230 - }  
231 - ]  
232 - });  
233 - }  
234 -  
235 - },  
236 - error: function () {  
237 -  
238 - }  
239 - });  
240 - }  
241 -  
242 - function installTheme() {  
243 - $.ajax({  
244 - url: "{:url('install/index/installTheme')}",  
245 - dataType: 'json',  
246 - data:{_hithinkcmf:1},  
247 - type: 'post',  
248 - success: function (data) {  
249 -  
250 - if (data.code == 1) {  
251 - $installMsgPanel.append('<li><i class="fa fa-check correct"></i>' + data.msg + '</li>');  
252 - $log.scrollTop(1000000000);  
253 - setTimeout(function () {  
254 - window.location = "{:url('install/index/step5')}";  
255 - }, 1000);  
256 - } else {  
257 - $installMsgPanel.append('<li><i class="fa fa-remove error"></i>' + data.msg + '</li>');  
258 - $log.scrollTop(1000000000);  
259 - noty({  
260 - text: data.msg,  
261 - type: 'confirm',  
262 - layout: "center",  
263 - timeout: false,  
264 - modal: true,  
265 - buttons: [  
266 - {  
267 - addClass: 'btn btn-primary',  
268 - text: '重试',  
269 - onClick: function ($noty) {  
270 - $noty.close();  
271 - installTheme();  
272 - }  
273 - },  
274 - {  
275 - addClass: 'btn btn-danger',  
276 - text: '取消',  
277 - onClick: function ($noty) {  
278 - $noty.close();  
279 - }  
280 - }  
281 - ]  
282 - });  
283 - }  
284 -  
285 - },  
286 - error: function () {  
287 -  
288 - }  
289 - });  
290 - }  
291 - </script>  
292 -</div>  
293 -<include file="public/footer"/>  
294 -</body>  
295 -</html>  
1 -<!doctype html>  
2 -<html>  
3 -<head>  
4 - <include file="public/head"/>  
5 - <script src="__STATIC__/js/jquery.js"></script>  
6 -</head>  
7 -<body>  
8 -<div class="wrap">  
9 - <include file="public/header"/>  
10 - <section class="section">  
11 - <div style="padding: 40px 20px;">  
12 - <div class="text-center">  
13 - <a style="font-size: 18px;">恭喜您,安装完成!</a>  
14 - <br>  
15 - <br>  
16 - <div class="alert alert-danger" style="width: 360px;display: inline-block;">  
17 - 为了您的站点安全,安装完成后即可将网站app目录下的“install”文件夹删除!  
18 - 另请对data/conf/database.php文件做好备份,以防丢失!  
19 - </div>  
20 - </div>  
21 - <div class="accordion">  
22 - <div class="accordion-group">  
23 - <div class="accordion-heading">  
24 - <a class="accordion-toggle"  
25 - href="https://www.thinkcmf.com/topic/1508.html"  
26 - target="_blank">  
27 - ThinkCMF5入门必看!  
28 - </a>  
29 - </div>  
30 - <div class="accordion-body collapse in">  
31 - <div class="accordion-inner">  
32 - <p>  
33 - ThinkCMF5完全开发手册:  
34 - <a href="http://www.kancloud.cn/thinkcmf/doc" target="_blank">http://www.kancloud.cn/thinkcmf/doc</a>  
35 - </p>  
36 - <p>  
37 - ThinkCMF5核心理念:  
38 - <a href="http://www.kancloud.cn/thinkcmf/doc/313906" target="_blank">http://www.kancloud.cn/thinkcmf/doc/313906</a>  
39 - </p>  
40 - </div>  
41 - </div>  
42 - </div>  
43 - <div class="accordion-group">  
44 - <div class="accordion-heading">  
45 - <a class="accordion-toggle"  
46 - href="http://www.kancloud.cn/thinkcmf/cmf5api" target="_blank">  
47 - ThinkCMF API开发及小程序开发入门必看!  
48 - </a>  
49 - </div>  
50 - <div class="accordion-body collapse in">  
51 - <div class="accordion-inner">  
52 - <p>  
53 - CMF5 API开发手册:  
54 - <a href="http://www.kancloud.cn/thinkcmf/cmf5api" target="_blank">http://www.kancloud.cn/thinkcmf/cmf5api</a>  
55 - </p>  
56 - <p>  
57 - 小程序开发:  
58 - <a href="https://www.kancloud.cn/thinkcmf/cmf5api/451391" target="_blank">https://www.kancloud.cn/thinkcmf/cmf5api/451391</a>  
59 - </p>  
60 - </div>  
61 - </div>  
62 - </div>  
63 - <div class="accordion-group">  
64 - <div class="accordion-heading">  
65 - <a class="accordion-toggle"  
66 - href="https://www.thinkcmf.com/college.html" target="_blank">  
67 - ThinkCMF学院视频教程  
68 - </a>  
69 - </div>  
70 - <div class="accordion-body collapse in">  
71 - <div class="accordion-inner">  
72 - <p>  
73 - ThinkCMF模板开发视频:  
74 - <a href="https://chuanke.baidu.com/v4472461-241676-1805249.html"  
75 - target="_blank">https://chuanke.baidu.com/v4472461-241676-1805249.html</a>  
76 - </p>  
77 - <p>  
78 - ThinkCMF5快速入门:  
79 - <a href="https://www.thinkcmf.com/topic/1405.html"  
80 - target="_blank">https://www.thinkcmf.com/topic/1405.html</a>  
81 - </p>  
82 - </div>  
83 - </div>  
84 - </div>  
85 - </div>  
86 - <div class="text-center">  
87 - <a class="btn btn-success" href="{:cmf_get_root()}/">进入前台</a>  
88 - <a class="btn btn-success" href="{:cmf_get_root()}/admin">进入后台</a>  
89 - </div>  
90 -  
91 - </div>  
92 - </section>  
93 -</div>  
94 -  
95 -<include file="public/footer"/>  
96 -<script>  
97 - $(function () {  
98 - return;  
99 - $.ajax({  
100 - type: "POST",  
101 - url: "http://www.thinkcmf.com/service/installinfo.php",  
102 - data: {  
103 - host: "{$host|default=''}",  
104 - ip: "{$ip|default=''}"  
105 - },  
106 - dataType: 'json',  
107 - success: function () {  
108 - }  
109 - });  
110 - });  
111 -</script>  
112 -</body>  
113 -</html>  
@@ -30,369 +30,9 @@ class IndexController extends CommonController @@ -30,369 +30,9 @@ class IndexController extends CommonController
30 { 30 {
31 public function index() 31 public function index()
32 { 32 {
33 -// $return = $this->wxpay(['order_sn'=>201807211101],'保证金支付');  
34 -// $qrcode_url = url('portal/Index/qrcode',['data'=>urlencode($return['code_url'])],true,true);  
35 -// echo '<img src="'.$qrcode_url.'" alt=""/>';  
36 -// $back = [  
37 -// 'return'=>$return,  
38 -// 'code_url'=>base64_encode($return['code_url']),  
39 -// 'qrcode'=> '<img src="'.$qrcode_url.'" alt=""/>',  
40 -// 'alipay_url'=>url('portal/Alipay/alipay',array('order_sn'=>201807211101,'name'=>'保证金支付','price'=>0.01))  
41 -// ];  
42 -// $this->redirect($back['alipay_url']);  
43 -  
44 -// $data = [  
45 -// 'out_trade_no'=>'2018072798495757',  
46 -// 'trade_no'=>'2018072721001004410589897579',  
47 -// 'out_request_no'=>'2018072798495757',  
48 -// 'refund_amount'=>0.01,  
49 -// 'refund_reason'=>'中介报价少于3人退款'  
50 -// ];  
51 -// $alipay = controller('Alipay');  
52 -// $result = $alipay->refundquery($data);  
53 -// $object = $result->alipay_trade_fastpay_refund_query_response;  
54 -// var_dump($result->alipay_trade_fastpay_refund_query_response);  
55 -  
56 -// echo "<pre/>";  
57 -// print_r('7777');  
58 -// die;  
59 -//// 合作企业  
60 -// $where_coo['status'] = 1;  
61 -// $final['coop'] = Db::name('Cooperation')->where($where_coo)->order("score desc , create_time desc")->field('pic')->select()->toArray();  
62 -  
63 -  
64 -  
65 -  
66 return $this->fetch(':index'); 33 return $this->fetch(':index');
67 } 34 }
68 35
69 - public function api_test() {  
70 - $key = '123456';  
71 - $data = [  
72 - 'pid' => 17515,  
73 - 'name' => 'huawei-6p'  
74 - ];  
75 -// $id=$this->request->param('pid');  
76 -// $name=$this->request->param('name');  
77 - $id=$data['pid'];  
78 - $name=$data['name'];  
79 - $time=date('Y-m-d H:i:s');  
80 - $sign=md5($id.$name.$time.$key);  
81 - $file=[  
82 - 'pid'=>$id,  
83 - 'name'=>$name,  
84 - 'time'=>$time,  
85 - 'sign'=>$sign  
86 - ];  
87 -  
88 - $url="http://118.25.20.60/account.do?pid=$id&name=$name&time=$time&sign=$sign";  
89 - echo $url."<br/>";  
90 -// $result = file_get_contents($url);  
91 - $result = $this->curl($url,$file);  
92 - var_dump($result);  
93 - }  
94 - protected function curl($url,$data = null) {  
95 - // 初始化  
96 - $curl = curl_init();  
97 - // 设置抓取的url  
98 - curl_setopt($curl, CURLOPT_URL, $url);  
99 - // 设置头文件的信息作为数据流输出  
100 - curl_setopt($curl, CURLOPT_TIMEOUT, 10);  
101 - // 设置获取的信息以文件流的形式返回,而不是直接输出。  
102 - curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);  
103 -// curl_setopt($curl, CURLOPT_POST, true); // 发送一个常规的Post请求  
104 -// curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包  
105 - // 执行命令  
106 - $data = curl_exec($curl);  
107 - if (curl_errno($curl)) {  
108 - $data = curl_error($curl);  
109 - }  
110 - // 关闭URL请求  
111 - curl_close($curl);  
112 - // 显示获得的数据  
113 - return $data;  
114 - }  
115 -  
116 - public function wap_index()  
117 - {  
118 -// $return = $this->wxpay(['order_sn'=>201807211032],'保证金支付');  
119 -// $qrcode_url = url('portal/Index/qrcode',['data'=>urlencode($return['code_url'])],true,true);  
120 -// echo '<img src="'.$qrcode_url.'" alt=""/>';  
121 - $back = [  
122 -// 'return'=>$return,  
123 -// 'code_url'=>base64_encode($return['code_url']),  
124 -// 'qrcode'=> '<img src="'.$qrcode_url.'" alt=""/>',  
125 - 'alipay_url'=>url('portal/AlipayWap/alipay',array('order_sn'=>201807211100,'name'=>'保证金支付','price'=>0.01))  
126 - ];  
127 - $this->redirect($back['alipay_url']);  
128 -  
129 -// echo "<pre/>";  
130 -// print_r('7777');  
131 -// die;  
132 -//// 合作企业  
133 -// $where_coo['status'] = 1;  
134 -// $final['coop'] = Db::name('Cooperation')->where($where_coo)->order("score desc , create_time desc")->field('pic')->select()->toArray();  
135 -  
136 -  
137 -  
138 -  
139 - return $this->fetch(':index');  
140 - }  
141 -  
142 - // 微信h5支付(测试)  
143 - public function wxpayh5() {  
144 - require_once VENDOR_PATH.'WxpayAPI/WxpayH5.php';  
145 - $h5 = new \WxpayH5('wxf69d1d87d173c899','1507884301','VaY3CqbFLbq2Dw3FRENrixu24E9Qq1ZI','201807211465',  
146 - '保证金支付','1','{"h5_info": {"type":"Wap","wap_url": "http://houseprice.w.bronet.cn","wap_name": "保证金支付"}}' );  
147 - $result = $h5->pay();  
148 - var_dump($result);  
149 - $mweb_url = '';  
150 - if(!empty($result['mweb_url'])) {  
151 - $mweb_url = $result['mweb_url'];  
152 - }  
153 - $this->assign('mwen_url',$mweb_url);  
154 - return $this->fetch(':h5');  
155 - }  
156 -  
157 - /**  
158 - * 微信h5支付(接口)  
159 - * @param user_id 用户ID  
160 - * @param order_sn 订单号  
161 - * @param _type 支付类型 1,发布需求(保证金);2,中介报价;3,透视卡  
162 - */  
163 - public function wxpay_web() {  
164 - if($this->request->isPost()) {  
165 - $data = $this->request->param();  
166 - $order_model = new OrderModel();  
167 - $orderInfo = $order_model->where(['order_sn'=>$data['order_sn'],'type'=>$data['_type']])->find();  
168 - if(empty($orderInfo['status']) || $orderInfo['status'] > 1) {  
169 - $this->apiResponse(0,'订单已失效');  
170 - }  
171 - $type = [  
172 - 1 => '保证金支付',  
173 - 2 => '中介报价',  
174 - 3 => '透视卡'  
175 - ];  
176 - $scene_info = "{'h5_info': {'type':'Wap','wap_url': 'http://houseprice.w.bronet.cn','wap_name': ".$type[$data["_type"]]."}}";  
177 - require_once VENDOR_PATH.'WxpayAPI/WxpayH5.php';  
178 -// $h5 = new \WxpayH5(config('APP_ID'),config('MCH_ID'),config('WXPAY_KEY'),$data['order_sn'],  
179 -// $type[$data['_type']],'1',$scene_info);  
180 - $h5 = new \WxpayH5('wxf69d1d87d173c899','1507884301','VaY3CqbFLbq2Dw3FRENrixu24E9Qq1ZI',$data['order_sn'],  
181 - $type[$data['_type']],'1',$scene_info);  
182 - $result = $h5->pay();  
183 - if(empty($result['mweb_url'])) {  
184 - $this->apiResponse(0,'生成失败');  
185 - }  
186 - $return = [  
187 - 'mwen_url' => $result['mweb_url'],  
188 - 'create_time' => time(),  
189 - 'over_time'=>time()+5*60  
190 - ];  
191 - $this->apiResponse(1,'成功',$return);  
192 - }  
193 - }  
194 -  
195 - // 微信退款(测试)  
196 - public function wxrefund() {  
197 - require_once VENDOR_PATH.'WxpayAPI/WxRefund.php';  
198 - $refund = new \WxRefund(Config::get('wx_appid'),Config::get('wx_mch_id'),Config::get('wx_key'),'4200000140201807275326669498',  
199 - '2018072710154991','1','1','中介报价少于3人退款');  
200 - $result = $refund->pay();  
201 - var_dump($result);  
202 - if($result['return_code'] == 'SUCCESS' && $result['return_msg'] == 'OK') {  
203 - $refund_model = new RefundModel();  
204 - $refund = $refund_model->where(['order_sn'=>$result['out_refund_no']])->find();  
205 -// if($refund) {  
206 -// echo '订单已申请退款';exit;  
207 -// }  
208 - $insert = [  
209 - 'order_id' => 1,  
210 - 'order_sn' => $result['out_refund_no'],  
211 - 'user_id' => 24,  
212 - 'user_type' => 1,  
213 - 'refund_id' => $result['refund_id'],  
214 - 'pay_type' => 1,  
215 - 'reason' => 1,  
216 - 'create_time' => time(),  
217 - 'update_time' => time()  
218 - ];  
219 - $refund_model->insertGetId($insert);  
220 - } else {  
221 - return false;  
222 - }  
223 - var_dump($result);  
224 - }  
225 -  
226 - // 微信退款查询(测试)  
227 - public function wxrefundquery() {  
228 - require_once VENDOR_PATH.'WxpayAPI/WxRefundQuery.php';  
229 - $refund = new \WxRefundQuery(Config::get('wx_appid'),Config::get('wx_mch_id'),Config::get('wx_key'),'4200000139201807280275718105',  
230 - '2018072851481021','2018072810256541','50000107382018072805769543127');  
231 - $result = $refund->pay();  
232 -// if($refund['status'] == 2) {  
233 -// echo '订单已完成退款';exit;  
234 -// }  
235 - var_dump($result);  
236 -// if($result['return_code'] == 'SUCCESS' && $result['return_msg'] == 'OK') {  
237 -// Db::startTrans();  
238 -// $refund_update = [  
239 -// 'status' => 2,  
240 -// 'refund_time' => strtotime($result['refund_success_time_0'])  
241 -// ];  
242 -// $refund_result = $refund_model->where(['id'=>$refund['id']])->update($refund_update);  
243 -// if(!$refund_result) {  
244 -// Db::rollback();  
245 -// echo '退款状态修改失败';exit;  
246 -// }  
247 -// $order_model = new OrderModel();  
248 -// $order_update = [  
249 -// 'status' => 4,  
250 -// 'refund_time' => strtotime($result['refund_success_time_0'])  
251 -// ];  
252 -// $order_result = $order_model->where(['id'=>$refund['order_id']])->update($order_update);  
253 -// if(!$order_result) {  
254 -// Db::rollback();  
255 -// echo '订单状态修改失败';exit;  
256 -// }  
257 -// Db::commit();  
258 -// } else {  
259 -// $refund_update = [  
260 -// 'status' => 5,  
261 -// 'remark' => $result['return_msg']  
262 -// ];  
263 -// $refund_result = $refund_model->where(['id'=>$refund['id']])->update($refund_update);  
264 -// if(!$refund_result) {  
265 -// echo '退款状态修改失败';exit;  
266 -// }  
267 -// return false;  
268 -// }  
269 -// var_dump($result);  
270 - }  
271 -  
272 - public function callback() {  
273 -// echo url('portal/Notify/refund_notify', '', '', true);  
274 - $info = Db::name('Test')->where(['id'=>144])->find();  
275 - $data = json_decode($info['data'],true);  
276 - if($data['return_code'] == 'SUCCESS' && !empty($data['req_info'])) {  
277 - $key = md5(Config::get('wx_key'));  
278 - $array = $this->xmlToArray($this->refund_decrypt($data['req_info'],$key));  
279 - var_dump($array);  
280 - $refund_where = [  
281 - 'order_sn' => $array['out_refund_no'],  
282 - 'refund_id' => $array['refund_id'],  
283 - ];  
284 - $order_where = [  
285 - 'transaction_id' => $array['transaction_id'],  
286 - ];  
287 - $handle_sql = true;  
288 -// Db::startTrans();  
289 - if($array['refund_status'] == 'SUCCESS') {  
290 - $refund_update = [  
291 - 'status' => 2,  
292 - 'refund_time' => strtotime($array['success_time']),  
293 - 'remark' => $array['refund_account'],  
294 - 'more' => json_encode($array),  
295 - ];  
296 - $refund_result = Db::name('Refund')->where($refund_where)->update($refund_update);  
297 - $order_update = [  
298 - 'status' => 4,  
299 - 'refund_time' => $array['success_time']  
300 - ];  
301 - $order_result = Db::name('Order')->where($order_where)->update($order_update);  
302 - if(!$refund_result || !$order_result) {  
303 - $handle_sql = false;  
304 - }  
305 - } elseif($array['refund_status'] == 'CHANGE') {  
306 - $refund_update = [  
307 - 'status' => 4,  
308 -// 'refund_time' => strtotime($array['success_time']),  
309 -// 'remark' => $array['refund_account'],  
310 - 'more' => json_encode($array),  
311 - ];  
312 - $refund_result = Db::name('Refund')->where($refund_where)->update($refund_update);  
313 - if(!$refund_result) {  
314 - $handle_sql = false;  
315 - }  
316 - } elseif($array['refund_status'] == 'REFUNDCLOSE') {  
317 - $refund_update = [  
318 - 'status' => 3,  
319 -// 'refund_time' => strtotime($array['success_time']),  
320 -// 'remark' => $array['refund_account'],  
321 - 'more' => json_encode($array),  
322 - ];  
323 - $refund_result = Db::name('Refund')->where($refund_where)->update($refund_update);  
324 - if(!$refund_result) {  
325 - $handle_sql = false;  
326 - }  
327 - }  
328 - if(!$handle_sql) {  
329 -// Db::rollback();  
330 - } else {  
331 -// Db::commit();  
332 -// $this->return_success();  
333 - }  
334 - }  
335 - }  
336 -  
337 - public function refund_decrypt($str, $key) {  
338 - $str = base64_decode($str);  
339 - $decrypted = openssl_decrypt($str, 'AES-256-ECB', $key, OPENSSL_RAW_DATA);  
340 - return $decrypted;  
341 - }  
342 -  
343 - public function refund_alipay() {  
344 - $orderInfo = Db::name('Order')->where(['id'=>217])->find();  
345 - $orderInfo['user_type'] = 1;  
346 - $re = Db::name('Refund')->where(['id'=>265])->find();  
347 - $result = json_decode($re['more']);  
348 - $refund_model = new RefundModel();  
349 - if($result->code == '10000' && $result->msg == 'Success') {  
350 - $insert = [  
351 - 'order_id' => $orderInfo['id'],  
352 - 'order_sn' => $result->out_trade_no,  
353 - 'user_id' => $orderInfo['user_id'],  
354 - 'user_type' => $orderInfo['user_type'],  
355 - 'refund_id' => $result->trade_no,  
356 - 'money' => $orderInfo['money'],  
357 - 'pay_type' => 2,  
358 - 'status' => 2,  
359 - 'reason' => 1,  
360 - 'create_time' => time(),  
361 - 'update_time' => time(),  
362 - 'refund_time' => strtotime($result->gmt_refund_pay),  
363 - 'more' => json_encode($result)  
364 - ];  
365 - $refund_result = $refund_model->insertGetId($insert);  
366 - $update = [  
367 - 'status' => 4,  
368 - 'refund_time' => strtotime($result->gmt_refund_pay)  
369 - ];  
370 - $order_result = Db::name('Order')->where(['id'=>$orderInfo['id']])->update($update);  
371 - if(!$refund_result || !$order_result) {  
372 -// return false;  
373 - }  
374 -// return true;  
375 - }  
376 - }  
377 -  
378 - //xml转换成数组  
379 - private function xmlToArray($xml) {  
380 -  
381 -  
382 - //禁止引用外部xml实体  
383 -  
384 -  
385 - libxml_disable_entity_loader(true);  
386 -  
387 -  
388 - $xmlstring = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);  
389 -  
390 -  
391 - $val = json_decode(json_encode($xmlstring), true);  
392 -  
393 -  
394 - return $val;  
395 - }  
396 36
397 /** 37 /**
398 * 对密文进行解密 38 * 对密文进行解密