xiaosongshu007 пре 5 година
родитељ
комит
216ad2aecb
100 измењених фајлова са 8264 додато и 6 уклоњено
  1. 11 6
      .gitignore
  2. 8 0
      .htaccess
  3. 30 0
      Application/Admin/Common/function.php
  4. 1 0
      Application/Admin/Common/index.html
  5. 188 0
      Application/Admin/Conf/config.php
  6. 1 0
      Application/Admin/Conf/index.html
  7. 210 0
      Application/Admin/Controller/ActivityV2Controller.class.php
  8. 373 0
      Application/Admin/Controller/AdminController.class.php
  9. 96 0
      Application/Admin/Controller/CacheController.class.php
  10. 89 0
      Application/Admin/Controller/CleanPrizeLogController.class.php
  11. 350 0
      Application/Admin/Controller/CommonController.class.php
  12. 226 0
      Application/Admin/Controller/DaojuController.class.php
  13. 64 0
      Application/Admin/Controller/IndexController.class.php
  14. 461 0
      Application/Admin/Controller/PowerController.class.php
  15. 149 0
      Application/Admin/Controller/PrizeDefaultV2Controller.class.php
  16. 250 0
      Application/Admin/Controller/PrizeLogV2Controller.class.php
  17. 57 0
      Application/Admin/Controller/SelectActivityController.class.php
  18. 1 0
      Application/Admin/Controller/index.html
  19. 292 0
      Application/Admin/Lang/zh-cn.php
  20. 33 0
      Application/Admin/Lang/zh-cn/admin.php
  21. 27 0
      Application/Admin/Lang/zh-cn/article.php
  22. 15 0
      Application/Admin/Lang/zh-cn/articleclass.php
  23. 15 0
      Application/Admin/Lang/zh-cn/bubble.php
  24. 33 0
      Application/Admin/Lang/zh-cn/cache.php
  25. 15 0
      Application/Admin/Lang/zh-cn/class.php
  26. 14 0
      Application/Admin/Lang/zh-cn/config.php
  27. 34 0
      Application/Admin/Lang/zh-cn/course.php
  28. 21 0
      Application/Admin/Lang/zh-cn/customview.php
  29. 17 0
      Application/Admin/Lang/zh-cn/email.php
  30. 32 0
      Application/Admin/Lang/zh-cn/fraction.php
  31. 28 0
      Application/Admin/Lang/zh-cn/index.php
  32. 17 0
      Application/Admin/Lang/zh-cn/interval.php
  33. 24 0
      Application/Admin/Lang/zh-cn/link.php
  34. 37 0
      Application/Admin/Lang/zh-cn/navfooter.php
  35. 37 0
      Application/Admin/Lang/zh-cn/navheader.php
  36. 35 0
      Application/Admin/Lang/zh-cn/power.php
  37. 15 0
      Application/Admin/Lang/zh-cn/region.php
  38. 15 0
      Application/Admin/Lang/zh-cn/room.php
  39. 15 0
      Application/Admin/Lang/zh-cn/score.php
  40. 15 0
      Application/Admin/Lang/zh-cn/semester.php
  41. 33 0
      Application/Admin/Lang/zh-cn/seo.php
  42. 448 0
      Application/Admin/Lang/zh-cn/site.php
  43. 14 0
      Application/Admin/Lang/zh-cn/sms.php
  44. 37 0
      Application/Admin/Lang/zh-cn/student.php
  45. 15 0
      Application/Admin/Lang/zh-cn/subject.php
  46. 30 0
      Application/Admin/Lang/zh-cn/teacher.php
  47. 19 0
      Application/Admin/Lang/zh-cn/theme.php
  48. 28 0
      Application/Admin/Lang/zh-cn/user.php
  49. 61 0
      Application/Admin/Lang/zh-cn/view.php
  50. 15 0
      Application/Admin/Lang/zh-cn/week.php
  51. 71 0
      Application/Admin/Model/AdminModel.class.php
  52. 51 0
      Application/Admin/Model/ArticleClassModel.class.php
  53. 90 0
      Application/Admin/Model/ArticleModel.class.php
  54. 64 0
      Application/Admin/Model/ClassModel.class.php
  55. 17 0
      Application/Admin/Model/CommonModel.class.php
  56. 23 0
      Application/Admin/Model/ConfigModel.class.php
  57. 140 0
      Application/Admin/Model/CourseModel.class.php
  58. 52 0
      Application/Admin/Model/CustomViewModel.class.php
  59. 102 0
      Application/Admin/Model/FractionImportModel.class.php
  60. 91 0
      Application/Admin/Model/FractionModel.class.php
  61. 35 0
      Application/Admin/Model/IntervalModel.class.php
  62. 107 0
      Application/Admin/Model/LayoutModule.class.php
  63. 63 0
      Application/Admin/Model/LinkModel.class.php
  64. 99 0
      Application/Admin/Model/NavigationModel.class.php
  65. 137 0
      Application/Admin/Model/PowerModel.class.php
  66. 64 0
      Application/Admin/Model/RegionModel.class.php
  67. 51 0
      Application/Admin/Model/RoleModel.class.php
  68. 64 0
      Application/Admin/Model/RoomModel.class.php
  69. 36 0
      Application/Admin/Model/ScoreModel.class.php
  70. 36 0
      Application/Admin/Model/SemesterModel.class.php
  71. 201 0
      Application/Admin/Model/StudentImportModel.class.php
  72. 202 0
      Application/Admin/Model/StudentModel.class.php
  73. 36 0
      Application/Admin/Model/SubjectModel.class.php
  74. 135 0
      Application/Admin/Model/TeacherModel.class.php
  75. 147 0
      Application/Admin/Model/UploaderModel.class.php
  76. 110 0
      Application/Admin/Model/UserModel.class.php
  77. 36 0
      Application/Admin/Model/WeekModel.class.php
  78. 1 0
      Application/Admin/Model/index.html
  79. 61 0
      Application/Admin/View/Default/ActivityV2/Index.html
  80. 622 0
      Application/Admin/View/Default/ActivityV2/collect.html
  81. 88 0
      Application/Admin/View/Default/Admin/Index.html
  82. 38 0
      Application/Admin/View/Default/Admin/LoginInfo.html
  83. 56 0
      Application/Admin/View/Default/Admin/SaveInfo.html
  84. 27 0
      Application/Admin/View/Default/Cache/Index.html
  85. 61 0
      Application/Admin/View/Default/CleanPrizeLog/Index.html
  86. 54 0
      Application/Admin/View/Default/Config/Index.html
  87. 79 0
      Application/Admin/View/Default/Daoju/Index.html
  88. 126 0
      Application/Admin/View/Default/Daoju/SaveInfo.html
  89. 26 0
      Application/Admin/View/Default/Index/Index.html
  90. 49 0
      Application/Admin/View/Default/Index/Init.html
  91. 107 0
      Application/Admin/View/Default/Power/Index.html
  92. 65 0
      Application/Admin/View/Default/Power/Role.html
  93. 67 0
      Application/Admin/View/Default/Power/RoleSaveInfo.html
  94. 58 0
      Application/Admin/View/Default/PrizeDefaultV2/Index.html
  95. 108 0
      Application/Admin/View/Default/PrizeDefaultV2/SaveInfo.html
  96. 90 0
      Application/Admin/View/Default/PrizeLogV2/Index.html
  97. 126 0
      Application/Admin/View/Default/PrizeLogV2/SaveInfo.html
  98. 11 0
      Application/Admin/View/Default/Public/Common.html
  99. 33 0
      Application/Admin/View/Default/Public/Footer.html
  100. 0 0
      Application/Admin/View/Default/Public/Header.html

+ 11 - 6
.gitignore

@@ -1,6 +1,11 @@
-# ---> Laravel
-/bootstrap/compiled.php
-.env.*.php
-.env.php
-.env
-
+*.html.php
+.DS_Store
+.ide
+*.log
+Runtime
+Temp
+temp
+Logs
+logs
+*.lock
+Application/Common/Conf/master.php

+ 8 - 0
.htaccess

@@ -0,0 +1,8 @@
+<IfModule mod_rewrite.c>
+  Options +FollowSymlinks
+  RewriteEngine On
+
+  RewriteCond %{REQUEST_FILENAME} !-d
+  RewriteCond %{REQUEST_FILENAME} !-f
+  RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
+</IfModule>

+ 30 - 0
Application/Admin/Common/function.php

@@ -0,0 +1,30 @@
+<?php
+
+/**
+ * 模块方法
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+
+/**
+ * [PowerCacheDelete 后台管理员权限缓存数据清除]
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2017-02-26T23:45:26+0800
+ */
+function PowerCacheDelete()
+{
+	$admin = M('Admin')->getField('id', true);
+	if(!empty($admin))
+	{
+		foreach($admin as $id)
+		{
+			S(C('cache_admin_power_key').$id, null);
+			S(C('cache_admin_left_menu_key').$id, null);
+		}
+	}
+}
+?>

+ 1 - 0
Application/Admin/Common/index.html

@@ -0,0 +1 @@
+ 

+ 188 - 0
Application/Admin/Conf/config.php

@@ -0,0 +1,188 @@
+<?php
+
+/**
+ * 模块配置信息
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+
+return array(
+	// 缓存key列表
+	// 权限缓存存储key
+	'cache_admin_power_key'			=>	'cache_admin_power_',
+
+	// 菜单列表
+	'cache_admin_left_menu_key'		=>	'cache_admin_left_menu_',
+
+	// 设置默认的模板主题
+	'DEFAULT_THEME'       			=>	'Default',
+
+    'uploaderPrizeImg'=>'Public/Upload/Activity/image/',
+
+	// 百度编辑器配置信息 ueditor
+	'ueditor_config'				=>	array(
+			// 上传图片配置项
+			// 执行上传图片的action名称
+			'imageActionName'			=>	'uploadimage',
+
+			// 提交的图片表单名称
+			'imageFieldName'			=>	'upfile',
+
+			// 上传大小限制,单位B
+			'imageMaxSize'				=>	MyC('home_max_limit_image', 2048000, true),
+
+			// 上传图片格式显示
+			'imageAllowFiles'			=>	array('.png', '.jpg', '.jpeg', '.gif', '.bmp'),
+
+			// 是否压缩图片,默认是true
+			'imageCompressEnable'		=>	true,
+
+			// 图片压缩最长边限制
+			'imageCompressBorder'		=>	1600,
+
+			// 插入的图片浮动方式
+			'imageInsertAlign'			=>	'none',
+
+			// 图片访问路径前缀
+			'imageUrlPrefix'			=>	'',
+
+			// 上传保存路径,可以自定义保存路径和文件名格式 
+			'imagePathFormat'			=>	__ROOT__.'/Public/Upload/'.I('get.path_type', 'Other').'/image/{yyyy}/{mm}/{dd}/{time}{rand:6}',
+
+
+			// 涂鸦图片上传配置项
+			// 执行上传涂鸦的action名称
+			'scrawlActionName'		=>	'uploadscrawl',
+
+			// 提交的图片表单名称
+			'scrawlFieldName'		=>	'upfile',
+
+			// 上传保存路径,可以自定义保存路径和文件名格式
+			'scrawlPathFormat'		=>	__ROOT__.'/Public/Upload/'.I('get.path_type', 'Other').'/scrawl/{yyyy}/{mm}/{dd}/{time}{rand:6}',
+
+			// 上传大小限制,单位B
+			'scrawlMaxSize'			=>	MyC('home_max_limit_image', 2048000, true),
+
+			// 图片访问路径前缀
+			'scrawlUrlPrefix'		=>	'',
+
+			// 插入的图片浮动方式
+			'scrawlInsertAlign'		=>	'none',
+
+
+			// 截图工具上传
+			// 执行上传截图的action名称
+			'snapscreenActionName'	=>	'uploadimage',
+
+			// 上传保存路径,可以自定义保存路径和文件名格式
+			'snapscreenPathFormat'	=>	__ROOT__.'/Public/Upload/'.I('get.path_type', 'Other').'/screenshot/{yyyy}/{mm}/{dd}/{time}{rand:6}',
+
+			// 图片访问路径前缀
+			'snapscreenUrlPrefix'	=>	'',
+
+			// 插入的图片浮动方式
+			'snapscreenInsertAlign'	=>	'none',
+
+
+			// 抓取远程图片配置
+			// 执行抓取远程图片的action名称
+			'catcherLocalDomain'	=>	array('127.0.0.1', 'localhost', 'img.baidu.com'),
+
+			// 执行抓取远程图片的action名称
+			'catcherActionName'		=>	'catchimage',
+
+			// 提交的图片列表表单名称
+			'catcherFieldName'		=>	'source',
+
+			// 上传保存路径,可以自定义保存路径和文件名格式
+			'catcherPathFormat'		=>	__ROOT__.'/Public/Upload/'.I('get.path_type', 'Other').'/catchimage/{yyyy}/{mm}/{dd}/{time}{rand:6}',
+
+			// 图片访问路径前缀
+			'catcherUrlPrefix'		=>	'',
+
+			// 上传大小限制,单位B
+			'catcherMaxSize'		=>	MyC('home_max_limit_image', 2048000, true),
+
+			// 抓取图片格式显示
+			'catcherAllowFiles'		=>	array('.png', '.jpg', '.jpeg', '.gif', '.bmp'),
+
+
+			// 上传视频配置
+			// 执行上传视频的action名称
+			'videoActionName'		=>	'uploadvideo',
+
+			// 提交的视频表单名称
+			'videoFieldName'		=>	'upfile',
+
+			// 上传保存路径,可以自定义保存路径和文件名格式
+			'videoPathFormat'		=>	__ROOT__.'/Public/Upload/'.I('get.path_type', 'Other').'/video/{yyyy}/{mm}/{dd}/{time}{rand:6}',
+
+			// 视频访问路径前缀
+			'videoUrlPrefix'		=>	'',
+
+			// 上传大小限制,单位B,默认100MB
+			'videoMaxSize'			=>	MyC('home_max_limit_video', 102400000, true),
+
+			// 上传视频格式显示
+			'videoAllowFiles'		=>	array('.flv', '.swf', '.mkv', '.avi', '.rm', '.rmvb', '.mpeg', '.mpg', '.ogg', '.ogv', '.mov', '.wmv', '.mp4', '.webm', '.mp3', '.wav', '.mid'), 
+
+			
+			// 上传文件配置
+			// controller里,执行上传视频的action名称
+			'fileActionName'		=>	'uploadfile',
+
+			// 提交的文件表单名称
+			'fileFieldName'			=>	'upfile',
+
+			// 上传保存路径,可以自定义保存路径和文件名格式
+			'filePathFormat'		=>	__ROOT__.'/Public/Upload/'.I('get.path_type', 'Other').'/file/{yyyy}/{mm}/{dd}/{time}{rand:6}',
+
+			// 文件访问路径前缀
+			'fileUrlPrefix'			=>	'',
+
+			// 上传大小限制,单位B,默认50MB
+			'fileMaxSize'			=>	MyC('home_max_limit_file', 51200000, true),
+
+			// 上传文件格式显示
+			'fileAllowFiles'		=>	array('.png', '.jpg', '.jpeg', '.gif', '.bmp', '.flv', '.swf', '.mkv', '.avi', '.rm', '.rmvb', '.mpeg', '.mpg', '.ogg', '.ogv', '.mov', '.wmv', '.mp4', '.webm', '.mp3', '.wav', '.mid','.rar', '.zip', '.tar', '.gz', '.7z', '.bz2', '.cab', '.iso', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf', '.txt', '.md', '.xml'),
+
+
+			// 列出指定目录下的图片
+			// 执行图片管理的action名称
+			'imageManagerActionName'=>	'listimage',
+
+			// 指定要列出图片的目录
+			'imageManagerListPath'	=>	__ROOT__.'/Public/Upload/'.I('get.path_type', 'Other').'/image/',
+
+			// 每次列出文件数量
+			'imageManagerListSize'	=>	20,
+
+			// 图片访问路径前缀
+			'imageManagerUrlPrefix'	=>	'',
+
+			// 插入的图片浮动方式
+			'imageManagerInsertAlign'=>	'none',
+
+			// 列出的文件类型
+			'imageManagerAllowFiles'=>	array('.png', '.jpg', '.jpeg', '.gif', '.bmp'),
+
+
+			// 列出指定目录下的文件
+			// 执行文件管理的action名称
+			'fileManagerActionName'	=>	'listfile',
+
+			// 指定要列出文件的目录
+			'fileManagerListPath'	=>	__ROOT__.'/Public/Upload/'.I('get.path_type', 'Other').'/file/',
+
+			// 文件访问路径前缀
+			'fileManagerUrlPrefix'	=>	'',
+
+			// 每次列出文件数量
+			'fileManagerListSize'	=>	20,
+
+			// 列出的文件类型
+			'fileManagerAllowFiles'	=>	array('.png', '.jpg', '.jpeg', '.gif', '.bmp', '.flv', '.swf', '.mkv', '.avi', '.rm', '.rmvb', '.mpeg', '.mpg', '.ogg', '.ogv', '.mov', '.wmv', '.mp4', '.webm', '.mp3', '.wav', '.mid','.rar', '.zip', '.tar', '.gz', '.7z', '.bz2', '.cab', '.iso', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf', '.txt', '.md', '.xml'),
+		),
+);

+ 1 - 0
Application/Admin/Conf/index.html

@@ -0,0 +1 @@
+ 

+ 210 - 0
Application/Admin/Controller/ActivityV2Controller.class.php

@@ -0,0 +1,210 @@
+<?php
+
+namespace Admin\Controller;
+
+/**
+ * 样式管理
+ * @author   xusong
+ * @version  0.0.1
+ */
+class ActivityV2Controller extends CommonController {
+
+    /**
+     * [_initialize 前置操作-继承公共前置方法]
+     */
+
+    public function _initialize() {
+        // 调用父类前置方法
+        parent::_initialize();
+        // 登录校验
+        $this->Is_Login();
+        // 权限校验
+        $this->Is_Power();
+        //要执行的表
+    }
+
+    /**
+     * 活动列表
+     * @author   Devil
+     */
+    public function Index() {
+        $List = M('activity_v2')->order('id desc')->select();
+        $this->assign('List', $List);
+        $this->display('Index');
+    }
+
+    /**
+     * [SaveInfo 文章添加/编辑页面]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-14T21:37:02+0800
+     */
+    public function SaveInfo() {
+        // 文章信息
+//        $this->display('test');die;
+        if (empty($_REQUEST['id'])) {
+            var_dump('error');die;
+        } else {
+            $data = M('activity_v2')->find(I('id'));
+            $data['prize_list'] = json_decode($data['prize_list'],TRUE);
+            $data['prize_rule'] = json_decode($data['prize_rule'],TRUE);
+//            var_dump($data);
+            if (empty($data)) {
+                $data['id'] = I('id');
+            }
+        }
+        // 是否启用
+        $this->assign('common_is_enable_list', L('common_is_enable_list'));
+        $this->assign('data', $data);
+        $this->display($data['view']);
+    }
+
+    /**
+     * [Save 文章添加/编辑]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-14T21:37:02+0800
+     */
+    public function Save() {
+        $post = I('post.');
+//        var_dump($post);die;
+        if (!IS_AjAX) {
+            $this->error(L('common_unauthorized_access'));
+        }
+        $prize_length = count($post['prize_id']);
+        if($prize_length){
+            for ($i=0;$i<=$prize_length-1;$i++){
+                $prizes[] = [
+                    'prize_id'=>$post['prize_id'][$i],
+                    'prize_name'=>$post['prize_name'][$i],
+                    'prize_num'=>$post['prize_num'][$i],
+                    'prize_level'=>$post['prize_level'][$i],
+                    'prize_img'=>$post['prize_img'][$i],
+                    'prize_status'=>$post['prize_status'][$i] ? :0,
+                    'prize_object'=>$post['prize_object'][$i]
+                ];
+            }
+            $prize_json = json_encode($prizes,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
+        }
+        $prize_json = $prize_json ? $prize_json : '';
+        //中奖规则序列化
+        $rule_length  = count($post['rule_id']);
+        if($rule_length){
+            for ($i=0;$i<=$rule_length-1;$i++){
+    //            var_dump($prize_name);
+                $prize_id = explode('#', $post['rule_prize_name'][$i])[0];
+                $rules[] = [
+                    'rule_id'=>trim($post['rule_id'][$i]),
+                    'rule_prize_id'=>trim($prize_id),
+                    'rule_prize_name'=>trim($post['rule_prize_name'][$i]),
+                    'rule_num'=>trim($post['rule_num'][$i]),
+                    'rule_probability'=>trim($post['rule_probability'][$i]),
+                    'rule_role'=>trim($post['rule_role'][$i]),
+                    'rule_date'=>trim($post['rule_date'][$i]),
+                    'rule_hour'=>trim($post['rule_hour'][$i]),
+                    'rule_cycle'=>trim($post['rule_cycle'][$i]),
+                    'rule_status'=>trim($post['rule_status'][$i]) ? : 0
+                ];
+            }
+            $rule_json = json_encode($rules,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);            
+        }
+        $rule_json = $rule_json ? $rule_json : '';
+        $data['activity_name'] = trim(I('activity_name'));
+        $data['logic'] = trim(I('logic'));
+        $data['is_enable'] = trim(I('is_enable'));
+        $data['start_at'] = trim(I('start_at'));
+        $data['end_at'] = trim(I('end_at'));
+        $data['introduce'] = trim(I('introduce'));
+        $data['is_test'] = trim(I('is_test'));
+        $data['vip_chance'] = trim(I('vip_chance'));
+        $data['novip_chance'] = trim(I('novip_chance'));
+        $data['prize_list'] = $prize_json;
+        $data['prize_rule'] = $rule_json;
+        $data['view'] = trim(I('view'));
+        $data['prize_log_table'] = trim(I('prize_log_table'));
+        $data['checkvip_style'] = trim(I('checkvip_style'));
+        // 添加
+        if ($id = I('id')) {
+            $data['id'] = $id;
+            $data['updated_at'] = date('Y-m-d H:i:s');
+            if (M('activity_v2')->save($data)) {
+                $this->ajaxReturn('更新成功');
+            } else {
+                $this->ajaxReturn('更新失败',400);
+            }
+        } else {
+            $data['created_at'] = date('Y-m-d H:i:s');
+            $data['updated_at'] = date('Y-m-d H:i:s');
+            if ($bool=M('activity_v2')->add($data)) {
+                $this->ajaxReturn('新增成功');
+            } else {
+                echo M()->getLastSql();
+                $this->ajaxReturn('新增失败',400);
+            }
+        }
+    }
+
+    /**
+     * [Delete 删除]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-15T11:03:30+0800
+     */
+    public function Delete() {
+        // 是否ajax请求
+        if (!IS_AJAX) {
+            $this->error(L('common_unauthorized_access'));
+        }
+        // 删除数据
+        if (I('id')) {
+            // 更新
+            if (M('activity_v2')->delete(I('id'))) {
+                $this->ajaxReturn(L('common_operation_delete_success'));
+            } else {
+                $this->ajaxReturn(L('common_operation_delete_error'), -100);
+            }
+        } else {
+            $this->ajaxReturn(L('common_param_error'), -1);
+        }
+    }
+
+    public function uploadFile($path, $name, $type) {
+
+        $error = FileUploadError($name);
+        if ($error !== true) {
+            $this->ajaxReturn($error, -1);
+        }
+
+        if (!is_dir($path)) {
+            mkdir(ROOT_PATH . $path, 0777, true);
+        }
+        $filename = \time() . '.'.$type;
+        $home_site_logo = $path . $filename;
+        if (move_uploaded_file($_FILES[$name]['tmp_name'], ROOT_PATH . $home_site_logo)) {
+            return $_SERVER['SERVER_NAME'] . '/' . $home_site_logo;
+        }
+    }
+    
+    public function Uploader() {
+        if($load_config = file_get_contents('UploadImageDir.config')){
+            $arr = json_decode($load_config,true);
+            $path = $arr['prize'] ? : C('uploaderPrizeImg');
+        }else{
+            $path = C('uploaderPrizeImg');
+        }
+        $uploader = D('Uploader');
+        if(I('get.model') == 'one'){
+            $uploader->Uploader($path);
+            die;
+        }
+        $info = $uploader->Uploader($path);
+        if ($info['state'] == 'SUCCESS') {
+            $this->ajaxReturn($info['state'], 200);
+        } else {
+            $this->ajaxReturn($info['state'], 400);
+        }
+    }
+}

+ 373 - 0
Application/Admin/Controller/AdminController.class.php

@@ -0,0 +1,373 @@
+<?php
+
+namespace Admin\Controller;
+
+/**
+ * 管理员
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class AdminController extends CommonController
+{
+	/**
+	 * [_initialize 前置操作-继承公共前置方法]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-03T12:39:08+0800
+	 */
+	public function _initialize()
+	{
+		// 调用父类前置方法
+		parent::_initialize();
+	}
+
+	/**
+     * [Index 管理员列表]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-06T21:31:53+0800
+     */
+	public function Index()
+	{
+		// 登录校验
+		$this->Is_Login();
+		
+		// 权限校验
+		$this->Is_Power();
+
+		// 参数
+		$param = array_merge($_POST, $_GET);
+
+		// 模型对象
+		$m = M('Admin');
+
+		// 条件
+		$where = $this->GetIndexWhere();
+
+		// 分页
+		$number = MyC('admin_page_number');
+		$page_param = array(
+				'number'	=>	$number,
+				'total'		=>	$m->where($where)->count(),
+				'where'		=>	$param,
+				'url'		=>	U('Admin/Admin/Index'),
+			);
+		$page = new \My\Page($page_param);
+
+		// 获取管理员列表
+		$list = $m->field(array('id', 'username', 'mobile', 'gender', 'login_total', 'login_time', 'add_time'))->where($where)->limit($page->GetPageStarNumber(), $number)->select();
+		
+		$role = M('Role')->field(array('id', 'name'))->where(array('is_enable'=>1))->select();
+		$this->assign('role', $role);
+		$this->assign('param', $param);
+		$this->assign('page_html', $page->GetPageHtml());
+		$this->assign('list', $list);
+		$this->display('Index');
+	}
+
+	/**
+	 * [GetIndexWhere 管理员列表条件]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T22:16:29+0800
+	 */
+	private function GetIndexWhere()
+	{
+		$where = array();
+		if(!empty($_REQUEST['username']))
+		{
+			$where['username'] = array('like', '%'.I('username').'%');
+		}
+		$role_id = empty($_REQUEST['role_id']) ? 0 : intval(I('role_id'));
+		if($role_id > 0)
+		{
+			$where['role_id'] = $role_id;
+		}
+		return $where;
+	}
+
+	/**
+     * [SaveInfo 管理员添加/编辑页面]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-06T21:31:53+0800
+     */
+	public function SaveInfo()
+	{
+		// 登录校验
+		$this->Is_Login();
+
+		// 不是操作自己的情况下
+		if(I('id') != $this->admin['id'])
+		{
+			// 权限校验
+			$this->Is_Power();
+		}
+
+		// 用户编辑
+		$id = I('id');
+		if($id > 0)
+		{
+			$user =  M('Admin')->where(array('id'=>$id))->field(array('id', 'username', 'mobile', 'gender', 'role_id'))->find();
+			if(empty($user))
+			{
+				$this->error(L('login_username_no_exist'), U('Admin/Index/Index'));
+			}
+			$this->assign('data', $user);
+		}
+
+		$role = M('Role')->field(array('id', 'name'))->where(array('is_enable'=>1, 'id'=>array('gt', 1)))->select();
+		$this->assign('role', $role);
+		$this->assign('id', $id);
+		$this->assign('common_gender_list', L('common_gender_list'));
+		$this->display('SaveInfo');
+	}
+
+	/**
+     * [Save 管理员添加/编辑]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-07T21:58:19+0800
+     */
+	public function Save()
+	{
+		// 登录校验
+		$this->Is_Login();
+
+		if(!IS_AJAX)
+		{
+			$this->error(L('common_unauthorized_access'));
+		}
+
+		// 不是操作自己的情况下
+		if(I('id') != $this->admin['id'])
+		{
+			// 权限校验
+			$this->Is_Power();
+		}
+
+		// id为空则表示是新增
+		if(empty($_POST['id']))
+		{
+			$this->AdminAdd();
+		} else {
+			$this->AdminEdit();
+		}
+	}
+
+	/**
+	 * [AdminAdd 管理员添加]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-24T22:44:28+0800
+	 */
+	private function AdminAdd()
+	{
+		$m = D('Admin');
+		if($m->create($_POST, 1))
+		{
+			// 额外数据处理
+			$m->login_salt	=	GetNumberCode(6);
+			$m->login_pwd 	=	LoginPwdEncryption($m->login_pwd, $m->login_salt);
+			$m->add_time	=	time();
+			
+			// 写入数据库
+			if($m->add())
+			{
+				$this->ajaxReturn(L('common_operation_add_success'));
+			} else {
+				$this->ajaxReturn(L('common_operation_add_error'), -100);
+			}
+		} else {
+			$this->ajaxReturn($m->getError(), -1);
+		}
+	}
+
+	/**
+	 * [AdminEdit 管理员编辑]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-24T22:46:03+0800
+	 */
+	private function AdminEdit()
+	{
+		$m = D('Admin');
+		if($m->create($_POST, 2))
+		{
+			// 不能修改自身所属角色组
+			if(I('id') == $this->admin['id'])
+			{
+				unset($m->role_id);
+			}
+
+			// 有密码,则更新密码
+			if(!empty($_POST['login_pwd']))
+			{
+				$m->login_salt	=	GetNumberCode(6);
+				$m->login_pwd 	=	LoginPwdEncryption($m->login_pwd, $m->login_salt);
+			} else {
+				unset($m->login_pwd);
+			}
+
+			// 移除username,不允许更新用户名
+			unset($m->username);
+
+			// 更新数据库
+			if($m->where(array('id'=>I('id')))->save())
+			{
+				// 编辑自身则退出重新登录
+				if(!empty($_POST['login_pwd']) && I('id') == $this->admin['id'])
+				{
+					session_destroy();
+				}
+
+				$this->ajaxReturn(L('common_operation_edit_success'));
+			} else {
+				$this->ajaxReturn(L('common_operation_edit_error'), -100);
+			}
+		} else {
+			$this->ajaxReturn($m->getError(), -1);
+		}
+	}
+
+	/**
+	 * [Delete 管理员删除]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-09T21:13:47+0800
+	 */
+	public function Delete()
+	{
+		// 登录校验
+		$this->Is_Login();
+
+		// 权限校验
+		$this->Is_Power();
+
+		if(!IS_AJAX)
+		{
+			$this->error(L('common_unauthorized_access'));
+		}
+
+		$m = D('Admin');
+		if($m->create($_POST, 5))
+		{
+			if($m->delete($id))
+			{
+				$this->ajaxReturn(L('common_operation_delete_success'));
+			} else {
+				$this->ajaxReturn(L('common_operation_delete_error'), -100);
+			}
+		} else {
+			$this->ajaxReturn($m->getError(), -1);
+		}
+	}
+
+	/**
+	 * [LoginInfo 登录页面]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-03T12:55:53+0800
+     */
+	public function LoginInfo()
+	{
+		// 是否已登录
+		if(!empty($_SESSION['admin']))
+		{
+			redirect(U('Admin/Index/Index'));
+		}
+
+		$this->display('LoginInfo');
+	}
+
+	/**
+	 * [Login 管理员登录]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-03T21:46:49+0800
+	 */
+	public function Login()
+	{
+		// 是否ajax请求
+		if(!IS_AJAX)
+		{
+			$this->error(L('common_unauthorized_access'));
+		}
+
+		// 登录业务处理
+		$m = D('Admin');
+		if($m->create($_POST, 4))
+		{
+			// 获取管理员
+			$user = $m->field(array('id', 'username', 'login_pwd', 'login_salt', 'mobile', 'login_total', 'role_id'))->where(array('username'=>I('username')))->find();
+			if(empty($user))
+			{
+				$this->ajaxReturn(L('login_username_no_exist'), -2);
+			}
+
+			// 密码校验
+			$login_pwd = LoginPwdEncryption(I('login_pwd'), $user['login_salt']);
+			if($login_pwd != $user['login_pwd'])
+			{
+				$this->ajaxReturn(L('login_login_pwd_error'), -3);
+			}
+
+			// 校验成功
+			// session存储
+			unset($user['login_pwd'], $user['login_salt']);
+			$_SESSION['admin'] = $user;
+
+			// 返回数据,更新数据库
+			if(!empty($_SESSION['admin']))
+			{
+				$login_salt = GetNumberCode(6);
+				$data = array(
+						'login_salt'	=>	$login_salt,
+						'login_pwd'		=>	LoginPwdEncryption(I('login_pwd'), $login_salt),
+						'login_total'	=>	$user['login_total']+1,
+						'login_time'	=>	time(),
+					);
+				if($m->where(array('id'=>$user['id']))->save($data))
+				{
+					// 清空缓存目录下的数据
+					EmptyDir(C('DATA_CACHE_PATH'));
+
+					$this->ajaxReturn(L('login_login_success'));
+				}
+			}
+
+			// 失败
+			unset($_SESSION['admin']);
+			$this->ajaxReturn(L('login_login_error'), -100);
+		} else {
+			// 自动验证失败
+			$this->ajaxReturn($m->getError(), -1);
+		}
+	}
+
+	/**
+	 * [Logout 退出]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-05T14:31:23+0800
+	 */
+	public function Logout()
+	{
+		session_destroy();
+		redirect(U('Admin/Admin/LoginInfo'));
+	}
+}
+?>

+ 96 - 0
Application/Admin/Controller/CacheController.class.php

@@ -0,0 +1,96 @@
+<?php
+
+namespace Admin\Controller;
+
+/**
+ * 缓存管理
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class CacheController extends CommonController
+{
+	/**
+	 * [_initialize 前置操作-继承公共前置方法]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-03T12:39:08+0800
+	 */
+	public function _initialize()
+	{
+		// 调用父类前置方法
+		parent::_initialize();
+
+		// 登录校验
+		$this->Is_Login();
+
+		// 权限校验
+		$this->Is_Power();
+	}
+
+	/**
+	 * [Index 首页]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2017-02-26T19:13:29+0800
+	 */
+	public function Index()
+	{
+		$this->assign('cache_type_list', L('cache_type_list'));
+		$this->display('Index');
+	}
+
+	/**
+	 * [SiteUpdate 站点缓存更新]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2017-02-26T19:53:14+0800
+	 */
+	public function SiteUpdate()
+	{
+		// 后台
+		S(C('cache_common_my_config_key'), null);
+		S(C('cache_common_timezone_key'), null);
+		S(C('cache_common_home_nav_header_key'), null);
+		S(C('cache_common_home_nav_footer_key'), null);
+		S(C('cache_common_default_theme_key'), null);
+		PowerCacheDelete();
+
+		// 前台
+		S(C('cache_home_channel_key'), null);
+
+		$this->success(L('common_operation_update_success'));
+	}
+
+	/**
+	 * [TemplateUpdate 模板缓存更新]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2017-02-26T19:53:14+0800
+	 */
+	public function TemplateUpdate()
+	{
+		// 模板 Cache
+		DelDirFile(CACHE_PATH);
+
+		$this->success(L('common_operation_update_success'));
+	}
+
+	/**
+	 * [ModuleUpdate 模块缓存更新]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2017-02-26T19:53:14+0800
+	 */
+	public function ModuleUpdate()
+	{
+		$this->success(L('common_operation_update_success'));
+	}
+}
+?>

+ 89 - 0
Application/Admin/Controller/CleanPrizeLogController.class.php

@@ -0,0 +1,89 @@
+<?php
+
+namespace Admin\Controller;
+
+/**
+ * 样式管理
+ * @author   xusong
+ * @version  0.0.1
+ */
+class CleanPrizeLogController extends CommonController {
+
+    /**
+     * [_initialize 前置操作-继承公共前置方法]
+     */
+
+    public function _initialize() {
+        // 调用父类前置方法
+        parent::_initialize();
+        // 登录校验
+        $this->Is_Login();
+        // 权限校验
+        $this->Is_Power();
+        //要执行的表
+    }
+
+    /**
+     * 活动列表
+     * @author   Devil
+     */
+    public function Index() {
+        $keyword = I('keyword','');
+        if($keyword){
+            $where['activity_name'] = array('like','%'.$keyword.'%');
+        }else{
+            $where = 1;
+        }
+        $List = M('activity_v2')->field('id,activity_name')->where($where)->order('id desc')->select();
+        $this->assign('List', $List);
+        $this->assign('keyword',$keyword);
+        $this->display('Index');
+    }
+
+
+    /**
+     * [Delete 删除]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-15T11:03:30+0800
+     */
+    public function clean() {
+        // 是否ajax请求
+        if (!IS_AJAX) {
+            $this->error(L('common_unauthorized_access'));
+        }
+        $act_id = I('act_id');
+        $actinfo = M('activity_v2')->field('id,prize_log_table')->find($act_id);
+        if(!$actinfo){
+            exit('相关活动不存在,清除数据失败');
+        }
+        //清理prize_log
+        if(false === M($actinfo['prize_log_table'])->where(['act_id'=>$actinfo['id']])->delete()){
+            exit(M()->getLastSql());
+        }
+
+        //清理daooju
+        if(false === M('activity_daoju')->where(['act_id'=>$actinfo['id']])->delete()){
+            exit(M()->getLastSql());
+        }
+
+        //清理中奖联系方式
+        if(false === M('activity_user_v2')->where(['act_id'=>$actinfo['id']])->delete()){
+            exit(M()->getLastSql());
+        }
+
+        //清理游戏消耗次数
+        if(false === M('activity_take_part')->where(['act_id'=>$actinfo['id']])->delete()){
+            exit(M()->getLastSql());
+        }
+
+        //清理集卡
+        if(false === M('activity_collect')->where(['act_id'=>$actinfo['id']])->delete()){
+            exit(M()->getLastSql());
+        }
+
+        exit('清理活动数据成功');
+    }
+
+}

+ 350 - 0
Application/Admin/Controller/CommonController.class.php

@@ -0,0 +1,350 @@
+<?php
+
+namespace Admin\Controller;
+use Think\Controller;
+
+/**
+ * 管理员
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class CommonController extends Controller
+{
+	// 用户
+	protected $user;
+
+	// 权限
+	protected $power;
+
+	// 左边权限菜单
+	protected $left_menu;
+
+	/**
+	 * [__construt 构造方法]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-03T12:29:53+0800
+	 * @param    [string]       $msg  [提示信息]
+	 * @param    [int]          $code [状态码]
+	 * @param    [mixed]        $data [数据]
+	 */
+	protected function _initialize()
+	{
+		// 配置信息初始化
+		MyConfigInit();
+		
+		// 权限
+		$this->PowerInit();
+
+		// 视图初始化
+		$this->ViewInit();
+	}
+
+	/**
+	 * [ajaxReturn 重写ajax返回方法]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-07T22:03:40+0800
+	 * @param    [string]       $msg  [提示信息]
+	 * @param    [int]          $code [状态码]
+	 * @param    [mixed]        $data [数据]
+	 * @return   [json]               [json数据]
+	 */
+	protected function ajaxReturn($msg = '', $code = 0, $data = '')
+	{
+		// ajax的时候,success和error错误由当前方法接收
+		if(IS_AJAX)
+		{
+			if(isset($msg['info']))
+			{
+				// success模式下code=0, error模式下code参数-1
+				$result = array('msg'=>$msg['info'], 'code'=>-1, 'data'=>'');
+			}
+		}
+		
+		// 默认情况下,手动调用当前方法
+		if(empty($result))
+		{
+			$result = array('msg'=>$msg, 'code'=>$code, 'data'=>$data);
+		}
+
+		// 错误情况下,防止提示信息为空
+		if($result['code'] != 0 && empty($result['msg']))
+		{
+			$result['msg'] = L('common_operation_error');
+		}
+		exit(json_encode($result));
+	}
+
+	/*
+	 * 设置分导航参数
+	 * @param object $page 导航连接对象
+	 * @param string|array $config 参数设置
+	 */
+	function page_config($page, $config = "PAGE_CONFIG"){	
+		if(!is_object($page)) return $page;
+		if(method_exists($page,'setConfig')){		
+			$page ->lastSuffix =false;
+			if(is_string($config)) $config = C($config);	
+			if(is_array($config)){
+				foreach ($config as $key => $val){
+					$page->setConfig($key,$val);
+				}
+			}
+		}
+		return $page;
+	}
+
+	/**
+	 * [Is_Login 登录校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-03T12:42:35+0800
+	 */
+	protected function Is_Login()
+	{
+		if(empty($_SESSION['admin']))
+		{
+			$this->error(L('common_login_invalid'), U('Admin/Admin/LoginInfo'));
+		} else {
+			// 用户
+			$this->admin = I('session.admin');
+		}
+	}
+
+	/**
+	 * [ViewInit 视图初始化]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-03T12:30:06+0800
+	 */
+	public function ViewInit()
+	{
+		// 主题
+		$default_theme = C('DEFAULT_THEME');
+		$this->assign('default_theme', $default_theme);
+
+		// 控制器静态文件状态css,js
+		$module_css = MODULE_NAME.DS.$default_theme.DS.'Css'.DS.CONTROLLER_NAME.'.css';
+		$this->assign('module_css', file_exists(ROOT_PATH.'Public'.DS.$module_css) ? $module_css : '');
+		$module_js = MODULE_NAME.DS.$default_theme.DS.'Js'.DS.CONTROLLER_NAME.'.js';
+		$this->assign('module_js', file_exists(ROOT_PATH.'Public'.DS.$module_js) ? $module_js : '');
+
+		// 权限菜单
+		$this->assign('left_menu', $this->left_menu);
+
+		// 用户
+		$this->assign('admin', $this->admin);
+
+		// 图片host地址
+		$this->assign('image_host', C('IMAGE_HOST'));
+	}
+
+	/**
+	 * [PowerInit 权限初始化]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-19T22:41:20+0800
+	 */
+	private function PowerInit()
+	{
+		// 基础参数
+		$admin_id = isset($_SESSION['admin']['id']) ? intval($_SESSION['admin']['id']) : 0;
+		$role_id = isset($_SESSION['admin']['role_id']) ? intval($_SESSION['admin']['role_id']) : 0;
+
+		// 读取缓存数据
+		$this->left_menu = S(C('cache_admin_left_menu_key').$admin_id);
+		$this->power = S(C('cache_admin_power_key').$admin_id);
+
+		// 缓存没数据则从数据库重新读取
+		if(($role_id > 0 || $admin_id == 1) && empty($this->left_menu))
+		{
+			// 获取一级数据
+			$p = M('Power');
+			if($admin_id == 1)
+			{
+				$field = array('id', 'name', 'control', 'action', 'is_show', 'icon');
+				$this->left_menu = $p->where(array('pid' => 0))->field($field)->order('sort')->select();
+			} else {
+				$field = array('p.id', 'p.name', 'p.control', 'p.action', 'p.is_show', 'p.icon');
+				$this->left_menu = $p->alias('p')->join('__ROLE_POWER__ AS rp ON p.id = rp.power_id')->where(array('rp.role_id' => $role_id, 'p.pid' => 0))->field($field)->order('p.sort')->select();
+			}
+			
+			// 有数据,则处理子级数据
+			if(!empty($this->left_menu))
+			{
+				foreach($this->left_menu as $k=>$v)
+				{
+					// 权限
+					$this->power[$v['id']] = strtolower($v['control'].'_'.$v['action']);
+
+					// 获取子权限
+					if($admin_id == 1)
+					{
+						$item = $p->where(array('pid' => $v['id']))->field($field)->order('sort')->select();
+					} else {
+						$item = $p->alias('p')->join('__ROLE_POWER__ AS rp ON p.id = rp.power_id')->where(array('rp.role_id' => $role_id, 'p.pid' => $v['id']))->field($field)->order('p.sort')->select();
+					}
+
+					// 权限列表
+					if(!empty($item))
+					{
+						foreach($item as $ks=>$vs)
+						{
+							// 权限
+							$this->power[$vs['id']] = strtolower($vs['control'].'_'.$vs['action']);
+
+							// 是否显示视图
+							if($vs['is_show'] == 0)
+							{
+								unset($item[$ks]);
+							}
+						}
+					}
+
+					// 是否显示视图
+					if($v['is_show'] == 1)
+					{
+						// 子级
+						$this->left_menu[$k]['item'] = $item;
+					} else {
+						unset($this->left_menu[$k]);
+					}
+				}
+			}
+			S(C('cache_admin_left_menu_key').$admin_id, $this->left_menu);
+			S(C('cache_admin_power_key').$admin_id, $this->power);
+		}
+	}
+
+	/**
+	 * [Is_Power 是否有权限]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-20T19:18:29+0800
+	 */
+	protected function Is_Power()
+	{
+		// 不需要校验权限的方法
+		$unwanted_power = array('getnodeson');
+		if(!in_array(strtolower(ACTION_NAME), $unwanted_power))
+		{
+			// 角色组权限列表校验
+			if(!in_array(strtolower(CONTROLLER_NAME.'_'.ACTION_NAME), $this->power))
+			{
+				$this->error(L('common_there_is_no_power'));
+			}
+		}
+	}
+
+	/**
+	 * [GetClassList 获取班级列表,二级]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-30T13:26:00+0800
+	 * @return [array] [班级列表]
+	 */
+	protected function GetClassList()
+	{
+		$m = M('Class');
+		$data = $m->field(array('id', 'name'))->where(array('is_enable'=>1, 'pid'=>0))->select();
+		if(!empty($data))
+		{
+			foreach($data as $k=>$v)
+			{
+				$data[$k]['item'] = $m->field(array('id', 'name'))->where(array('is_enable'=>1, 'pid'=>$v['id']))->select();
+			}
+		}
+		return $data;
+	}
+
+	/**
+	 * [GetRoomList 获取教室列表,二级]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-30T13:26:00+0800
+	 * @return [array] [班级列表]
+	 */
+	protected function GetRoomList()
+	{
+		$m = M('Room');
+		$data = $m->field(array('id', 'name'))->where(array('is_enable'=>1, 'pid'=>0))->select();
+		if(!empty($data))
+		{
+			foreach($data as $k=>$v)
+			{
+				$data[$k]['item'] = $m->field(array('id', 'name'))->where(array('is_enable'=>1, 'pid'=>$v['id']))->select();
+			}
+		}
+		return $data;
+	}
+
+	/**
+	 * [MyConfigSave 配置数据保存]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2017-01-02T23:08:19+0800
+	 */
+	protected function MyConfigSave()
+	{
+		// 是否ajax请求
+		if(!IS_AJAX)
+		{
+			$this->error(L('common_unauthorized_access'));
+		}
+
+		// 参数校验
+		if(empty($_POST))
+		{
+			$this->error(L('common_param_error'));
+		}
+
+		// 循环保存数据
+		$success = 0;
+		$c = M('Config');
+
+		// 不实例化的字段
+		$no_all = array(
+				'home_footer_info',
+				'home_site_close_reason',
+				'home_email_user_reg',
+				'home_email_user_forget_pwd',
+				'home_email_user_student_binding',
+				'home_email_user_email_binding',
+			);
+
+		// 开始更新数据
+		foreach($_POST as $k=>$v)
+		{
+			if(!in_array($k, $no_all))
+			{
+				$v = I($k);
+			}
+			if($c->where(array('only_tag'=>$k))->save(array('value'=>$v, 'upd_time'=>time())))
+			{
+				$success++;
+			}
+		}
+		if($success > 0)
+		{
+			// 配置信息更新
+			MyConfigInit(1);
+
+			$this->ajaxReturn(L('common_operation_edit_success').'['.$success.']');
+		} else {
+			$this->ajaxReturn(L('common_operation_edit_error'), -100);
+		}
+	}
+}
+?>

+ 226 - 0
Application/Admin/Controller/DaojuController.class.php

@@ -0,0 +1,226 @@
+<?php
+
+namespace Admin\Controller;
+
+/**
+ * 样式管理
+ * @author   brent
+ * @version  0.0.1
+ */
+class DaojuController extends CommonController {
+
+    protected $table = ''; //表名
+
+    /**
+     * [_initialize 前置操作-继承公共前置方法]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-03T12:39:08+0800
+     */
+
+    public function _initialize() {
+        // 调用父类前置方法
+        parent::_initialize();
+
+        // 登录校验
+        $this->Is_Login();
+
+        // 权限校验
+        $this->Is_Power();
+        //要执行的表
+        $this->table = M('activity_daoju');
+    }
+
+    /**
+     * [Index 文章列表]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-06T21:31:53+0800
+     */
+    public function Index() {
+        //关键字
+        $keyword = I('keyword');
+        if($keyword){
+            $where['uid'] = ['like',"%$keyword%"];
+        }
+        $listRows = I('listRows',100,'intval');
+        if($p = I('p',1,'intval')){
+            $offset = ($p-1)*$listRows;
+        }
+        $acts = M('activity_v2')->field('id,activity_name')->select();
+        $this->assign('acts', $acts);
+
+        //活动id
+        $act_id = trim(I('act_id'));
+  
+        if($act_id){
+            $where['act_id'] = $act_id;
+        }else{
+            $this->display('Index');
+            die;
+        }
+        $List = M('activity_daoju')
+                ->where($where)
+                ->limit($offset,$listRows)
+                ->select();
+        $activitys = M('activity_v2')->field('id,activity_name,prize_list')->where(['id'=>$act_id])->select();
+        foreach($activitys as $row){
+            $activity_info[$row['id']] = ['activity_name'=>$row['activity_name']];
+        }
+//        var_dump($activity_info);die;
+        foreach ($List as $key=>$row) {
+            $List[$key]['activity_name'] = $activity_info[$row['act_id']]['activity_name'];
+        }
+        if(I('model')=='exportExcel'){
+            $this->exportPrizeLog($List);
+            die;
+        }
+//        var_dump($List);die;
+        $count = $this->table->alias('pl')->where($where)->count();
+        $Page = new \Think\Page($count, $listRows);
+        $Page->parameter .= "&p=[PAGE]";
+        $Page->parameter .= "&act_id=".$act_id;
+        $Page->parameter .= "&keyword=".$keyword;
+        $Page = $this->page_config($Page);
+        $show = $Page->show();
+        $this->assign('page', $show);
+        $this->assign('List', $List);
+        //获取所有活动
+        $this->assign('keyword', $keyword);
+        $this->assign('act_id', $act_id);
+        $this->display('Index');
+    }
+    
+    public function exportPrizeLog($data)
+    {   
+        $title = array(
+            'id'                                 =>  array('col' => 'A', 'name' => '抽奖记录ID'),
+            'iptv_user_id'                       =>  array('col' => 'B', 'name' => '用户ID'),
+            'prize_name'                         =>  array('col' => 'C', 'name' => '中奖产品'),
+            'user_phone'                         =>  array('col' => 'D', 'name' => '联系方式'),
+            'activity_name'                      =>  array('col' => 'E', 'name' => '活动名称'),
+            'created_at'                         =>  array('col' => 'F', 'name' => '中奖时间'),
+        );    
+        // Excel驱动导出数据
+        $excel = new \My\Excel(array('filename' => '中奖记录', 'title' => $title, 'data' => $data, 'msg' => L('common_not_data_tips')));
+        $excel->Export();          
+    }
+
+    /**
+     * [SaveInfo 文章添加/编辑页面]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-14T21:37:02+0800
+     */
+    public function SaveInfo() {
+        // 文章信息
+        if (empty($_REQUEST['id'])) {
+            $data = array();
+        } else {
+            $data = $this->table->find(I('id'));
+            if (empty($data)) {
+                $data = array('id' => I('id'));
+            }
+        }
+        $this->assign('data', $data);
+        $this->display('SaveInfo');
+    }
+
+    /**
+     * [Save 文章添加/编辑]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-14T21:37:02+0800
+     */
+    public function Save() {
+        // 是否ajax请求
+        if (!IS_AjAX) {
+            $this->error(L('common_unauthorized_access'));
+        }
+        // 添加
+        if (empty($_POST['id'])) {
+            $this->Add();
+
+            // 编辑
+        } else {
+            $this->Edit();
+        }
+    }
+
+    /**
+     * [Add 文章添加]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-18T16:20:59+0800
+     */
+    private function Add() {
+        $m = $this->table;
+        $data['created_at'] = date('Y-m-d H:i:s', time());
+        $data['prize_name'] = I('prize_name');
+        $data['prize_img'] = I('prize_img');
+        $data['prize_num'] = I('prize_num');
+
+        // 数据添加
+        if ($m->add($data)) {
+            echo 100;
+        } else {
+            echo -100;
+        }
+    }
+
+    /**
+     * [Edit 文章编辑]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-17T22:13:40+0800
+     */
+    private function Edit() {
+
+        $data = array();
+        $m=$this->table;
+        // 额外数据处理
+        $data['created_at'] = date('Y-m-d H:i:s', time());
+        $data['created_at'] = date('Y-m-d H:i:s', time());
+        $data['prize_name'] = I('prize_name');
+        $data['prize_img'] = I('prize_img');
+        $data['prize_num'] = I('prize_num');
+        // 数据更新
+        if ($m->where(array('id' => I('id')))->save($data)) {
+            echo 100;
+        } else {
+             echo -100;
+        }
+    }
+
+    /**
+     * [Delete 删除]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-15T11:03:30+0800
+     */
+    public function Delete() {
+        // 是否ajax请求
+        if (!IS_AJAX) {
+            $this->error(L('common_unauthorized_access'));
+        }
+
+        // 删除数据
+        if (!empty($_POST['id'])) {
+            // 更新
+            if ($this->table->delete(I('id'))) {
+                $this->ajaxReturn(L('common_operation_delete_success'));
+            } else {
+                $this->ajaxReturn(L('common_operation_delete_error'), -100);
+            }
+        } else {
+            $this->ajaxReturn(L('common_param_error'), -1);
+        }
+    }
+}

+ 64 - 0
Application/Admin/Controller/IndexController.class.php

@@ -0,0 +1,64 @@
+<?php
+
+namespace Admin\Controller;
+
+/**
+ * 首页
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class IndexController extends CommonController
+{
+	/**
+	 * [_initialize 前置操作-继承公共前置方法]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-03T12:39:08+0800
+	 */
+	public function _initialize()
+	{
+		// 调用父类前置方法
+		parent::_initialize();
+
+		// 登录校验
+		$this->Is_Login();
+	}
+
+	/**
+	 * [Index 首页]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2017-01-05T21:36:13+0800
+	 */
+	public function Index()
+	{
+		$this->display('Index');
+	}
+
+	/**
+	 * [Init 初始化页面]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2017-01-05T21:36:41+0800
+	 */
+	public function Init()
+	{
+		$mysql_ver = M()->query('SELECT VERSION() AS `ver`');
+		$data = array(
+				'server_ver'	=>	php_sapi_name(),
+				'php_ver'		=>	PHP_VERSION,
+				'mysql_ver'		=>	isset($mysql_ver[0]['ver']) ? $mysql_ver[0]['ver'] : '',
+				'os_ver'		=>	PHP_OS,
+				'host'			=>	isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : '',
+				'ver'			=>	L('common_application_name').' '.L('common_application_ver'),
+			);
+		$this->assign('data', $data);
+		$this->display('Init');
+	}
+}
+?>

+ 461 - 0
Application/Admin/Controller/PowerController.class.php

@@ -0,0 +1,461 @@
+<?php
+
+namespace Admin\Controller;
+
+/**
+ * 权限管理
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class PowerController extends CommonController
+{
+	/**
+	 * [_initialize 前置操作-继承公共前置方法]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-03T12:39:08+0800
+	 */
+	public function _initialize()
+	{
+		// 调用父类前置方法
+		parent::_initialize();
+
+		// 登录校验
+		$this->Is_Login();
+
+		// 权限校验
+		$this->Is_Power();
+	}
+
+	/**
+     * [Index 权限组列表]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-06T21:31:53+0800
+     */
+	public function Index()
+	{
+		// 获取权限列表
+		$m = M('Power');
+		$field = array('id', 'pid', 'name', 'control', 'action', 'sort', 'is_show', 'icon');
+		$list = $m->field($field)->where(array('pid'=>0))->order('sort')->select();
+		if(!empty($list))
+		{
+			foreach($list as $k=>$v)
+			{
+				$item =  $m->field($field)->where(array('pid'=>$v['id']))->order('sort')->select();
+				if(!empty($item))
+				{
+					$list[$k]['item'] = $item;
+				}
+			}
+		}
+		$this->assign('common_is_show_list', L('common_is_show_list'));
+		$this->assign('list', $list);
+		$this->display('Index');
+	}
+
+	/**
+	 * [PowerSave 权限添加/编辑]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T21:41:03+0800
+	 */
+	public function PowerSave()
+	{
+		// 是否ajax请求
+		if(!IS_AJAX)
+		{
+			$this->error(L('common_unauthorized_access'));
+		}
+
+		// id为空则表示是新增
+		$m = D('Power');
+
+		// 公共额外数据处理
+		$m->sort 	=	intval(I('sort'));
+
+		// 添加
+		if(empty($_POST['id']))
+		{
+			if($m->create($_POST, 1))
+			{
+				// 额外数据处理
+				$m->add_time	=	time();
+				$m->name 		=	I('name');
+				$m->control 	=	I('control');
+				$m->action 		=	I('action');
+				$m->icon 		=	I('icon');
+				
+				// 写入数据库
+				if($m->add())
+				{
+					// 清除用户权限数据
+					PowerCacheDelete();
+
+					$this->ajaxReturn(L('common_operation_add_success'));
+				} else {
+					$this->ajaxReturn(L('common_operation_add_error'), -100);
+				}
+			}
+		} else {
+			// 编辑
+			if($m->create($_POST, 2))
+			{
+				// 额外数据处理
+				$m->name 		=	I('name');
+				$m->control 	=	I('control');
+				$m->action 		=	I('action');
+				$m->icon 		=	I('icon');
+
+				// 移除 id
+				unset($m->id);
+
+				// 更新数据库
+				if($m->where(array('id'=>I('id')))->save())
+				{
+					// 清除用户权限数据
+					PowerCacheDelete();
+
+					$this->ajaxReturn(L('common_operation_edit_success'));
+				} else {
+					$this->ajaxReturn(L('common_operation_edit_error'), -100);
+				}
+			}
+		}
+		$this->ajaxReturn($m->getError(), -1);
+	}
+
+	/**
+	 * [PowerDelete 权限删除]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-14T21:40:29+0800
+	 */
+	public function PowerDelete()
+	{
+		if(!IS_AJAX)
+		{
+			$this->error(L('common_unauthorized_access'));
+		}
+
+		$m = D('Power');
+		if($m->create($_POST, 5))
+		{
+			if($m->delete(I('id')))
+			{
+				// 清除用户权限数据
+				PowerCacheDelete();
+
+				$this->ajaxReturn(L('common_operation_delete_success'));
+			} else {
+				$this->ajaxReturn(L('common_operation_delete_error'), -100);
+			}
+		} else {
+			$this->ajaxReturn($m->getError(), -1);
+		}
+	}
+
+	/**
+	 * [Role 角色组列表]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-14T21:37:02+0800
+	 */
+	public function Role()
+	{
+		$m = M('Role');
+		$list = $m->field(array('id', 'name', 'is_enable', 'add_time'))->select();
+		if(!empty($list))
+		{
+			foreach($list as $k=>$v)
+			{
+				// 关联查询权限和角色数据
+				if($v['id'] == 1)
+				{
+					$list[$k]['item'] = M('Power')->select();
+				} else {
+					$list[$k]['item'] = $m->alias('r')->join('__ROLE_POWER__ AS rp ON rp.role_id = r.id')->join('__POWER__ AS p ON rp.power_id = p.id')->where(array('r.id'=>$v['id']))->field(array('p.id', 'p.name'))->select();
+				}
+			}
+		}
+		$this->assign('list', $list);
+		$this->display('Role');
+	}
+
+	/**
+	 * [RoleSaveInfo 角色组添加/编辑页面]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-14T21:37:02+0800
+	 */
+	public function RoleSaveInfo()
+	{
+		// 角色组
+		$role = M('Role')->field(array('id', 'name', 'is_enable'))->find(I('id'));
+		$role_id = isset($role['id']) ? $role['id'] : $this->admin['role_id'];
+		$power = array();
+		if($role_id > 0)
+		{
+			// 权限关联数据
+			$action = empty($_REQUEST['id']) ? array() : M('RolePower')->where(array('role_id'=>$role_id))->getField('power_id', true);
+
+			// 权限列表
+			$m = M('Power');
+			$power_field = array('id', 'name', 'is_show');
+			$power = $m->field($power_field)->where(array('pid'=>0))->order('sort')->select();
+			if(!empty($power))
+			{
+				foreach($power as $k=>$v)
+				{
+					// 是否有权限
+					$power[$k]['is_power'] = in_array($v['id'], $action) ? 'ok' : 'no';
+
+					// 获取子权限
+					$item =  $m->field($power_field)->where(array('pid'=>$v['id']))->order('sort')->select();
+					if(!empty($item))
+					{
+						foreach($item as $ks=>$vs)
+						{
+							$item[$ks]['is_power'] = in_array($vs['id'], $action) ? 'ok' : 'no';
+						}
+						$power[$k]['item'] = $item;
+					}
+				}
+			}
+		}
+		$this->assign('common_is_enable_list', L('common_is_enable_list'));
+		$this->assign('data', $role);
+		$this->assign('power', $power);
+		$this->display('RoleSaveInfo');
+	}
+
+	/**
+	 * [RoleSave 角色组添加/编辑]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-14T21:37:02+0800
+	 */
+	public function RoleSave()
+	{
+		// 是否ajax请求
+		if(!IS_AJAX)
+		{
+			$this->error(L('common_unauthorized_access'));
+		}
+
+		// 添加
+		if(empty($_POST['id']))
+		{
+			$this->RoleAdd();
+
+		// 编辑
+		} else {
+			if(I('id') == 1)
+			{
+				$this->error(L('common_do_not_operate'), -10);
+			} else {
+				$this->RoleEdit();
+			}
+		}
+	}
+
+	/**
+	 * [RoleAdd 角色添加]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-18T16:20:59+0800
+	 */
+	private function RoleAdd()
+	{
+		// 角色对象
+		$r = M('Role');
+
+		// 数据自动校验
+		if($r->create($_POST, 1))
+		{
+			// 开启事务
+			$r->startTrans();
+
+			// 角色添加
+			$role_data = array(
+					'name'		=>	I('name'),
+					'is_enable'	=>	I('is_enable'),
+					'add_time'	=>	time(),
+				);
+			$role_id = $r->add($role_data);
+
+			// 角色权限关联添加
+			$rp_state = true;
+			if(!empty($_POST['power_id']) && is_array($_POST['power_id']))
+			{
+				// 角色权限关联对象
+				$rp = M('RolePower');
+				foreach($_POST['power_id'] as $power_id)
+				{
+					if(!empty($power_id))
+					{
+						$rp_data = array(
+								'role_id'	=>	$role_id,
+								'power_id'	=>	$power_id,
+								'add_time'	=>	time(),
+							);
+						if(!$rp->add($rp_data))
+						{
+							$rp_state = false;
+							break;
+						}
+					}
+				}
+			}
+			if($role_id && $rp_state)
+			{
+				// 提交事务
+				$r->commit();
+
+				// 清除用户权限数据
+				PowerCacheDelete();
+
+				$this->ajaxReturn(L('common_operation_add_success'));
+			} else {
+				// 回滚事务
+				$r->rollback();
+				$this->ajaxReturn(L('common_operation_add_error'), -100);
+			}
+		} else {
+			$this->ajaxReturn($m->getError(), -1);
+		}
+	}
+
+	/**
+	 * [RoleEdit 角色和角色权限关联编辑]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-17T22:13:40+0800
+	 */
+	private function RoleEdit()
+	{
+		// 角色对象
+		$r = M('Role');
+
+		// 数据自动校验
+		if($r->create($_POST, 2))
+		{
+			// 开启事务
+			$r->startTrans();
+
+			// 角色数据更新
+			$role_data = array(
+					'name'		=>	I('name'),
+					'is_enable'	=>	I('is_enable'),
+				);
+			$r_state = ($r->where(array('id'=>I('id')))->save($role_data) !== false);
+
+			// 角色权限关联对象
+			$rp = M('RolePower');
+
+			// 角色id
+			$role_id = I('id');
+
+			// 权限关联数据删除
+			$rp_del_state = $rp->where(array('role_id'=>$role_id))->delete();
+
+			// 权限关联数据添加
+			$rp_state = true;
+			if(!empty($_POST['power_id']))
+			{
+				$power_id_list = explode(',', $_POST['power_id']);
+				foreach($power_id_list as $power_id)
+				{
+					if(!empty($power_id))
+					{
+						$rp_data = array(
+								'role_id'	=>	$role_id,
+								'power_id'	=>	$power_id,
+								'add_time'	=>	time(),
+							);
+						if(!$rp->add($rp_data))
+						{
+							$rp_state = false;
+							break;
+						}
+					}
+				}
+			}
+			if($r_state !== false && $rp_del_state !== false && $rp_state !== false)
+			{
+				// 提交事务
+				$r->commit();
+
+				// 清除用户权限数据
+				PowerCacheDelete();
+
+				$this->ajaxReturn(L('common_operation_edit_success'));
+			} else {
+				// 回滚事务
+				$r->rollback();
+				$this->ajaxReturn(L('common_operation_edit_error'), -100);
+			}
+		} else {
+			$this->ajaxReturn($m->getError(), -1);
+		}
+	}
+
+	/**
+	 * [RoleDelete 角色删除]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-15T11:03:30+0800
+	 */
+	public function RoleDelete()
+	{
+		// 是否ajax请求
+		if(!IS_AJAX)
+		{
+			$this->error(L('common_unauthorized_access'));
+		}
+
+		// 参数是否有误
+		if(empty($_POST['id']))
+		{
+			$this->ajaxReturn(L('common_param_error'), -1);
+		}
+
+		// 角色模型
+		$r = M('Role');
+
+		// 开启事务
+		$r->startTrans();
+
+		// 删除角色
+		$role_state = $r->delete(I('id'));
+		$rp_state = M('RolePower')->where(array('role_id'=>I('id')))->delete();
+		if($role_state !== false && $rp_state !== false)
+		{
+			// 提交事务
+			$r->commit();
+
+			// 清除用户权限数据
+			PowerCacheDelete();
+
+			$this->ajaxReturn(L('common_operation_delete_success'));
+		} else {
+			// 回滚事务
+			$r->rollback();
+			$this->ajaxReturn(L('common_operation_delete_error'), -100);
+		}
+	}
+}
+?>

+ 149 - 0
Application/Admin/Controller/PrizeDefaultV2Controller.class.php

@@ -0,0 +1,149 @@
+<?php
+
+namespace Admin\Controller;
+
+/**
+ * 样式管理
+ * @author   xusong
+ * @version  0.0.1
+ */
+class PrizeDefaultV2Controller extends CommonController {
+
+    protected $table = ''; //表名
+
+    /**
+     * [_initialize 前置操作-继承公共前置方法]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-03T12:39:08+0800
+     */
+
+    public function _initialize() {
+        // 调用父类前置方法
+        parent::_initialize();
+
+        // 登录校验
+        $this->Is_Login();
+
+        // 权限校验
+        $this->Is_Power();
+        //要执行的表
+        $this->table = M('prize_default_v2');
+    }
+
+    /**
+     * [Index 列表]
+     */
+    public function Index() {
+
+        
+        $data = $this->table
+                ->order('id Desc')
+                ->select();
+        $prize_list = M('activity_v2')->getField('id,prize_list,activity_name');
+        foreach ($prize_list as $key => $value) {
+            $prizes[$key]['activity_name'] = $value['activity_name'];
+            foreach (json_decode($value['prize_list'],TRUE) as $k => $v) {
+                $tmp[$v['prize_id']] = $v;
+            }
+            $prizes[$key]['prize_list'] = $tmp;
+        }
+//        dump($prizes);
+        $this->assign('List', $data);
+        $this->assign('Prizes', $prizes);
+        $this->display('Index');
+    }
+
+
+    /**
+     * [SaveInfo 添加/编辑页面]
+     */
+    public function SaveInfo() {
+
+        $data = M('Activity_v2')->field('id,activity_name')->select();
+        $this->assign('Acts', $data);
+        $this->display('SaveInfo');
+    }
+
+    /**
+     * [Save 添加/编辑]
+     */
+    public function Save() {
+        // 是否ajax请求
+        if (!IS_AjAX) {
+            $this->error(L('common_unauthorized_access'));
+        }
+
+        $data = array(
+            'act_id'        =>I('act_id'),
+            'prize_id'      =>I('prize_id'),
+            'uid'           =>I('uid'),
+            'phone'         =>I('phone'),
+            'prize_date'    =>I('prize_date')
+        );
+
+        if (empty(I('id'))) {
+            // 添加
+            if (M('Prize_default_v2')->add($data)) {
+                $this->ajaxReturn('添加成功');
+            } else {
+                $this->ajaxReturn('添加失败',400);
+            }
+        } else {
+            // 数据更新
+            if (M('Prize_default_v2')->where(array('id' => I('id')))->save($data)!==false) {
+                $this->ajaxReturn('更新成功');
+            } else {
+                echo M()->getLastSql();die;
+                $this->ajaxReturn('更新失败',400);
+            }
+        }
+    }
+
+
+    /**
+     * [Delete 删除]
+     */
+    public function Delete() {
+        // 是否ajax请求
+        if (!IS_AJAX) {
+            $this->error(L('common_unauthorized_access'));
+        }
+
+        // 删除数据
+        if (!empty(I('id'))) {
+            // 更新
+            if ($this->table->delete(I('id'))) {
+                $this->ajaxReturn(L('common_operation_delete_success'));
+            } else {
+                $this->ajaxReturn(L('common_operation_delete_error'), -100);
+            }
+        } else {
+            $this->ajaxReturn(L('common_param_error'), -1);
+        }
+    }
+    
+    /**
+     * [Search 搜索]
+     */
+    public function Search()
+    {
+        $act_id = I('act_id');
+        if(empty($act_id)){
+            echo json_encode(array());
+            die;
+        }
+        $data['activity'] = M('Activity_v2')->where(['id'=>$act_id])->find();
+        
+        $data['activity']['start_at'] = $data['activity']['start_at'];        
+        $data['activity']['end_at'] = $data['activity']['end_at'];
+//         dump(json_decode($data['activity']['prize_list'],true));
+        $data['prizes'] = json_decode($data['activity']['prize_list'],true);
+        echo json_encode($data);
+
+    }
+    
+
+
+}

+ 250 - 0
Application/Admin/Controller/PrizeLogV2Controller.class.php

@@ -0,0 +1,250 @@
+<?php
+
+namespace Admin\Controller;
+
+/**
+ * 样式管理
+ * @author   brent
+ * @version  0.0.1
+ */
+class PrizeLogV2Controller extends CommonController {
+
+    protected $table = ''; //表名
+
+    /**
+     * [_initialize 前置操作-继承公共前置方法]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-03T12:39:08+0800
+     */
+
+    public function _initialize() {
+        // 调用父类前置方法
+        parent::_initialize();
+
+        // 登录校验
+        $this->Is_Login();
+
+        // 权限校验
+        $this->Is_Power();
+        //要执行的表
+        $this->table = M('prize_log_v2');
+    }
+
+    /**
+     * [Index 文章列表]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-06T21:31:53+0800
+     */
+    public function Index() {
+        //关键字
+        $keyword = I('keyword');
+        if($keyword){
+            $where['pl.uid'] = ['like',"%$keyword%"];
+        }
+        //中奖状态
+        $prize_status = I('prize_status',1);
+        if($prize_status>-1){
+            $where['pl.prize_status'] = $prize_status;
+        }
+        $listRows = I('listRows',100,'intval');
+        if($p = I('p',1,'intval')){
+            $offset = ($p-1)*$listRows;
+        }
+        $acts = M('activity_v2')->field('id,activity_name')->select();
+        $this->assign('acts', $acts);
+
+        //活动id
+        $act_id = trim(I('act_id'));
+  
+        if($act_id){
+            $where['pl.act_id'] = $act_id;
+        }else{
+            $this->display('Index');
+            die;
+        }
+
+        $List = M('prize_log_v2')
+                ->where($where)
+                ->alias('pl')
+                ->join("__ACTIVITY_USER_V2__ as au ON au.uid = pl.uid AND pl.act_id = au.act_id","left")
+                ->field('pl.id,pl.prize_id, pl.prize_status,pl.uid, pl.created_at, pl.is_vip, au.user_phone,au.receiver,au.address,pl.act_id')
+                ->order('pl.created_at Desc')
+                ->limit($offset,$listRows)
+                ->select();
+        // var_dump(M()->getlastSql());die;
+        $activitys = M('activity_v2')->field('id,activity_name,prize_list')->where(['id'=>$act_id])->select();
+        foreach($activitys as $row){
+            foreach (json_decode($row['prize_list'], TRUE) as $key => $value) {
+                $prize_list[$value['prize_id']] = ['prize_id'=>$value['prize_id'],'prize_name'=>$value['prize_name']];
+            }
+            $activity_info[$row['id']] = ['activity_name'=>$row['activity_name'],'prize_list'=>$prize_list];
+        }
+//        var_dump($activity_info);die;
+        foreach ($List as $key=>$row) {
+            $List[$key]['activity_name'] = $activity_info[$row['act_id']]['activity_name'];
+            $List[$key]['prize_name'] = $activity_info[$row['act_id']]['prize_list'][$row['prize_id']]['prize_name'];
+        }
+        if(I('model')=='exportExcel'){
+            $this->exportPrizeLog($List);
+            die;
+        }
+//        var_dump($List);die;
+        $count = $this->table->alias('pl')->where($where)->count();
+        $Page = new \Think\Page($count, $listRows);
+        $Page->parameter .= "&p=[PAGE]";
+        $Page->parameter .= "&prize_status=".$prize_status;
+        $Page->parameter .= "&act_id=".$act_id;
+        $Page->parameter .= "&keyword=".$keyword;
+        $Page = $this->page_config($Page);
+        $show = $Page->show();
+        $this->assign('page', $show);
+//         echo $this->table->getlastSQL();die;
+        $this->assign('List', $List);
+        //获取所有活动
+        $this->assign('keyword', $keyword);
+        $this->assign('prize_status', $prize_status);
+        $this->assign('act_id', $act_id);
+        $this->display('Index');
+    }
+    
+    public function exportPrizeLog($data)
+    {   
+        $title = array(
+            'id'                                 =>  array('col' => 'A', 'name' => '抽奖记录ID'),
+            'iptv_user_id'                       =>  array('col' => 'B', 'name' => '用户ID'),
+            'prize_name'                         =>  array('col' => 'C', 'name' => '中奖产品'),
+            'user_phone'                         =>  array('col' => 'D', 'name' => '联系方式'),
+            'activity_name'                      =>  array('col' => 'E', 'name' => '活动名称'),
+            'created_at'                         =>  array('col' => 'F', 'name' => '中奖时间'),
+        );    
+        // Excel驱动导出数据
+        $excel = new \My\Excel(array('filename' => '中奖记录', 'title' => $title, 'data' => $data, 'msg' => L('common_not_data_tips')));
+        $excel->Export();          
+    }
+
+    /**
+     * [SaveInfo 文章添加/编辑页面]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-14T21:37:02+0800
+     */
+    public function SaveInfo() {
+        // 文章信息
+        if (empty($_REQUEST['id'])) {
+            $data = array();
+        } else {
+            $data = $this->table->find(I('id'));
+            if (empty($data)) {
+                $data = array('id' => I('id'));
+            }
+        }
+        $this->assign('data', $data);
+        $this->display('SaveInfo');
+    }
+
+    /**
+     * [Save 文章添加/编辑]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-14T21:37:02+0800
+     */
+    public function Save() {
+        // 是否ajax请求
+        if (!IS_AjAX) {
+            $this->error(L('common_unauthorized_access'));
+        }
+        // 添加
+        if (empty($_POST['id'])) {
+            $this->Add();
+
+            // 编辑
+        } else {
+            $this->Edit();
+        }
+    }
+
+    /**
+     * [Add 文章添加]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-18T16:20:59+0800
+     */
+    private function Add() {
+        $m = $this->table;
+        $data['created_at'] = date('Y-m-d H:i:s', time());
+        $data['prize_name'] = I('prize_name');
+        $data['prize_img'] = I('prize_img');
+        $data['prize_num'] = I('prize_num');
+
+        // 数据添加
+        if ($m->add($data)) {
+            echo 100;
+        } else {
+            echo -100;
+        }
+    }
+
+    /**
+     * [Edit 文章编辑]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-17T22:13:40+0800
+     */
+    private function Edit() {
+
+        $data = array();
+        $m=$this->table;
+        // 额外数据处理
+        $data['created_at'] = date('Y-m-d H:i:s', time());
+        $data['created_at'] = date('Y-m-d H:i:s', time());
+        $data['prize_name'] = I('prize_name');
+        $data['prize_img'] = I('prize_img');
+        $data['prize_num'] = I('prize_num');
+        // 数据更新
+        if ($m->where(array('id' => I('id')))->save($data)) {
+            echo 100;
+        } else {
+             echo -100;
+        }
+    }
+
+    /**
+     * [Delete 删除]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-15T11:03:30+0800
+     */
+    public function Delete() {
+        // 是否ajax请求
+        if (!IS_AJAX) {
+            $this->error(L('common_unauthorized_access'));
+        }
+
+        // 删除数据
+        if (!empty($_POST['id'])) {
+            // 更新
+            $prize_info = $this->table->find(I('id'));
+            $where['act_id'] = $prize_info['act_id'];
+            $where['uid'] = $prize_info['uid'];
+
+            if ($this->table->delete(I('id'))) {
+                //清空联系记录
+                M('activity_user_v2')->where([$where])->delete();
+                $this->ajaxReturn(L('common_operation_delete_success'));
+            } else {
+                $this->ajaxReturn(L('common_operation_delete_error'), -100);
+            }
+        } else {
+            $this->ajaxReturn(L('common_param_error'), -1);
+        }
+    }
+}

+ 57 - 0
Application/Admin/Controller/SelectActivityController.class.php

@@ -0,0 +1,57 @@
+<?php
+
+namespace Admin\Controller;
+
+/**
+ * 样式管理
+ * @author   brent
+ * @version  0.0.1
+ */
+class SelectActivityController extends CommonController {
+
+    protected $table = ''; //表名
+
+    /**
+     * [_initialize 前置操作-继承公共前置方法]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-03T12:39:08+0800
+     */
+
+    public function _initialize() {
+        // 调用父类前置方法
+        parent::_initialize();
+
+        // 登录校验
+        $this->Is_Login();
+
+        // 权限校验
+        $this->Is_Power();
+    }
+
+    /**
+     * [Index 文章列表]
+     * @author   Devil
+     * @blog     http://gong.gg/
+     * @version  0.0.1
+     * @datetime 2016-12-06T21:31:53+0800
+     */
+    public function Index() {
+        $activitys = C('activity');
+        $this->assign('activitys',$activitys);
+        $this->display('Index');
+    }
+    public function select() {
+        $view = I('get.view');
+        $data['logic'] = I('get.logic');
+        $data['view'] = I('get.view');
+        $data['prize_log_table'] = I('get.log');
+
+        $this->assign('data',$data);
+        $this->display($view);
+    }
+
+}
+
+?>

+ 1 - 0
Application/Admin/Controller/index.html

@@ -0,0 +1 @@
+ 

+ 292 - 0
Application/Admin/Lang/zh-cn.php

@@ -0,0 +1,292 @@
+<?php
+
+/**
+ * 模块语言包
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 学生excel导出标题列表,
+	// 索引对应数据库字段名称,
+	// col对应excel列标记,
+	// type定义excel数据类型
+	'excel_student_title_list'		=>	array(
+			'username'		=>	array(
+					'col' => 'A',
+					'name' => '学生姓名',
+					'type' => 'string',
+				),
+			'number'		=>	array(
+					'col' => 'B',
+					'name' => '学生编号',
+					'type' => 'int',
+				),
+			'id_card'		=>	array(
+					'col' => 'C',
+					'name' => '身份证号码',
+					'type' => 'int',
+				),
+			'gender'		=>	array(
+					'col' => 'D',
+					'name' => '性别',
+					'type' => 'string',
+				),
+			'birthday'		=>	array(
+					'col' => 'E',
+					'name' => '出生年日',
+					'type' => 'string',
+				),
+			'tel'			=>	array(
+					'col' => 'F',
+					'name' => '座机号码',
+					'type' => 'int',
+				),
+			'my_mobile'		=>	array(
+					'col' => 'G',
+					'name' => '学生手机',
+					'type' => 'int',
+				),
+			'parent_mobile'	=>	array(
+					'col' => 'H',
+					'name' => '家长手机',
+					'type' => 'int',
+				),
+			'email'			=>	array(
+					'col' => 'I',
+					'name' => '电子邮箱',
+					'type' => 'string',
+				),
+			'state'			=>	array(
+					'col' => 'J',
+					'name' => '学生状态',
+					'type' => 'string',
+				),
+			'tuition_state'	=>	array(
+					'col' => 'K',
+					'name' => '缴费状态',
+					'type' => 'string',
+				),
+			'class_name'	=>	array(
+					'col' => 'L',
+					'name' => '班级',
+					'type' => 'string',
+				),
+			'region_name'	=>	array(
+					'col' => 'M',
+					'name' => '地区',
+					'type' => 'string',
+				),
+			'address'		=>	array(
+					'col' => 'N',
+					'name' => '详细地址',
+					'type' => 'string',
+				),
+			'add_time'		=>	array(
+					'col' => 'O',
+					'name' => '报名时间',
+					'type' => 'string',
+				),
+		),
+	// 学生excel导出标题列表-导入格式
+	'excel_student_impoet_title_list'		=>	array(
+			'username'		=>	array(
+					'col' => 'A',
+					'name' => '学生姓名',
+					'type' => 'string',
+				),
+			'id_card'		=>	array(
+					'col' => 'B',
+					'name' => '身份证号码',
+					'type' => 'int',
+				),
+			'gender'		=>	array(
+					'col' => 'C',
+					'name' => '性别',
+					'type' => 'string',
+				),
+			'birthday'		=>	array(
+					'col' => 'D',
+					'name' => '出生年日',
+					'type' => 'string',
+				),
+			'tel'			=>	array(
+					'col' => 'E',
+					'name' => '座机号码',
+					'type' => 'int',
+				),
+			'my_mobile'		=>	array(
+					'col' => 'F',
+					'name' => '学生手机',
+					'type' => 'int',
+				),
+			'parent_mobile'	=>	array(
+					'col' => 'G',
+					'name' => '家长手机',
+					'type' => 'int',
+				),
+			'email'			=>	array(
+					'col' => 'H',
+					'name' => '电子邮箱',
+					'type' => 'string',
+				),
+			'state'			=>	array(
+					'col' => 'I',
+					'name' => '学生状态',
+					'type' => 'string',
+				),
+			'tuition_state'	=>	array(
+					'col' => 'J',
+					'name' => '缴费状态',
+					'type' => 'string',
+				),
+			'class_name'	=>	array(
+					'col' => 'K',
+					'name' => '班级',
+					'type' => 'string',
+				),
+			'region_name'	=>	array(
+					'col' => 'L',
+					'name' => '地区',
+					'type' => 'string',
+				),
+			'address'		=>	array(
+					'col' => 'M',
+					'name' => '详细地址',
+					'type' => 'string',
+				),
+			'add_time'		=>	array(
+					'col' => 'N',
+					'name' => '报名时间',
+					'type' => 'string',
+				),
+		),
+
+	// 学生成绩excel导出标题列表
+	'excel_fraction_title_list'		=>	array(
+			'username'		=>	array(
+					'col' => 'A',
+					'name' => '学生姓名',
+					'type' => 'string',
+				),
+			'gender'		=>	array(
+					'col' => 'B',
+					'name' => '性别',
+					'type' => 'string',
+				),
+			'class_name'	=>	array(
+					'col' => 'C',
+					'name' => '班级',
+					'type' => 'string',
+				),
+			'subject_name'	=>	array(
+					'col' => 'D',
+					'name' => '科目',
+					'type' => 'string',
+				),
+			'score_name'	=>	array(
+					'col' => 'E',
+					'name' => '成绩类别',
+					'type' => 'string',
+				),
+			'score'			=>	array(
+					'col' => 'F',
+					'name' => '成绩分数',
+					'type' => 'int',
+				),
+			'score_level'	=>	array(
+					'col' => 'G',
+					'name' => '成绩等级',
+					'type' => 'string',
+				),
+			'comment'		=>	array(
+					'col' => 'H',
+					'name' => '教师点评',
+					'type' => 'string',
+				),
+			'add_time'		=>	array(
+					'col' => 'I',
+					'name' => '录入时间',
+					'type' => 'string',
+				),
+		),
+	// 学生成绩excel导出标题列表-导入格式
+	'excel_fraction_import_title_list'		=>	array(
+			'username'		=>	array(
+					'col' => 'A',
+					'name' => '学生姓名',
+					'type' => 'string',
+				),
+			'number'		=>	array(
+					'col' => 'B',
+					'name' => '学生编号',
+					'type' => 'int',
+				),
+			'id_card'		=>	array(
+					'col' => 'C',
+					'name' => '身份证号码',
+					'type' => 'int',
+				),
+			'subject_name'	=>	array(
+					'col' => 'D',
+					'name' => '科目',
+					'type' => 'string',
+				),
+			'score_name'	=>	array(
+					'col' => 'E',
+					'name' => '成绩类别',
+					'type' => 'string',
+				),
+			'score'			=>	array(
+					'col' => 'F',
+					'name' => '成绩分数',
+					'type' => 'int',
+				),
+			'comment'		=>	array(
+					'col' => 'G',
+					'name' => '教师点评',
+					'type' => 'string',
+				),
+			'add_time'		=>	array(
+					'col' => 'H',
+					'name' => '录入时间',
+					'type' => 'string',
+				),
+		),
+
+	// 教师excel导出标题列表
+	'excel_teacher_title_list'		=>	array(
+			'username'		=>	array('col' => 'A', 'name' => '教师姓名'),
+			'id_card'		=>	array('col' => 'B', 'name' => '身份证号码'),
+			'gender'		=>	array('col' => 'C', 'name' => '性别'),
+			'birthday'		=>	array('col' => 'D', 'name' => '出生年日'),
+			'tel'			=>	array('col' => 'E', 'name' => '联系电话'),
+			'address'		=>	array('col' => 'F', 'name' => '详细地址'),
+			'state'			=>	array('col' => 'G', 'name' => '教师状态'),
+			'subject_list'	=>	array('col' => 'H', 'name' => '贯通科目'),
+			'add_time'		=>	array('col' => 'I', 'name' => '添加时间'),
+		),
+
+	// 教师课程excel导出标题列表
+	'excel_course_title_list'		=>	array(
+			'teacher_name'	=>	array('col' => 'A', 'name' => '教师姓名'),
+			'class_name'	=>	array('col' => 'B', 'name' => '班级'),
+			'subject_name'	=>	array('col' => 'C', 'name' => '科目'),
+			'week_name'		=>	array('col' => 'D', 'name' => '周天'),
+			'interval_name'	=>	array('col' => 'E', 'name' => '时段'),
+			'room_name'		=>	array('col' => 'F', 'name' => '教室'),
+			'state_text'	=>	array('col' => 'G', 'name' => '状态'),
+			'add_time'		=>	array('col' => 'H', 'name' => '添加时间'),
+		),
+
+	// 文章excel导出标题列表
+	'excel_article_title_list'		=>	array(
+			'title'						=>	array('col' => 'A', 'name' => '标题'),
+			'article_class_name'		=>	array('col' => 'B', 'name' => '文章分类'),
+			'is_enable_text'			=>	array('col' => 'C', 'name' => '是否启用'),
+			'content'					=>	array('col' => 'D', 'name' => '内容'),
+			'add_time'					=>	array('col' => 'E', 'name' => '添加时间'),
+		),
+);
+?>

+ 33 - 0
Application/Admin/Lang/zh-cn/admin.php

@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * 模块语言包-管理员
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 登录
+	'login_username_text'				=>	'用户名',
+	'login_login_pwd_text'				=>	'登录密码',
+	'login_username_format'				=>	'用户名格式 5~18 个字符(可以是字母数字下划线)',
+	'login_login_pwd_format'			=>	'密码格式 6~18 个字符',
+	'login_role_id_format'				=>	'请选择所属角色组',
+	'login_button_text'					=>	'登录',
+	'login_forgot_pwd_text'				=>	'忘记密码?',
+	'login_forgot_pwd_tips'				=>	'请联系管理员重置密码',
+	'login_username_no_exist'			=>	'管理员不存在',
+	'login_login_pwd_error'				=>	'密码错误',
+	'login_role_id_error'				=>	'角色不存在',
+	'login_login_error'					=>	'登录失败,请稍后再试!',
+	'login_login_success'				=>	'登录成功',
+
+	// 管理员添加及编辑
+	'login_total_name'					=>	'登录次数',
+	'login_last_time_name'				=>	'最后登录时间',
+	'admin_add_name'					=>	'管理员添加',
+	'admin_edit_name'					=>	'管理员编辑',
+	'admin_view_role_name'				=>	'权限组',
+);
+?>

+ 27 - 0
Application/Admin/Lang/zh-cn/article.php

@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * 模块语言包-文章
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'article_add_name'					=>	'文章添加',
+	'article_edit_name'					=>	'文章编辑',
+	'article_title_text'				=>	'标题',
+	'article_jump_url_text'				=>	'跳转url地址',
+	'article_content_text'				=>	'内容',
+	'article_class_text'				=>	'文章分类',
+	'article_title_format'				=>	'标题长度 3~60 个字符',
+	'article_jump_url_format'			=>	'跳转url地址格式有误',
+	'article_content_format'			=>	'内容长度最少 50~105000 个字符',
+	'article_content_format_mobile'		=>	'更多编辑功能请使用电脑访问',
+	'article_class_format'				=>	'请选择文章分类',
+	'article_article_class_id_error'	=>	'文章分类id不存在',
+	'article_so_keyword_tips'			=>	'标题关键字',
+	'article_images_upload_format'		=>	'为了站点自适应结构美观,图片尺寸比例:宽度的%'.MyC('common_image_proportion', 56.23, true).' [计算规则 '.MyC('common_image_proportion', 56.23, true).'除以100再乘以宽度] 得到高度',
+);
+?>

+ 15 - 0
Application/Admin/Lang/zh-cn/articleclass.php

@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * 模块语言包-文章分类
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'articleclass_add_name'					=>	'文章分类添加',
+	'articleclass_edit_name'				=>	'文章分类编辑',
+);
+?>

+ 15 - 0
Application/Admin/Lang/zh-cn/bubble.php

@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * 模块语言包-冒泡
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	'bubble_praise_table_nickname'				=>	'用户',
+	'bubble_praise_table_add_time'				=>	'点赞时间',
+	'bubble_so_keyword_tips'					=>	'昵称/手机/邮箱/说说',
+);
+?>

+ 33 - 0
Application/Admin/Lang/zh-cn/cache.php

@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * 模块语言包-缓存管理
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 缓存类型列表
+	'cache_type_list'			=>	array(
+			array(
+				'is_enable' => 1,
+				'name' => '站点缓存',
+				'url' => U('Admin/Cache/SiteUpdate'),
+				'desc' => '数据转换后或前台不能正常访问时,可以使用此功能更新所有缓存'
+			),
+			array(
+				'is_enable' => 1,
+				'name' => '模板缓存',
+				'url' => U('Admin/Cache/TemplateUpdate'),
+				'desc' => '当页面显示不正常,可尝试使用此功能修复'
+			),
+			array(
+				'is_enable' => 0,
+				'name' => '模块缓存',
+				'url' => U('Admin/Cache/ModuleUpdate'),
+				'desc' => '更新页面布局与模块后未生效,可尝试使用此功能修复'
+			),
+		),
+);
+?>

+ 15 - 0
Application/Admin/Lang/zh-cn/class.php

@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * 模块语言包-班级
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'class_add_name'					=>	'班级添加',
+	'class_edit_name'					=>	'班级编辑',
+);
+?>

+ 14 - 0
Application/Admin/Lang/zh-cn/config.php

@@ -0,0 +1,14 @@
+<?php
+
+/**
+ * 模块语言包-配置信息
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	
+);
+?>

+ 34 - 0
Application/Admin/Lang/zh-cn/course.php

@@ -0,0 +1,34 @@
+<?php
+
+/**
+ * 模块语言包-课程
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'course_add_name'					=>	'课程添加',
+	'course_edit_name'					=>	'课程编辑',
+	'course_class_text'					=>	'班级',
+	'course_week_text'					=>	'周天',
+	'course_subject_text'				=>	'科目',
+	'course_interval_text'				=>	'时段',
+	'course_class_format'				=>	'请选择班级',
+	'course_week_format'				=>	'请选择周天',
+	'course_subject_format'				=>	'请选择科目',
+	'course_interval_format'			=>	'请选择时段',
+	'course_teacher_tips'				=>	'教师不存在',
+	'course_class_tips'					=>	'班级不存在',
+	'course_subject_tips'				=>	'科目不存在',
+	'course_week_tips'					=>	'周天不存在',
+	'course_interval_tips'				=>	'时段不存在',
+	'course_so_keyword_tips'			=>	'教师姓名',
+	'course_teacher_text'				=>	'教师姓名',
+	'course_room_text'					=>	'教室',
+	'course_room_format'				=>	'请选择教室',
+	'course_room_tips'					=>	'教室不存在',
+	'course_room_occupy_tips'			=>	'当前周天时段的教室已被占用',
+);
+?>

+ 21 - 0
Application/Admin/Lang/zh-cn/customview.php

@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * 模块语言包-自定义页面
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'customview_add_name'					=>	'自定义页面添加',
+	'customview_edit_name'					=>	'自定义页面编辑',
+	'customview_title_text'					=>	'标题',
+	'customview_content_text'				=>	'内容',
+	'customview_title_format'				=>	'标题长度 3~60 个字符',
+	'customview_content_format'				=>	'内容长度最少 50~105000 个字符',
+	'customview_content_format_mobile'		=>	'更多编辑功能请使用电脑访问',
+	'customview_so_keyword_tips'			=>	'标题关键字',
+);
+?>

+ 17 - 0
Application/Admin/Lang/zh-cn/email.php

@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * 模块语言包-邮箱设置
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	'email_email_nav_name'			=>	'邮箱设置',
+	'email_message_nav_name'		=>	'消息模板',
+	'email_test_email_text'			=>	'测试接收的邮件地址',
+	'email_test_email_tips'			=>	'请先保存后,再进行测试',
+	'email_test_email_send_content'	=>	'邮件配置-发送测试内容',
+);
+?>

+ 32 - 0
Application/Admin/Lang/zh-cn/fraction.php

@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * 模块语言包-成绩
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'fraction_add_name'					=>	'成绩添加',
+	'fraction_edit_name'				=>	'成绩编辑',
+	'fraction_score_id_text'			=>	'期号',
+	'fraction_score_id_format'			=>	'请选择成绩期号',
+	'fraction_score_id_error'			=>	'成绩期号有误',
+	'fraction_subject_text'				=>	'科目',
+	'fraction_subject_format'			=>	'请选择科目',
+	'fraction_subject_error'			=>	'科目分类有误',
+	'fraction_score_text'				=>	'成绩',
+	'fraction_score_format'				=>	'分数格式错误,纯数字,不能超过3位',
+	'fraction_student_error'			=>	'该学生不存在',
+	'fraction_username_text'			=>	'学生姓名',
+	'fraction_student_username_format'	=>	'学生真实姓名',
+	'fraction_student_id_error'			=>	'学生信息有误',
+	'fraction_score_level_text'			=>	'等级',
+	'fraction_class_id_text'			=>	'班级',
+	'fraction_comment_text'				=>	'教师点评',
+	'fraction_comment_format'			=>	'教师点评,不能超过255个字符',
+	'fraction_excel_import_tips'		=>	'1、录入时间选填项,留空则使用当前导入时间。<br />2、所有数据字段以文本格式上传,如[ 成绩分数 ]',
+);
+?>

+ 28 - 0
Application/Admin/Lang/zh-cn/index.php

@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * 模块语言包-首页
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 列表
+	'server_ver_nam	'					=>	'服务器信息',
+	'php_ver_name'						=>	'PHP版本',
+	'mysql_ver_name'					=>	'MySQL版本',
+	'os_ver_name'						=>	'操作系统',
+	'host_name'							=>	'当前域名',
+	'ver_name'							=>	'软件版本',
+	'server_ver_name'					=>	'服务器端信息',
+	'ver_to_view_name'					=>	'查看最新版本',
+	'copyright_name'					=>	'版权所有',
+	'originator_name'					=>	'发起人',
+	'research_name'						=>	'研发成员',
+	'ued_name'							=>	'UED',
+	'market_operation'					=>	'市场运作',
+	'os_view_title'						=>	'系统信息',
+	'team_view_title'					=>	'开发团队',
+);
+?>

+ 17 - 0
Application/Admin/Lang/zh-cn/interval.php

@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * 模块语言包-时段
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'interval_add_name'					=>	'时段添加',
+	'interval_edit_name'				=>	'时段编辑',
+	'interval_name_format'				=>	'时段格式错误 格式如 10:00-11:30',
+	'interval_name_format_tips'			=>	'格式如 10:00-11:30',
+);
+?>

+ 24 - 0
Application/Admin/Lang/zh-cn/link.php

@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * 模块语言包-友情链接
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 公共
+	'link_add_name'						=>	'友情链接添加',
+	'link_edit_name'					=>	'友情链接编辑',
+
+	// 自定义导航
+	'link_name_text'					=>	'名称',
+	'link_name_format'					=>	'名称格式 2~16 个字符',
+	'link_describe_text'				=>	'描述',
+	'link_describe_format'				=>	'描述不能大于60个字符',
+	'link_url_text'						=>	'链接地址',
+	'link_url_text_tips'				=>	'带http://',
+	'link_url_format'					=>	'链接地址格式有误',
+);
+?>

+ 37 - 0
Application/Admin/Lang/zh-cn/navfooter.php

@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * 模块语言包-底部导航
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 公共
+	'navheader_add_name'					=>	'导航添加',
+	'navheader_edit_name'					=>	'导航编辑',
+	'navheader_custom_operation_add'		=>	'自定义',
+	'navheader_article_class_operation_add'	=>	'分类',
+	'navheader_customview_operation_add'	=>	'页面',
+	'navheader_article_class_name_format'	=>	'默认文章分类名称',
+	'navheader_customview_name_format'		=>	'默认自定义页面名称',
+
+	// 自定义导航
+	'navheader_level_text'					=>	'导航级别',
+	'navheader_level_format'				=>	'导航级别选择错误',
+	'navheader_name_text'					=>	'导航名称',
+	'navheader_name_format'					=>	'导航名称格式 2~16 个字符',
+	'navheader_url_text'					=>	'url地址',
+	'navheader_url_text_tips'				=>	'带http://',
+	'navheader_url_format'					=>	'url格式有误',
+
+	// 文章分类导航
+	'navheader_article_class_id_text'		=>	'文章分类',
+	'navheader_article_class_id_format'		=>	'文章分类选择有误',
+
+	// 自定义页面导航
+	'navheader_customview_id_text'			=>	'自定义页面',
+	'navheader_customview_id_format'		=>	'自定义页面选择有误',
+);
+?>

+ 37 - 0
Application/Admin/Lang/zh-cn/navheader.php

@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * 模块语言包-顶部导航
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 公共
+	'navheader_add_name'					=>	'导航添加',
+	'navheader_edit_name'					=>	'导航编辑',
+	'navheader_custom_operation_add'		=>	'自定义',
+	'navheader_article_class_operation_add'	=>	'分类',
+	'navheader_customview_operation_add'	=>	'页面',
+	'navheader_article_class_name_format'	=>	'默认文章分类名称',
+	'navheader_customview_name_format'		=>	'默认自定义页面名称',
+
+	// 自定义导航
+	'navheader_level_text'					=>	'导航级别',
+	'navheader_level_format'				=>	'导航级别选择错误',
+	'navheader_name_text'					=>	'导航名称',
+	'navheader_name_format'					=>	'导航名称格式 2~16 个字符',
+	'navheader_url_text'					=>	'url地址',
+	'navheader_url_text_tips'				=>	'带http://',
+	'navheader_url_format'					=>	'url格式有误',
+
+	// 文章分类导航
+	'navheader_article_class_id_text'		=>	'文章分类',
+	'navheader_article_class_id_format'		=>	'文章分类选择有误',
+
+	// 自定义页面导航
+	'navheader_customview_id_text'			=>	'自定义页面',
+	'navheader_customview_id_format'		=>	'自定义页面选择有误',
+);
+?>

+ 35 - 0
Application/Admin/Lang/zh-cn/power.php

@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * 模块语言包-权限管理
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 登录
+	'power_level_text'					=>	'栏目级别',
+	'power_name_text'					=>	'权限名称',
+	'power_control_text'				=>	'控制器名称',
+	'power_action_text'					=>	'方法名称',
+	'power_name_format'					=>	'权限名称格式 2~8 个字符之间',
+	'power_control_format'				=>	'控制器名格式 1~30 个字符之间(必须以字母开始,可以是字母数字下划线)',
+	'power_action_format'				=>	'方法名格式 1~30 个字符之间(必须以字母开始,可以是字母数字下划线)',
+	'power_level_format'				=>	'栏目级别选择错误',
+	'power_add_name'					=>	'权限添加',
+	'power_edit_name'					=>	'权限编辑',
+	'power_no_exist_tips'				=>	'权限数据不存在',
+	'power_exist_item_tips'				=>	'该权限存在子级数据',
+	'power_view_have_title'				=>	'拥有权限',
+	'role_view_role_text'				=>	'角色名称',
+	'role_name_format'					=>	'角色名称格式 2~8 个字符之间',
+	'role_no_exist_tips'				=>	'角色数据不存在',
+	'power_level_format'				=>	'栏目级别选择错误',
+	'role_add_name'						=>	'角色添加',
+	'role_edit_name'					=>	'角色编辑',
+	'power_icon_text'					=>	'图标class',
+	'power_icon_format'					=>	'图标格式 0~30 个字符之间',
+	'power_icon_tips'					=>	'参考 [http://amazeui.org/css/icon]',
+);
+?>

+ 15 - 0
Application/Admin/Lang/zh-cn/region.php

@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * 模块语言包-地区
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 登录
+	'region_add_name'					=>	'地区添加',
+	'region_edit_name'					=>	'地区编辑',
+);
+?>

+ 15 - 0
Application/Admin/Lang/zh-cn/room.php

@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * 模块语言包-教室
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'room_add_name'					=>	'教室添加',
+	'room_edit_name'					=>	'教室编辑',
+);
+?>

+ 15 - 0
Application/Admin/Lang/zh-cn/score.php

@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * 模块语言包-成绩
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'score_add_name'					=>	'成绩添加',
+	'score_edit_name'				=>	'成绩编辑',
+);
+?>

+ 15 - 0
Application/Admin/Lang/zh-cn/semester.php

@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * 模块语言包-学期
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'semester_add_name'					=>	'学期添加',
+	'semester_edit_name'				=>	'学期编辑',
+);
+?>

+ 33 - 0
Application/Admin/Lang/zh-cn/seo.php

@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * 模块语言包-seo
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// url模式列表
+	'seo_url_model_list'		=>	array(
+			0 => array('value' => 0, 'name' => '普通模式', 'checked' => true),
+			1 => array('value' => 1, 'name' => 'PATHINFO模式'),
+			2 => array('value' => 2, 'name' => 'REWRITE模式'),
+			3 => array('value' => 3, 'name' => '兼容模式'),
+		),
+
+	// 文章浏览方案列表
+	'seo_article_browser_list'	=>	array(
+			0 => array('value' => 0, 'name' => '文章标题', 'checked' => true),
+			1 => array('value' => 1, 'name' => '文章标题 - 站点名称'),
+			2 => array('value' => 2, 'name' => '文章标题 - 站点标题'),
+		),
+
+	// 频道浏览方案列表
+	'seo_channel_browser_list'	=>	array(
+			0 => array('value' => 0, 'name' => '频道名称', 'checked' => true),
+			1 => array('value' => 1, 'name' => '频道名称 - 站点名称'),
+			2 => array('value' => 2, 'name' => '频道名称 - 站点标题'),
+		),
+);
+?>

+ 448 - 0
Application/Admin/Lang/zh-cn/site.php

@@ -0,0 +1,448 @@
+<?php
+
+/**
+ * 模块语言包-站点设置
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	'site_site_logo_text'			=>	'选择网站logo',
+	
+	// 站点关闭状态列表
+	'site_site_state_list'			=>	array(
+			0 => array('value' => 0, 'name' => '关闭', 'checked' => true),
+			1 => array('value' => 1, 'name' => '开启'),
+		),
+
+	// 是否开启用户注册
+	'site_user_reg_state_list'			=>	array(
+			0 => array('value' => 'sms', 'name' => '短信'),
+			1 => array('value' => 'email', 'name' => '邮箱'),
+		),
+
+	// 是否开启用户登录
+	'site_user_login_state_list'			=>	array(
+			0 => array('value' => 0, 'name' => '关闭'),
+			1 => array('value' => 1, 'name' => '开启', 'checked' => true),
+		),
+
+	// 获取验证码-强制使用图片验证码状态列表
+	'site_img_verify_state_list'		=>	array(
+			0 => array('value' => 0, 'name' => '关闭'),
+			1 => array('value' => 1, 'name' => '开启', 'checked' => true),
+		),
+
+	// 时区
+	'site_timezone_list' => array(
+		'Europe/Andorra' => '欧洲/安道尔(标准时+1)',
+		'Asia/Dubai' => '亚洲/杜拜(标准时+4)',
+		'Asia/Kabul' => '亚洲/喀布尔(标准时+4)',
+		'America/Antigua' => '美洲/安地卡及巴布达(标准时-4)',
+		'America/Anguilla' => '美洲/安圭拉岛(标准时-4)',
+		'Europe/Tirane' => '欧洲/地拉那(标准时+1)',
+		'Asia/Yerevan' => '亚洲/埃里温(标准时+4)',
+		'Africa/Luanda' => '非洲/罗安达(标准时+1)',
+		'America/Argentina/Buenos_Aires' => '美洲/阿根廷/布宜诺斯艾利斯(标准时-3)',
+		'America/Argentina/Catamarca' => '美洲/阿根廷/卡塔马卡(标准时-3)',
+		'America/Argentina/Cordoba' => '美洲/阿根廷/科尔多瓦(标准时-3)',
+		'America/Argentina/Jujuy' => '美洲/阿根廷/胡胡伊(标准时-3)',
+		'America/Argentina/La_Rioja' => '美洲/阿根廷/拉里奥哈(标准时-3)',
+		'America/Argentina/Mendoza' => '美洲/阿根廷/门多萨(标准时-3)',
+		'America/Argentina/Rio_Gallegos' => '美洲/阿根廷/里奥加耶戈斯(标准时-3)',
+		'America/Argentina/Salta' => '美洲/阿根廷/萨尔塔(标准时-3)',
+		'America/Argentina/San_Juan' => '美洲/阿根廷/圣胡安(标准时-3)',
+		'America/Argentina/San_Luis' => '美洲/阿根廷/圣路易斯(标准时-3)',
+		'America/Argentina/Tucuman' => '美洲/阿根廷/图库曼(标准时-3)',
+		'America/Argentina/Ushuaia' => '美洲/阿根廷/乌斯怀亚(标准时-3)',
+		'Pacific/Pago_Pago' => '太平洋/帕果帕果(标准时-11)',
+		'Europe/Vienna' => '欧洲/维也纳(标准时+1)',
+		'Australia/Adelaide' => '澳大利亚/阿德莱德(标准时+10)',
+		'Australia/Brisbane' => '澳大利亚/布里斯班(标准时+10)',
+		'Australia/Broken_Hill' => '澳大利亚/布洛肯希尔(标准时+10)',
+		'Australia/Currie' => '澳大利亚/柯里(标准时+11)',
+		'Australia/Darwin' => '澳大利亚/达尔文(标准时+9)',
+		'Australia/Eucla' => '澳大利亚/尤克拉(标准时+8)',
+		'Australia/Hobart' => '澳大利亚/霍巴特(标准时+11)',
+		'Australia/Lindeman' => '澳大利亚/林德曼(标准时+10)',
+		'Australia/Lord_Howe' => '澳大利亚/豪勋爵岛(标准时+11)',
+		'Australia/Melbourne' => '澳大利亚/墨尔本(标准时+11)',
+		'Australia/Perth' => '澳大利亚/珀斯(标准时+8)',
+		'Australia/Sydney' => '澳大利亚/悉尼(标准时+11)',
+		'America/Aruba' => '美洲/阿鲁巴(标准时-4)',
+		'Europe/Mariehamn' => '欧洲/玛丽港(标准时+2)',
+		'Asia/Baku' => '亚洲/巴库(标准时+4)',
+		'Europe/Sarajevo' => '欧洲/萨拉热窝(标准时+1)',
+		'America/Barbados' => '美洲/巴巴多斯(标准时-4)',
+		'Asia/Dhaka' => '亚洲/达卡(标准时+6)',
+		'Europe/Brussels' => '欧洲/布鲁塞尔(标准时+1)',
+		'Africa/Ouagadougou' => '非洲/瓦加杜古(标准时+0)',
+		'Europe/Sofia' => '欧洲/索非亚(标准时+2)',
+		'Asia/Bahrain' => '亚洲/巴林(标准时+3)',
+		'Africa/Bujumbura' => '非洲/布琼布拉(标准时+2)',
+		'Africa/Porto-Novo' => '非洲/波尔图(标准时+1)',
+		'America/St_Barthelemy' => '美洲/圣巴托洛缪(标准时-4)',
+		'Atlantic/Bermuda' => '大西洋/百慕达(标准时-4)',
+		'Asia/Brunei' => '亚洲/文莱(标准时+8)',
+		'America/La_Paz' => '美洲/拉巴斯(标准时-4)',
+		'America/Kralendijk' => '美洲/博内尔(标准时-4)',
+		'America/Araguaina' => '美洲/阿拉瓜伊纳(标准时-3)',
+		'America/Bahia' => '美洲/巴伊亚(标准时-3)',
+		'America/Belem' => '美洲/贝伦(标准时-3)',
+		'America/Boa_Vista' => '美洲/博阿维斯塔(标准时-4)',
+		'America/Campo_Grande' => '美洲/大坎普(标准时-3)',
+		'America/Cuiaba' => '美洲/库亚巴(标准时-3)',
+		'America/Eirunepe' => '美洲/艾鲁内佩(标准时-5)',
+		'America/Fortaleza' => '美洲/福塔莱萨(标准时-3)',
+		'America/Maceio' => '美洲/马赛约(标准时-3)',
+		'America/Manaus' => '美洲/马瑙斯(标准时-4)',
+		'America/Noronha' => '美洲/奥诺罗尼亚(标准时-2)',
+		'America/Porto_Velho' => '美洲/波多韦柳(标准时-4)',
+		'America/Recife' => '美洲/累西腓(标准时-3)',
+		'America/Rio_Branco' => '美洲/里奥布朗库(标准时-5)',
+		'America/Santarem' => '美洲/桑特莱(标准时-3)',
+		'America/Sao_Paulo' => '美洲/圣保罗(标准时-2)',
+		'America/Nassau' => '美洲/拿骚(标准时-5)',
+		'Asia/Thimphu' => '亚洲/廷布(标准时+6)',
+		'Africa/Gaborone' => '非洲/哈博罗内(标准时+2)',
+		'Europe/Minsk' => '欧洲/明斯克(标准时+3)',
+		'America/Belize' => '美洲/伯利兹(标准时-6)',
+		'America/Atikokan' => '美洲/阿蒂科肯(标准时-5)',
+		'America/Blanc-Sablon' => '美洲/相思(标准时-4)',
+		'America/Cambridge_Bay' => '美洲/剑桥湾(标准时-7)',
+		'America/Creston' => '美洲/克雷斯顿(标准时-7)',
+		'America/Dawson' => '美洲/道森(标准时-8)',
+		'America/Dawson_Creek' => '美洲/道森克里克(标准时-7)',
+		'America/Edmonton' => '美洲/埃德蒙顿(标准时-7)',
+		'America/Glace_Bay' => '美洲/格莱斯贝(标准时-4)',
+		'America/Goose_Bay' => '美洲/鹅湾(标准时-4)',
+		'America/Halifax' => '美洲/哈利法克斯(标准时-4)',
+		'America/Inuvik' => '美洲/伊努维克(标准时-7)',
+		'America/Iqaluit' => '美洲/伊卡瑞特(标准时-5)',
+		'America/Moncton' => '美洲/蒙克顿(标准时-4)',
+		'America/Montreal' => '美洲/蒙特利尔(标准时-5)',
+		'America/Nipigon' => '美洲/尼皮贡(标准时-5)',
+		'America/Pangnirtung' => '美洲/潘尼尔东(标准时-5)',
+		'America/Rainy_River' => '美洲/雨河(标准时-6)',
+		'America/Rankin_Inlet' => '美洲/兰进(标准时-6)',
+		'America/Regina' => '美洲/里贾纳(标准时-6)',
+		'America/Resolute' => '美洲/雷索卢特(标准时-6)',
+		'America/St_Johns' => '美洲/圣约翰斯(标准时-3)',
+		'America/Swift_Current' => '美洲/斯威夫特卡伦特(标准时-6)',
+		'America/Thunder_Bay' => '美洲/桑德湾(标准时-5)',
+		'America/Toronto' => '美洲/加拿大多伦多(标准时-5)',
+		'America/Vancouver' => '美洲/温哥华(标准时-8)',
+		'America/Whitehorse' => '美洲/怀特霍尔斯(标准时-8)',
+		'America/Winnipeg' => '美洲/温尼伯(标准时-6)',
+		'America/Yellowknife' => '美洲/耶洛奈夫(标准时-7)',
+		'Indian/Cocos' => '印度洋/科科斯(标准时+6)',
+		'Africa/Kinshasa' => '非洲/金沙萨(标准时+1)',
+		'Africa/Lubumbashi' => '非洲/卢本巴希(标准时+2)',
+		'Africa/Bangui' => '非洲/班吉(标准时+1)',
+		'Africa/Brazzaville' => '非洲/布拉柴维尔(标准时+1)',
+		'Europe/Zurich' => '欧洲/苏黎世(标准时+1)',
+		'Africa/Abidjan' => '非洲/阿比让(标准时+0)',
+		'Pacific/Rarotonga' => '太平洋/拉罗汤加(标准时-10)',
+		'America/Santiago' => '美洲/圣地亚哥(标准时-3)',
+		'Pacific/Easter' => '太平洋/复活岛(标准时-5)',
+		'Africa/Douala' => '非洲/杜阿拉(标准时+1)',
+		'Asia/Chongqing' => '亚洲/重庆(标准时+8)',
+		'Asia/Harbin' => '亚洲/哈尔滨(标准时+8)',
+		'Asia/Kashgar' => '亚洲/喀什葛尔(标准时+6)',
+		'Asia/Shanghai' => '亚洲/上海(标准时+8)',
+		'Asia/Urumqi' => '亚洲/乌鲁木齐(标准时+6)',
+		'America/Bogota' => '美洲/波哥大(标准时-5)',
+		'America/Costa_Rica' => '美洲/哥斯达黎加(标准时-6)',
+		'America/Havana' => '美洲/哈瓦那(标准时-5)',
+		'Atlantic/Cape_Verde' => '大西洋/佛得角(标准时-1)',
+		'America/Curacao' => '美洲/库拉索岛(标准时-4)',
+		'Indian/Christmas' => '印度/圣诞岛(标准时+7)',
+		'Asia/Nicosia' => '亚洲/尼科西亚(标准时+2)',
+		'Europe/Prague' => '欧洲/布拉格(标准时+1)',
+		'Europe/Berlin' => '欧洲/柏林(标准时+1)',
+		'Europe/Busingen' => '欧洲/布辛根(标准时+1)',
+		'Africa/Djibouti' => '非洲/吉布提(标准时+3)',
+		'Europe/Copenhagen' => '欧洲/哥本哈根(标准时+1)',
+		'America/Dominica' => '美洲/多米尼加(标准时-4)',
+		'America/Santo_Domingo' => '美洲/圣多明各(标准时-4)',
+		'Africa/Algiers' => '非洲/阿尔及尔(标准时+1)',
+		'America/Guayaquil' => '美洲/瓜亚基尔(标准时-5)',
+		'Pacific/Galapagos' => '太平洋/加拉帕戈斯(标准时-6)',
+		'Europe/Tallinn' => '欧洲/塔林(标准时+2)',
+		'Africa/Cairo' => '非洲/开罗(标准时+2)',
+		'Africa/El_Aaiun' => '非洲/阿尤恩(标准时+0)',
+		'Africa/Asmara' => '非洲/阿斯马拉(标准时+3)',
+		'Africa/Ceuta' => '非洲/休达(标准时+1)',
+		'Atlantic/Canary' => '大西洋/加那利(标准时+0)',
+		'Europe/Madrid' => '欧洲/马德里(标准时+1)',
+		'Africa/Addis_Ababa' => '非洲/亚的斯亚贝巴(标准时+3)',
+		'Europe/Helsinki' => '欧洲/赫尔辛基(标准时+2)',
+		'Pacific/Fiji' => '太平洋/斐济(标准时+12)',
+		'Atlantic/Stanley' => '大西洋/赤柱监狱(标准时-3)',
+		'Pacific/Chuuk' => '太平洋/特鲁克(标准时+10)',
+		'Pacific/Kosrae' => '太平洋/科斯雷(标准时+11)',
+		'Pacific/Pohnpei' => '太平洋/波纳佩(标准时+11)',
+		'Atlantic/Faroe' => '大西洋/法罗群岛(标准时+0)',
+		'Europe/Paris' => '欧洲/巴黎(标准时+1)',
+		'Africa/Libreville' => '非洲/利伯维尔(标准时+1)',
+		'Europe/London' => '欧洲/伦敦(标准时+0)',
+		'America/Grenada' => '美洲/格林纳达(标准时-4)',
+		'Asia/Tbilisi' => '亚洲/第比利斯(标准时+4)',
+		'America/Cayenne' => '美洲/卡宴(标准时-3)',
+		'Europe/Guernsey' => '欧洲/格恩西岛(标准时+0)',
+		'Africa/Accra' => '非洲/阿克拉(标准时+0)',
+		'Europe/Gibraltar' => '欧洲/直布罗陀(标准时+1)',
+		'America/Danmarkshavn' => '美洲/丹马沙(标准时+0)',
+		'America/Godthab' => '美洲/哥特哈布(标准时-3)',
+		'America/Scoresbysund' => '美洲/斯科斯比松(标准时-1)',
+		'America/Thule' => '美洲/图勒(标准时-4)',
+		'Africa/Banjul' => '非洲/班珠尔(标准时+0)',
+		'Africa/Conakry' => '非洲/科纳克里(标准时+0)',
+		'America/Guadeloupe' => '美洲/瓜德罗普岛(标准时-4)',
+		'Africa/Malabo' => '非洲/马拉博(标准时+1)',
+		'Europe/Athens' => '欧洲/雅典(标准时+2)',
+		'Atlantic/South_Georgia' => '大西洋/南乔治亚(标准时-2)',
+		'America/Guatemala' => '美洲/危地马拉(标准时-6)',
+		'Pacific/Guam' => '太平洋/关岛(标准时+10)',
+		'Africa/Bissau' => '非洲/比绍(标准时+0)',
+		'America/Guyana' => '美洲/圭亚那(标准时-4)',
+		'Asia/Hong_Kong' => '亚洲/香港(标准时+8)',
+		'America/Tegucigalpa' => '美洲/特古西加尔巴(标准时-6)',
+		'Europe/Zagreb' => '欧洲/萨格勒布(标准时+1)',
+		'America/Port-au-Prince' => '美洲/端口(标准时-5)',
+		'Europe/Budapest' => '欧洲/布达佩斯(标准时+1)',
+		'Asia/Jakarta' => '亚洲/雅加达(标准时+7)',
+		'Asia/Jayapura' => '亚洲/查亚普拉(标准时+9)',
+		'Asia/Makassar' => '亚洲/望加锡(标准时+8)',
+		'Asia/Pontianak' => '亚洲/坤甸(标准时+7)',
+		'Europe/Dublin' => '欧洲/都柏林(标准时+0)',
+		'Asia/Jerusalem' => '亚洲/耶路撒冷(标准时+2)',
+		'Europe/Isle_of_Man' => '欧洲/马恩岛(标准时+0)',
+		'Asia/Kolkata' => '亚洲/加尔各答(标准时+5)',
+		'Indian/Chagos' => '印度/查戈斯群岛(标准时+6)',
+		'Asia/Baghdad' => '亚洲/巴格达(标准时+3)',
+		'Asia/Tehran' => '亚洲/德黑兰(标准时+3)',
+		'Atlantic/Reykjavik' => '大西洋/雷克雅未克(标准时+0)',
+		'Europe/Rome' => '欧洲/罗马(标准时+1)',
+		'Europe/Jersey' => '欧洲/新泽西州(标准时+0)',
+		'America/Jamaica' => '美洲/牙买加(标准时-5)',
+		'Asia/Amman' => '亚洲/安曼(标准时+2)',
+		'Asia/Tokyo' => '亚洲/东京(标准时+9)',
+		'Africa/Nairobi' => '非洲/内罗毕(标准时+3)',
+		'Asia/Bishkek' => '亚洲/比什凯克(标准时+6)',
+		'Asia/Phnom_Penh' => '亚洲/金边(标准时+7)',
+		'Pacific/Enderbury' => '太平洋/恩德伯里(标准时+13)',
+		'Pacific/Kiritimati' => '太平洋/克里斯马斯(标准时+14)',
+		'Pacific/Tarawa' => '太平洋/塔拉瓦(标准时+12)',
+		'Indian/Comoro' => '印度/科莫罗(标准时+3)',
+		'America/St_Kitts' => '美洲/圣基茨(标准时-4)',
+		'Asia/Pyongyang' => '亚洲/平壤(标准时+8)',
+		'Asia/Seoul' => '亚洲/首尔(标准时+9)',
+		'Asia/Kuwait' => '亚洲/科威特(标准时+3)',
+		'America/Cayman' => '美洲/开曼(标准时-5)',
+		'Asia/Almaty' => '亚洲/阿拉木图(标准时+6)',
+		'Asia/Aqtau' => '亚洲/阿克套(标准时+5)',
+		'Asia/Aqtobe' => '亚洲/阿克托别(标准时+5)',
+		'Asia/Oral' => '亚洲/乌拉尔(标准时+5)',
+		'Asia/Qyzylorda' => '亚洲/克孜勒奥尔达(标准时+6)',
+		'Asia/Vientiane' => '亚洲/万象(标准时+7)',
+		'Asia/Beirut' => '亚洲/贝鲁特(标准时+2)',
+		'America/St_Lucia' => '美洲/圣露西亚(标准时-4)',
+		'Europe/Vaduz' => '欧洲/瓦杜兹(标准时+1)',
+		'Asia/Colombo' => '亚洲/科伦坡(标准时+5)',
+		'Africa/Monrovia' => '非洲/蒙罗维亚(标准时+0)',
+		'Africa/Maseru' => '非洲/马塞卢(标准时+2)',
+		'Europe/Vilnius' => '欧洲/维尔纽斯(标准时+2)',
+		'Europe/Luxembourg' => '欧洲/卢森堡(标准时+1)',
+		'Europe/Riga' => '欧洲/里加(标准时+2)',
+		'Africa/Tripoli' => '非洲/的黎波里(标准时+2)',
+		'Africa/Casablanca' => '非洲/卡萨布兰卡(标准时+0)',
+		'Europe/Monaco' => '欧洲/摩纳哥(标准时+1)',
+		'Europe/Chisinau' => '欧洲/基希纳乌(标准时+2)',
+		'Europe/Podgorica' => '欧洲/波多里加(标准时+1)',
+		'America/Marigot' => '美洲/马里戈特(标准时-4)',
+		'Indian/Antananarivo' => '印度/安塔那那利佛(标准时+3)',
+		'Pacific/Kwajalein' => '太平洋/夸贾林(标准时+12)',
+		'Pacific/Majuro' => '太平洋/马朱罗(标准时+12)',
+		'Europe/Skopje' => '欧洲/斯科普里(标准时+1)',
+		'Africa/Bamako' => '非洲/巴马科(标准时+0)',
+		'Asia/Rangoon' => '亚洲/仰光(标准时+6)',
+		'Asia/Choibalsan' => '亚洲/乔巴山(标准时+8)',
+		'Asia/Hovd' => '亚洲/科布多(标准时+7)',
+		'Asia/Ulaanbaatar' => '亚洲/乌兰巴托市(标准时+8)',
+		'Asia/Macau' => '亚洲/澳门(标准时+8)',
+		'Pacific/Saipan' => '太平洋/塞班岛(标准时+10)',
+		'America/Martinique' => '美洲/马提尼克岛(标准时-4)',
+		'Africa/Nouakchott' => '非洲/努瓦克肖特(标准时+0)',
+		'America/Montserrat' => '美洲/蒙特塞拉特岛(标准时-4)',
+		'Europe/Malta' => '欧洲/马耳他(标准时+1)',
+		'Indian/Mauritius' => '印度洋/毛里求斯(标准时+4)',
+		'Indian/Maldives' => '印度/马尔代夫(标准时+5)',
+		'Africa/Blantyre' => '非洲/布兰太尔(标准时+2)',
+		'America/Bahia_Banderas' => '美洲/巴伊亚班德拉斯(标准时-6)',
+		'America/Cancun' => '美洲/坎昆(标准时-5)',
+		'America/Chihuahua' => '美洲/契瓦瓦(标准时-7)',
+		'America/Hermosillo' => '美洲/埃莫西约(标准时-7)',
+		'America/Matamoros' => '美洲/马塔莫罗斯(标准时-6)',
+		'America/Mazatlan' => '美洲/马萨特兰(标准时-7)',
+		'America/Merida' => '美洲/梅里达(标准时-6)',
+		'America/Mexico_City' => '美洲/墨西哥城(标准时-6)',
+		'America/Monterrey' => '美洲/蒙特雷会议(标准时-6)',
+		'America/Ojinaga' => '美洲/Ojinaga(标准时-7)',
+		'America/Santa_Isabel' => '美洲/圣伊莎贝尔(标准时-8)',
+		'America/Tijuana' => '美洲/蒂华纳(标准时-8)',
+		'Asia/Kuala_Lumpur' => '亚洲/吉隆坡(标准时+8)',
+		'Asia/Kuching' => '亚洲/古晋(标准时+8)',
+		'Africa/Maputo' => '非洲/莫桑比克马普托(标准时+2)',
+		'Africa/Windhoek' => '非洲/温得和克(标准时+2)',
+		'Pacific/Noumea' => '太平洋/努美阿(标准时+11)',
+		'Africa/Niamey' => '非洲/尼亚美(标准时+1)',
+		'Pacific/Norfolk' => '太平洋/诺福克(标准时+11)',
+		'Africa/Lagos' => '非洲/拉各斯(标准时+1)',
+		'America/Managua' => '美洲/马那瓜(标准时-6)',
+		'Europe/Amsterdam' => '欧洲/阿姆斯特丹(标准时+1)',
+		'Europe/Oslo' => '欧洲/奥斯陆(标准时+1)',
+		'Asia/Kathmandu' => '亚洲/加德满都(标准时+5)',
+		'Pacific/Nauru' => '太平洋/瑙鲁(标准时+12)',
+		'Pacific/Niue' => '太平洋/纽埃(标准时-11)',
+		'Pacific/Auckland' => '太平洋/奥克兰(标准时+13)',
+		'Pacific/Chatham' => '太平洋/查塔姆(标准时+13)',
+		'Asia/Muscat' => '亚洲/马斯喀特(标准时+4)',
+		'America/Panama' => '美洲/巴拿马(标准时-5)',
+		'America/Lima' => '美洲/利马(标准时-5)',
+		'Pacific/Gambier' => '太平洋/甘比尔(标准时-9)',
+		'Pacific/Marquesas' => '太平洋/马克萨斯(标准时-9)',
+		'Pacific/Tahiti' => '太平洋/塔希提岛(标准时-10)',
+		'Pacific/Port_Moresby' => '太平洋/莫尔兹比港(标准时+10)',
+		'Asia/Manila' => '亚洲/马尼拉(标准时+8)',
+		'Asia/Karachi' => '亚洲/卡拉奇(标准时+5)',
+		'Europe/Warsaw' => '欧洲/华沙(标准时+1)',
+		'America/Miquelon' => '美洲/米克隆的(标准时-3)',
+		'Pacific/Pitcairn' => '太平洋/皮特凯恩(标准时-8)',
+		'America/Puerto_Rico' => '美洲/波多黎各(标准时-4)',
+		'Asia/Gaza' => '亚洲/加沙(标准时+2)',
+		'Asia/Hebron' => '亚洲/希伯伦(标准时+2)',
+		'Atlantic/Azores' => '大西洋/亚速尔群岛(标准时-1)',
+		'Atlantic/Madeira' => '大西洋/马德拉岛(标准时+0)',
+		'Europe/Lisbon' => '欧洲/里斯本(标准时+0)',
+		'Pacific/Palau' => '太平洋/帕劳(标准时+9)',
+		'America/Asuncion' => '美洲/亚松森(标准时-3)',
+		'Asia/Qatar' => '亚洲/卡塔尔(标准时+3)',
+		'Indian/Reunion' => '印度/留尼汪(标准时+4)',
+		'Europe/Bucharest' => '欧洲/布加勒斯特(标准时+2)',
+		'Europe/Belgrade' => '欧洲/贝尔格莱德(标准时+1)',
+		'Asia/Anadyr' => '亚洲/阿纳德尔(标准时+12)',
+		'Asia/Irkutsk' => '亚洲/伊尔库次克(标准时+8)',
+		'Asia/Kamchatka' => '亚洲/堪察加半岛(标准时+12)',
+		'Asia/Khandyga' => '亚洲/Khandyga(标准时+9)',
+		'Asia/Krasnoyarsk' => '亚洲/克拉斯诺亚尔斯克(标准时+7)',
+		'Asia/Magadan' => '亚洲/马加丹(标准时+11)',
+		'Asia/Novokuznetsk' => '亚洲/新库兹涅茨克(标准时+7)',
+		'Asia/Novosibirsk' => '亚洲/新西伯利亚(标准时+7)',
+		'Asia/Omsk' => '亚洲/鄂木斯克(标准时+6)',
+		'Asia/Sakhalin' => '亚洲/萨哈林岛(标准时+11)',
+		'Asia/Ust-Nera' => '亚洲/乌斯(标准时+7)',
+		'Asia/Vladivostok' => '亚洲/符拉迪沃斯托克(标准时+10)',
+		'Asia/Yakutsk' => '亚洲/雅库茨克(标准时+9)',
+		'Asia/Yekaterinburg' => '亚洲/叶卡捷琳堡(标准时+5)',
+		'Europe/Kaliningrad' => '欧洲/加里宁格勒(标准时+2)',
+		'Europe/Moscow' => '欧洲/莫斯科(标准时+3)',
+		'Europe/Samara' => '欧洲/萨马拉(标准时+4)',
+		'Europe/Volgograd' => '欧洲/伏尔加格勒(标准时+3)',
+		'Africa/Kigali' => '非洲/基加利(标准时+2)',
+		'Asia/Riyadh' => '亚洲/利雅得(标准时+3)',
+		'Pacific/Guadalcanal' => '太平洋/瓜达尔卡纳尔岛(标准时+11)',
+		'Indian/Mahe' => '印度/马埃岛(标准时+4)',
+		'Africa/Khartoum' => '非洲/喀土穆(标准时+3)',
+		'Europe/Stockholm' => '欧洲/斯德哥尔摩(标准时+1)',
+		'Asia/Singapore' => '亚洲/新加坡(标准时+8)',
+		'Atlantic/St_Helena' => '大西洋/圣赫勒拿岛(标准时+0)',
+		'Europe/Ljubljana' => '欧洲/卢布尔雅那(标准时+1)',
+		'Arctic/Longyearbyen' => '北极/朗伊尔城(标准时+1)',
+		'Europe/Bratislava' => '欧洲/布拉迪斯拉发(标准时+1)',
+		'Africa/Freetown' => '非洲/弗里敦(标准时+0)',
+		'Europe/San_Marino' => '欧洲/圣马力诺(标准时+1)',
+		'Africa/Dakar' => '非洲/达喀尔(标准时+0)',
+		'Africa/Mogadishu' => '非洲/摩加迪沙(标准时+3)',
+		'America/Paramaribo' => '美洲/帕拉马里博(标准时-3)',
+		'Africa/Juba' => '非洲/朱巴(标准时+3)',
+		'Africa/Sao_Tome' => '非洲/圣多美(标准时+0)',
+		'America/El_Salvador' => '美洲/萨尔瓦多(标准时-6)',
+		'America/Lower_Princes' => '美洲/下王子(标准时-4)',
+		'Asia/Damascus' => '亚洲/大马士革(标准时+2)',
+		'Africa/Mbabane' => '非洲/姆巴巴内(标准时+2)',
+		'America/Grand_Turk' => '美洲/大特克(标准时-4)',
+		'Africa/Ndjamena' => '非洲/恩贾梅纳(标准时+1)',
+		'Indian/Kerguelen' => '印度/凯尔盖朗(标准时+5)',
+		'Africa/Lome' => '非洲/洛美(标准时+0)',
+		'Asia/Bangkok' => '亚洲/曼谷(标准时+7)',
+		'Asia/Dushanbe' => '亚洲/杜尚别(标准时+5)',
+		'Pacific/Fakaofo' => '太平洋/法考福(标准时+13)',
+		'Asia/Dili' => '亚洲/帝力(标准时+9)',
+		'Asia/Ashgabat' => '亚洲/阿什哈巴特(标准时+5)',
+		'Africa/Tunis' => '非洲/突尼斯(标准时+1)',
+		'Pacific/Tongatapu' => '太平洋/汤加塔布(标准时+13)',
+		'Europe/Istanbul' => '欧洲/伊斯坦布尔(标准时+3)',
+		'America/Port_of_Spain' => '美洲/西班牙港(标准时-4)',
+		'Pacific/Funafuti' => '太平洋/富纳富提(标准时+12)',
+		'Asia/Taipei' => '亚洲/台北(标准时+8)',
+		'Africa/Dar_es_Salaam' => '非洲/达累斯萨拉姆(标准时+3)',
+		'Europe/Kiev' => '欧洲/基辅(标准时+2)',
+		'Europe/Simferopol' => '欧洲/辛菲罗波尔(标准时+3)',
+		'Europe/Uzhgorod' => '欧洲/乌日哥罗德(标准时+2)',
+		'Europe/Zaporozhye' => '欧洲/扎波罗热(标准时+2)',
+		'Africa/Kampala' => '非洲/坎帕拉(标准时+3)',
+		'Pacific/Johnston' => '太平洋/约翰斯顿(标准时-10)',
+		'Pacific/Midway' => '太平洋/中途岛(标准时-11)',
+		'Pacific/Wake' => '太平洋/威克岛(标准时+12)',
+		'America/Adak' => '美国/埃达克(标准时-10)',
+		'America/Anchorage' => '美国/安克雷奇(标准时-9)',
+		'America/Boise' => '美国/博伊西(标准时-7)',
+		'America/Chicago' => '美国/芝加哥(标准时-6)',
+		'America/Denver' => '美国/丹佛(标准时-7)',
+		'America/Detroit' => '美国/底特律(标准时-5)',
+		'America/Indiana/Indianapolis' => '美国/印第安纳州/印第安纳波利斯(标准时-5)',
+		'America/Indiana/Knox' => '美国/印第安纳州/诺克斯(标准时-6)',
+		'America/Indiana/Marengo' => '美国/印第安纳州/马伦戈(标准时-5)',
+		'America/Indiana/Petersburg' => '美国/印第安纳州/圣彼得堡(标准时-5)',
+		'America/Indiana/Tell_City' => '美国/印第安纳州/告诉市(标准时-6)',
+		'America/Indiana/Vevay' => '美国/印第安纳州/印第安纳州/Vevay(标准时-5)',
+		'America/Indiana/Vincennes' => '美国/印第安纳州/文森斯(标准时-5)',
+		'America/Indiana/Winamac' => '美国/印第安纳州/威纳马克(标准时-5)',
+		'America/Juneau' => '美国/朱诺(标准时-9)',
+		'America/Kentucky/Louisville' => '美国/肯塔基州/路易斯维尔(标准时-5)',
+		'America/Kentucky/Monticello' => '美国/肯塔基州/蒙蒂塞洛(标准时-5)',
+		'America/Los_Angeles' => '美国/洛杉矶(标准时-8)',
+		'America/Menominee' => '美国/梅诺米尼(标准时-6)',
+		'America/Metlakatla' => '美国/梅特拉卡特拉(标准时-9)',
+		'America/New_York' => '美国/纽约(标准时-5)',
+		'America/Nome' => '美国/诺姆(标准时-9)',
+		'America/North_Dakota/Beulah' => '美国/北达科他州/Beulah(标准时-6)',
+		'America/North_Dakota/Center' => '美国/北达科他州/中心(标准时-6)',
+		'America/North_Dakota/New_Salem' => '美国/北达科他州/新塞勒姆(标准时-6)',
+		'America/Phoenix' => '美国/凤凰城(标准时-7)',
+		'America/Shiprock' => '美国/新墨西哥州/Shiprock(标准时-7)',
+		'America/Sitka' => '美国/锡特卡(标准时-9)',
+		'America/Yakutat' => '美国/亚库塔特(标准时-9)',
+		'Pacific/Honolulu' => '太平洋/檀香山(标准时-10)',
+		'America/Montevideo' => '美洲/蒙得维的亚(标准时-3)',
+		'Asia/Samarkand' => '亚洲/撒马尔罕(标准时+5)',
+		'Asia/Tashkent' => '亚洲/塔什干(标准时+5)',
+		'Europe/Vatican' => '欧洲/梵蒂冈(标准时+1)',
+		'America/St_Vincent' => '美洲/圣文森特(标准时-4)',
+		'America/Caracas' => '美洲/加拉加斯(标准时-4)',
+		'America/Tortola' => '美洲/英属维尔京群岛(标准时-4)',
+		'America/St_Thomas' => '美洲/圣托马斯(标准时-4)',
+		'Asia/Ho_Chi_Minh' => '亚洲/胡志明(标准时+7)',
+		'Pacific/Efate' => '太平洋/埃法特(标准时+11)',
+		'Pacific/Wallis' => '太平洋/瓦利斯(标准时+12)',
+		'Pacific/Apia' => '太平洋/阿皮亚(标准时+14)',
+		'Asia/Aden' => '亚洲/亚丁(标准时+3)',
+		'Indian/Mayotte' => '印度/马约特岛(标准时+3)',
+		'Africa/Johannesburg' => '非洲/约翰内斯堡(标准时+2)',
+		'Africa/Lusaka' => '非洲/卢萨卡(标准时+2)',
+		'Africa/Harare' => '非洲/哈拉雷(标准时+2)',
+	),
+);
+?>

+ 14 - 0
Application/Admin/Lang/zh-cn/sms.php

@@ -0,0 +1,14 @@
+<?php
+
+/**
+ * 模块语言包-短信设置
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	'sms_sms_nav_name'			=>	'短信设置',
+	'sms_message_nav_name'		=>	'消息模板',
+);
+?>

+ 37 - 0
Application/Admin/Lang/zh-cn/student.php

@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * 模块语言包-学生
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'student_add_name'					=>	'学生添加',
+	'student_edit_name'					=>	'学生编辑',
+	'student_region_text'				=>	'地区',
+	'student_region_format'				=>	'请选择所在地区',
+	'student_region_tips'				=>	'地区有误',
+	'student_username_text'				=>	'学生真实姓名',
+	'student_username_name'				=>	'学生姓名',
+	'student_username_format'			=>	'姓名格式 2~16 个字符',
+	'student_birthday_text'				=>	'出生日期',
+	'student_birthday_format'			=>	'出生日期格式有误',
+	'student_class_text'				=>	'班级',
+	'student_class_format'				=>	'请选择班级',
+	'student_class_tips'				=>	'班级有误',
+	'student_tuition_state_text'		=>	'缴费状态',
+	'student_tuition_state_format'		=>	'请选择缴费状态',
+	'student_no_exist_error'			=>	'该学生不存在',
+	'student_sign_up_name'				=>	'报名时间',
+	'student_so_keyword_tips'			=>	'姓名/编号/身份证/电话/邮箱',
+	'common_operation_fraction'			=>	'录成绩',
+	'student_time_start_text'			=>	'出生开始',
+	'student_time_end_text'				=>	'出生结束',
+	'student_my_mobile_name'			=>	'学生手机',
+	'student_my_mobile_error'			=>	'学生手机格式有误',
+	'student_excel_import_tips'			=>	'1、学生编号由系统自动生成,已存在以往学期中的学生将使用原来的编号。<br />2、报名时间选填项,留空则使用当前导入时间。<br />3、班级二级归类使用[ - ]字符分割。<br />4、所有数据字段以文本格式上传,如[ 身份证号码|电话|报名时间 ]',
+);
+?>

+ 15 - 0
Application/Admin/Lang/zh-cn/subject.php

@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * 模块语言包-科目
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'subject_add_name'					=>	'科目添加',
+	'subject_edit_name'				=>	'科目编辑',
+);
+?>

+ 30 - 0
Application/Admin/Lang/zh-cn/teacher.php

@@ -0,0 +1,30 @@
+<?php
+
+/**
+ * 模块语言包-教师
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'teacher_add_name'					=>	'教师添加',
+	'teacher_edit_name'					=>	'教师编辑',
+	'teacher_region_text'				=>	'地区',
+	'teacher_region_format'				=>	'请选择所在地区',
+	'teacher_region_tips'				=>	'地区有误',
+	'teacher_username_text'				=>	'教师真实姓名',
+	'teacher_username_name'				=>	'教师姓名',
+	'teacher_username_format'			=>	'姓名格式 2~16 个字符',
+	'teacher_birthday_text'				=>	'出生日期',
+	'teacher_birthday_format'			=>	'出生日期格式有误',
+	'teacher_no_exist_error'			=>	'该教师不存在',
+	'teacher_so_keyword_tips'			=>	'姓名/身份证/电话/邮箱/地址',
+	'teacher_operation_course'			=>	'添加课程',
+	'teacher_time_start_text'			=>	'出生开始',
+	'teacher_time_end_text'				=>	'出生结束',
+	'teacher_subject_text'				=>	'贯通科目',
+	'teacher_subject_format'			=>	'请至少选择一项科目',
+);
+?>

+ 19 - 0
Application/Admin/Lang/zh-cn/theme.php

@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * 模块语言包-主题管理
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	'theme_nav_home'			=>	'当前主题',
+	'theme_nav_upload'			=>	'主题安装',
+	'theme_upload_tips'			=>	'上传一个zip压缩格式的主题安装包',
+	'theme_upload_error'		=>	'文件格式有误,请上传zip压缩包',
+	'theme_delete_error'		=>	'不能删除正在使用的主题',
+	'theme_author_text'			=>	'作者:',
+	'theme_ver_text'			=>	'适用版本:',
+);
+?>

+ 28 - 0
Application/Admin/Lang/zh-cn/user.php

@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * 模块语言包-用户
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	'user_add_name'					=>	'用户添加',
+	'user_edit_name'				=>	'用户编辑',
+	'user_so_keyword_tips'			=>	'手机/邮箱/昵称',
+	'user_time_start_text'			=>	'起始时间',
+	'user_time_end_text'			=>	'结束时间',
+	'user_nickname_name'			=>	'昵称',
+	'user_birthday_name'			=>	'生日',
+	'user_signature_name'			=>	'个人签名',
+	'user_describe_name'			=>	'个人描述',
+	'user_nickname_format'			=>	'昵称最多 16 个字符',
+	'user_signature_format'			=>	'个人签名最多 168 个字符',
+	'user_describe_format'			=>	'个人描述最多 255 个字符',
+	'user_birthday_format'			=>	'生日格式有误',
+	'user_accounts_param_error'		=>	'至少填写一项手机或邮箱',
+	'user_login_pwd_name'			=>	'登录密码',
+	'user_login_pwd_format'			=>	'登录密码格式 6~18 个字符之间',
+);
+?>

+ 61 - 0
Application/Admin/Lang/zh-cn/view.php

@@ -0,0 +1,61 @@
+<?php
+
+/**
+ * 模块语言包-页面设置
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	'view_name_text'						=>	'模块名称',
+	'view_name_format'						=>	'格式 0~30 个字符之间',
+	'view_right_title_text'					=>	'右标题',
+	'view_right_title_format'				=>	'格式 0~255 个字符之间',
+	'view_right_title_tips'					=>	'标题与链接使用[ ; ]符号隔开<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格式如 右标题;http://schoolcms.org/',
+	'view_article_id_text'					=>	'指定主题',
+	'view_article_id_placeholder'			=>	'指定文章id',
+	'view_article_id_format'				=>	'半角逗号隔开(以数字开头结尾)格式如 1,2,3',
+	'view_article_id_tips'					=>	'半角逗号隔开(以数字开头结尾)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格式如 1,2,3<br />指定主题后,其它条件将失效',
+	'view_keyword_text'						=>	'关键字',
+	'view_keyword_format'					=>	'标题包含的关键字 0~255 个字符之间',
+	'view_keyword_tips'						=>	'并且条件使用[ - ]符号<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格式如 win-unix<br />或条件使用[ | ]符号<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格式如 win|unix<br />并且+或使用[ ; ]符号隔开<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格式如 win-unix;win|unix<br />最大255个字符',
+	'view_show_number_text'					=>	'显示条数',
+	'view_show_number_format'				=>	'显示条数 1~1000 数值之间',
+	'view_abstract_number_text'				=>	'摘要字数',
+	'view_abstract_number_tips'				=>	'摘要文字数,默认80',
+	'view_abstract_number_format'			=>	'字数 5~500 数值之间',
+	'view_class_text'						=>	'文章分类',
+	'view_class_format'						=>	'至少选择一个分类',
+	'view_all_class_text'					=>	'全部分类',
+	'view_sort_text'						=>	'排序方式',
+	'view_add_time_text'					=>	'发布时间',
+	'view_upd_time_text'					=>	'更新时间',
+	'view_title_style_text'					=>	'显示样式',
+	'view_link_open_way_text'				=>	'打开方式',
+	'view_date_format_text'					=>	'日期格式',
+	'view_data_cache_time_text'				=>	'数据缓存',
+	'view_data_cache_time_placeholder'		=>	'数据缓存有效时间',
+	'view_data_cache_time_tips'				=>	'数据缓存时间,单位(分钟)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认60分钟,0不缓存数据',
+	'view_summary_text'						=>	'自定义',
+	'view_summary_placeholder'				=>	'自定义内容',
+	'view_summary_tips'						=>	'自定义内容后,以上筛选规则将失效(可以是html代码)',
+	'view_sort_type_format'					=>	'排序方式范围值有误',
+	'view_add_time_interval_format'			=>	'发布时间范围值有误',
+	'view_upd_time_interval_format'			=>	'更新时间范围值有误',
+	'view_title_style_format'				=>	'标题显示样式范围值有误',
+	'view_view_link_open_way_format_format'	=>	'打开方式范围值有误',
+	'view_date_format_format'				=>	'日期格式范围值有误',
+
+	'view_layout_param_save_tips'			=>	'布局参数有误',
+	'view_module_param_save_tips'			=>	'模块参数有误',
+	'view_module_edit_title'				=>	'模块编辑',
+
+	'view_nav_home'							=>	'首页',
+	'view_nav_channel'						=>	'频道',
+	'view_nav_detail'						=>	'详情',
+	'view_layout_module_tips'				=>	'浏览器宽度<br />&nbsp;&nbsp;&nbsp;sm:小于641 px<br />&nbsp;&nbsp;&nbsp;md:小于1025 px<br />&nbsp;&nbsp;&nbsp;lg:大于等于1025 px<br /><br />比例布局<br />&nbsp;&nbsp;&nbsp;宽度分割成12块,3块一个小布局<br /><br />[ x ] 代表当前布局所展示模块的数量,可能是一个数值,也有可能是一个布局形式',
+	'view_no_edit_area'						=>	'基础内容区域,不可编辑',
+	'view_layout_import_tips'				=>	'请上传主题数据txt文件',
+);
+?>

+ 15 - 0
Application/Admin/Lang/zh-cn/week.php

@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * 模块语言包-周
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+return array(
+	// 添加/编辑
+	'week_add_name'					=>	'周添加',
+	'week_edit_name'				=>	'周编辑',
+);
+?>

+ 71 - 0
Application/Admin/Model/AdminModel.class.php

@@ -0,0 +1,71 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 管理员模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class AdminModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 登录
+		array('username', 'CheckUserName', '{%login_username_format}', 1, 'function', 4),
+		array('login_pwd', 'CheckLoginPwd', '{%login_login_pwd_format}', 1, 'function', 4),
+
+		// 添加
+		array('username', '', '{%common_username_already_exist}', 1, 'unique', 1),
+		array('login_pwd', 'CheckLoginPwd', '{%login_login_pwd_format}', 1, 'function', 1),
+
+		// 编辑
+		array('login_pwd', 'CheckLoginPwd', '{%login_login_pwd_format}', 2, 'function', 2),
+		
+		// 添加,编辑
+		array('mobile', 'CheckMobile', '{%common_mobile_format_error}', 2, 'function', 3),
+		array('gender', array(0,1,2), '{%common_gender_tips}', 1, 'in', 3),
+		array('role_id', 'IsExistRole', '{%login_role_id_error}', 1, 'callback', 3),
+
+		// 删除
+		array('id', 'IsExistAdmin', '{%login_username_no_exist}', 1, 'callback', 5),
+	);
+
+	/**
+	 * [IsExistRole 角色id是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-21T22:13:52+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistRole()
+	{
+		// 当用户操作自身的情况下不需要校验
+		$admin_id = isset($_SESSION['admin']['id']) ? $_SESSION['admin']['id'] : 0;
+		if(I('id') != $admin_id)
+		{
+			$id = $this->db(0)->table('__ROLE__')->where(array('id'=>I('role_id')))->getField('id');
+			return !empty($id);
+		}
+		return true;
+	}
+
+	/**
+	 * [IsExistAdmin 校验管理员是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistAdmin()
+	{
+		$user = $this->db(0)->where(array('id'=>I('id')))->getField('id');
+		return !empty($user);
+	}
+}
+?>

+ 51 - 0
Application/Admin/Model/ArticleClassModel.class.php

@@ -0,0 +1,51 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 文章分类模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class ArticleClassModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('name', 'CheckName', '{%common_name_format}', 1, 'callback', 3),
+		array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
+		array('sort', 'CheckSort', '{%common_sort_error}', 1, 'function', 3),
+
+		// 删除校验是否存在子级
+		array('id', 'IsExistSon', '{%common_is_exist_son_error}', 1, 'callback', 5),
+	);
+
+	/**
+	 * [CheckName 文章分类名称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckName()
+	{
+		$len = Utf8Strlen(I('name'));
+		return ($len >= 2 && $len <= 16);
+	}
+
+	/**
+	 * [IsExistSon 校验节点下是否存在子级数据]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 */
+	public function IsExistSon()
+	{
+		return ($this->db(0)->where(array('pid'=>I('id')))->count() == 0);
+	}
+}
+?>

+ 90 - 0
Application/Admin/Model/ArticleModel.class.php

@@ -0,0 +1,90 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 文章模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class ArticleModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(		
+		// 添加,编辑
+		array('title', 'CheckTitle', '{%article_title_format}', 1, 'callback', 3),
+		array('article_class_id', 'IsExistArticleClassId', '{%article_article_class_id_error}', 1, 'callback', 3),
+		array('title_color', 'CheckTitleColor', '{%common_color_format}', 2, 'callback', 3),
+		array('jump_url', 'CheckJumpUrl', '{%article_jump_url_format}', 2, 'callback', 3),
+		array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
+		array('content', 'CheckContent', '{%article_content_format_mobile}', 1, 'callback', 3),
+	);
+
+	/**
+	 * [CheckTitle 标题校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckTitle()
+	{
+		$len = Utf8Strlen(I('title'));
+		return ($len >= 3 && $len <= 60);
+	}
+
+	/**
+	 * [IsExistArticleClassId 文章分类是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistArticleClassId()
+	{
+		$temp = $this->db(0)->table('__ARTICLE_CLASS__')->field(array('id'))->find(I('article_class_id'));
+		return !empty($temp);
+	}
+
+	/**
+	 * [CheckTitleColor 颜色值校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckTitleColor()
+	{
+		return (preg_match('/'.L('common_regex_color').'/', I('title_color')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckJumpUrl 跳转url地址校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckJumpUrl()
+	{
+		return (preg_match('/'.L('common_regex_url').'/', I('jump_url')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckContent 内容校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckContent()
+	{
+		$len = Utf8Strlen(I('content'));
+		return ($len >= 50 && $len <= 105000);
+	}
+}
+?>

+ 64 - 0
Application/Admin/Model/ClassModel.class.php

@@ -0,0 +1,64 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 班级模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class ClassModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('name', 'CheckName', '{%common_name_format}', 1, 'callback', 3),
+		array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
+		array('sort', 'CheckSort', '{%common_sort_error}', 1, 'function', 3),
+		array('pid', 'CheckMyPid', '{%common_pid_eq_myid_format}', 1, 'callback', 2),
+
+		// 删除校验是否存在子级
+		array('id', 'IsExistSon', '{%common_is_exist_son_error}', 1, 'callback', 5),
+	);
+
+	/**
+	 * [CheckName 班级名称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckName()
+	{
+		$len = Utf8Strlen(I('name'));
+		return ($len >= 2 && $len <= 16);
+	}
+
+	/**
+	 * [CheckMyPid pid是否是当前节点校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:32:40+0800
+	 */
+	public function CheckMyPid()
+	{
+		return (I('id') != I('pid'));
+	}
+
+	/**
+	 * [IsExistSon 校验节点下是否存在子级数据]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 */
+	public function IsExistSon()
+	{
+		return ($this->db(0)->where(array('pid'=>I('id')))->count() == 0);
+	}
+}
+?>

+ 17 - 0
Application/Admin/Model/CommonModel.class.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 后台公共模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class CommonModel extends Model
+{
+	
+}
+?>

+ 23 - 0
Application/Admin/Model/ConfigModel.class.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 配置模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class ConfigModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('mobile', 'CheckMobile', '{%common_mobile_format_error}', 2, 'function', 3),
+		array('gender', array(0,1,2), '{%common_gender_tips}', 1, 'in', 3),
+		array('role_id', 'IsExistRole', '{%login_role_id_error}', 1, 'callback', 3),
+	);
+}
+?>

+ 140 - 0
Application/Admin/Model/CourseModel.class.php

@@ -0,0 +1,140 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 教师课程模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class CourseModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('teacher_id', 'IsExistTeacher', '{%course_teacher_tips}', 1, 'callback', 3),
+		array('class_id', 'IsExistClass', '{%course_class_tips}', 1, 'callback', 3),
+		array('subject_id', 'IsExistSubject', '{%course_subject_tips}', 1, 'callback', 3),
+		array('week_id', 'IsExistWeek', '{%course_week_tips}', 1, 'callback', 3),
+		array('interval_id', 'IsExistInterval', '{%course_interval_tips}', 1, 'callback', 3),
+		array('room_id', 'IsExistRoom', '{%course_room_tips}', 1, 'callback', 3),
+	);
+
+	/**
+	 * [IsExistTeacher 教师是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistTeacher()
+	{
+		$temp = $this->db(0)->table('__TEACHER__')->field(array('id'))->find(I('teacher_id'));
+		return !empty($temp);
+	}
+
+	/**
+	 * [IsExistClass 班级id是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-21T22:13:52+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistClass()
+	{
+		// 当用户操作自身的情况下不需要校验
+		$class = $this->db(0)->table('__CLASS__')->field(array('id', 'pid'))->find(I('class_id'));
+		if(empty($class))
+		{
+			return false;
+		}
+
+		if($class['pid'] == 0)
+		{
+			// 是否存在子级
+			$count = $this->db(0)->table('__CLASS__')->where(array('pid'=>$class['id']))->count();
+			return ($count == 0);
+		} else {
+			// 父级是否存在
+			$count = $this->db(0)->table('__CLASS__')->where(array('id'=>$class['pid']))->count();
+			return ($count > 0);
+		}
+	}
+
+	/**
+	 * [IsExistRoom 教室id是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-21T22:13:52+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistRoom()
+	{
+		// 当用户操作自身的情况下不需要校验
+		$class = $this->db(0)->table('__ROOM__')->field(array('id', 'pid'))->find(I('room_id'));
+		if(empty($class))
+		{
+			return false;
+		}
+
+		if($class['pid'] == 0)
+		{
+			// 是否存在子级
+			$count = $this->db(0)->table('__ROOM__')->where(array('pid'=>$class['id']))->count();
+			return ($count == 0);
+		} else {
+			// 父级是否存在
+			$count = $this->db(0)->table('__ROOM__')->where(array('id'=>$class['pid']))->count();
+			return ($count > 0);
+		}
+	}
+
+	/**
+	 * [IsExistSubject 教师关联的科目是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistSubject()
+	{
+		$temp = $this->db(0)->table('__TEACHER_SUBJECT__')->alias('AS ts')->join('__SUBJECT__ AS s ON ts.subject_id = s.id')->where(array('s.id'=>I('subject_id')))->field(array('s.id AS id'))->find();
+		return !empty($temp);
+	}
+
+	/**
+	 * [IsExistWeek 周天是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistWeek()
+	{
+		$temp = $this->db(0)->table('__WEEK__')->field(array('id'))->find(I('week_id'));
+		return !empty($temp);
+	}
+
+	/**
+	 * [IsExistInterval 时段是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistInterval()
+	{
+		$temp = $this->db(0)->table('__INTERVAL__')->field(array('id'))->find(I('interval_id'));
+		return !empty($temp);
+	}
+}
+?>

+ 52 - 0
Application/Admin/Model/CustomViewModel.class.php

@@ -0,0 +1,52 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 自定义页面模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class CustomViewModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(		
+		// 添加,编辑
+		array('title', 'CheckTitle', '{%article_title_format}', 1, 'callback', 3),
+		array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
+		array('is_header', array(0,1), '{%common_is_header_tips}', 1, 'in', 3),
+		array('is_footer', array(0,1), '{%common_is_footer_tips}', 1, 'in', 3),
+		array('is_full_screen', array(0,1), '{%common_is_full_screen_tips}', 1, 'in', 3),
+		array('content', 'CheckContent', '{%article_content_format_mobile}', 1, 'callback', 3),
+	);
+
+	/**
+	 * [CheckTitle 标题校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckTitle()
+	{
+		$len = Utf8Strlen(I('title'));
+		return ($len >= 3 && $len <= 60);
+	}
+
+	/**
+	 * [CheckContent 内容校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckContent()
+	{
+		$len = Utf8Strlen(I('content'));
+		return ($len >= 50 && $len <= 105000);
+	}
+}
+?>

+ 102 - 0
Application/Admin/Model/FractionImportModel.class.php

@@ -0,0 +1,102 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 成绩导入模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class FractionImportModel extends CommonModel
+{
+	// 表名
+	protected $tableName = 'fraction';
+
+	// 开启批量验证状态
+	protected $patchValidate = true;
+
+	// 数据自动校验
+	protected $_validate = array(		
+		// 添加,编辑
+		array('score', 'CheckScore', '{%fraction_score_format}', 1, 'callback', 3),
+		array('score_id', 'IsExistScoreId', '{%fraction_score_id_error}', 1, 'callback', 3),
+		array('subject_id', 'IsExistSubjectId', '{%fraction_subject_error}', 1, 'callback', 3),
+		array('student_id', 'IsExistStudentId', '{%fraction_student_id_error}', 1, 'callback', 3),
+		array('comment', 'CheckComment', '{%fraction_comment_format}', 1, 'callback', 3),
+	);
+
+	/**
+	 * [CheckComment 教师点评校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 * @param    [string] $value [校验值]
+	 */
+	public function CheckComment($value)
+	{
+		return (Utf8Strlen($value) <= 255);
+	}
+
+	/**
+	 * [CheckScore 分数校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 * @param    [string] $value [校验值]
+	 */
+	public function CheckScore($value)
+	{
+		return (preg_match('/'.L('common_regex_score').'/', $value) == 1) ? true : false;
+	}
+
+	/**
+	 * [IsExistScoreId 成绩分类id是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @param    [string] $value [校验值]
+	 * @return   [boolean]       [存在true, 不存在false]
+	 */
+	public function IsExistScoreId($value)
+	{
+		$id = $this->db(0)->table('__SCORE__')->where(array('id'=>$value))->getField('id');
+		return !empty($id);
+	}
+
+	/**
+	 * [IsExistSubjectId 科目分类id是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @param    [string] $value [校验值]
+	 * @return   [boolean]       [存在true, 不存在false]
+	 */
+	public function IsExistSubjectId($value)
+	{
+		$id = $this->db(0)->table('__SUBJECT__')->where(array('id'=>$value))->getField('id');
+		return !empty($id);
+	}
+
+	/**
+	 * [IsExistStudentId 学生id是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @param    [string] $value [校验值]
+	 * @return   [boolean]       [存在true, 不存在false]
+	 */
+	public function IsExistStudentId($value)
+	{
+		$id = $this->db(0)->table('__STUDENT__')->where(array('id'=>$value))->getField('id');
+		return !empty($id);
+	}
+}
+?>

+ 91 - 0
Application/Admin/Model/FractionModel.class.php

@@ -0,0 +1,91 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 成绩模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class FractionModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(		
+		// 添加,编辑
+		array('score', 'CheckScore', '{%fraction_score_format}', 1, 'callback', 3),
+		array('score_id', 'IsExistScoreId', '{%fraction_score_id_error}', 1, 'callback', 3),
+		array('subject_id', 'IsExistSubjectId', '{%fraction_subject_error}', 1, 'callback', 3),
+		array('student_id', 'IsExistStudentId', '{%fraction_student_id_error}', 1, 'callback', 3),
+		array('comment', 'CheckComment', '{%fraction_comment_format}', 1, 'callback', 3),
+	);
+
+	/**
+	 * [CheckComment 教师点评校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckComment()
+	{
+		return (Utf8Strlen(I('comment')) <= 255);
+	}
+
+	/**
+	 * [CheckScore 分数校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckScore()
+	{
+		return (preg_match('/'.L('common_regex_score').'/', I('score')) == 1) ? true : false;
+	}
+
+	/**
+	 * [IsExistScoreId 成绩分类id是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistScoreId()
+	{
+		$id = $this->db(0)->table('__SCORE__')->where(array('id'=>I('score_id')))->getField('id');
+		return !empty($id);
+	}
+
+	/**
+	 * [IsExistSubjectId 科目分类id是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistSubjectId()
+	{
+		$id = $this->db(0)->table('__SUBJECT__')->where(array('id'=>I('subject_id')))->getField('id');
+		return !empty($id);
+	}
+
+	/**
+	 * [IsExistStudentId 学生id是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistStudentId()
+	{
+		$id = $this->db(0)->table('__STUDENT__')->where(array('id'=>I('student_id')))->getField('id');
+		return !empty($id);
+	}
+}
+?>

+ 35 - 0
Application/Admin/Model/IntervalModel.class.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 时段模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class IntervalModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('name', 'CheckName', '{%interval_name_format}', 1, 'callback', 3),
+		array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
+		array('sort', 'CheckSort', '{%common_sort_error}', 1, 'function', 3),
+	);
+
+	/**
+	 * [CheckName 时段名称格式校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckName()
+	{
+		return (preg_match('/'.L('common_regex_interval').'/', I('name')) == 1) ? true : false;
+	}
+}
+?>

+ 107 - 0
Application/Admin/Model/LayoutModule.class.php

@@ -0,0 +1,107 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 模块模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class LayoutModule extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(		
+		// 编辑
+		array('name', 'CheckName', '{%view_name_format}', 2, 'callback', 2),
+		array('right_title', 'CheckRightTitle', '{%view_right_title_format}', 2, 'callback', 2),
+		array('article_id', 'CheckArticleId', '{%view_article_id_format}', 2, 'callback', 2),
+		array('keyword', 'CheckKeyword', '{%view_keyword_format}', 2, 'callback', 2),
+		array('show_number', 'CheckShowNumber', '{%view_show_number_format}', 2, 'callback', 2),
+		array('abstract_number', 'CheckAbstractNumber', '{%view_abstract_number_format}', 2, 'callback', 2),
+		array('sort_type', array(0,1,2), '{%view_sort_type_format}', 2, 'in', 2),
+		array('add_time_interval', array(0,1,2,3,4), '{%view_add_time_interval_format}', 2, 'in', 2),
+		array('upd_time_interval', array(0,1,2,3,4), '{%view_upd_time_interval_format}', 2, 'in', 2),
+		array('title_style', array(0,1,2,3,4,5,6,7,8,9), '{%view_title_style_format}', 2, 'in', 2),
+		array('link_open_way', array(0,1), '{%view_link_open_way_format}', 2, 'in', 2),
+		array('date_format', array(0,1,2,3), '{%view_date_format_format}', 2, 'in', 2),
+	);
+
+	/**
+	 * [CheckName 模块名称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckName()
+	{
+		$len = Utf8Strlen(I('name'));
+		return ($len <= 30);
+	}
+
+	/**
+	 * [CheckRightTitle 右标题校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckRightTitle()
+	{
+		$len = Utf8Strlen(I('right_title'));
+		return ($len <= 255);
+	}
+
+	/**
+	 * [CheckArticleId 指定主题id校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckArticleId()
+	{
+		return (preg_match('/'.L('common_regex_id_comma_split').'/', I('article_id')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckKeyword 关键字校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckKeyword()
+	{
+		$len = Utf8Strlen(I('keyword'));
+		return ($len <= 255);
+	}
+
+	/**
+	 * [CheckShowNumber 显示条数校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckShowNumber()
+	{
+		return (I('show_number') >= 1 && I('show_number') <= 1000);
+	}
+
+	/**
+	 * [CheckAbstractNumber 摘要字数校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckAbstractNumber()
+	{
+		return (I('abstract_number') >= 5 && I('abstract_number') <= 500);
+	}
+}
+?>

+ 63 - 0
Application/Admin/Model/LinkModel.class.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 友情链接模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class LinkModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 自定义
+		array('name', 'CheckName', '{%link_name_format}', 1, 'callback', 3),
+		array('describe', 'CheckDescribe', '{%link_describe_format}', 2, 'callback', 3),
+		array('url', 'CheckUrl', '{%link_url_format}', 1, 'callback', 3),
+		array('is_new_window_open', array(0,1), '{%common_new_window_open_tips}', 1, 'in', 3),
+		array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
+	);
+
+	/**
+	 * [CheckName 名称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckName()
+	{
+		$len = Utf8Strlen(I('name'));
+		return ($len >= 2 && $len <= 16);
+	}
+
+	/**
+	 * [CheckDescribe 描述校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckDescribe()
+	{
+		$len = Utf8Strlen(I('describe'));
+		return ($len <= 60);
+	}
+
+	/**
+	 * [CheckUrl url地址校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckUrl()
+	{
+		return (preg_match('/'.L('common_regex_url').'/', I('url')) == 1) ? true : false;
+	}
+}
+?>

+ 99 - 0
Application/Admin/Model/NavigationModel.class.php

@@ -0,0 +1,99 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 导航模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class NavigationModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 自定义导航
+		array('name', 'CheckName', '{%navheader_name_format}', 1, 'callback', 5),
+		array('url', 'CheckUrl', '{%navheader_url_format}', 1, 'callback', 5),
+		array('is_show', array(0,1), '{%common_show_tips}', 1, 'in', 5),
+		array('is_new_window_open', array(0,1), '{%common_new_window_open_tips}', 1, 'in', 5),
+
+		// 文章分类导航
+		array('value', 'CheckArticleClassValue', '{%navheader_article_class_id_format}', 1, 'callback', 6),
+		array('is_show', array(0,1), '{%common_show_tips}', 1, 'in', 6),
+		array('is_new_window_open', array(0,1), '{%common_new_window_open_tips}', 1, 'in', 6),
+
+		// 自定义页面导航
+		array('value', 'CheckCustomViewValue', '{%navheader_customview_id_format}', 1, 'callback', 7),
+		array('is_show', array(0,1), '{%common_show_tips}', 1, 'in', 7),
+		array('is_new_window_open', array(0,1), '{%common_new_window_open_tips}', 1, 'in', 7),
+
+
+		// 删除校验是否存在子级
+		array('id', 'IsExistSon', '{%common_is_exist_son_error}', 1, 'callback', 4),
+	);
+
+	/**
+	 * [CheckName 导航名称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckName()
+	{
+		$len = Utf8Strlen(I('name'));
+		return ($len >= 2 && $len <= 16);
+	}
+
+	/**
+	 * [CheckUrl url地址校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckUrl()
+	{
+		return (preg_match('/'.L('common_regex_url').'/', I('url')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckArticleClassValue 文章分类id校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckArticleClassValue()
+	{
+		return ($this->db(0)->table('__ARTICLE_CLASS__')->where(array('id'=>I('value')))->count() == 1);
+	}
+
+	/**
+	 * [CheckCustomViewValue 自定义页面id校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckCustomViewValue()
+	{
+		return ($this->db(0)->table('__CUSTOM_VIEW__')->where(array('id'=>I('value')))->count() == 1);
+	}
+
+	/**
+	 * [IsExistSon 校验节点下是否存在子级数据]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 */
+	public function IsExistSon()
+	{
+		return ($this->db(0)->where(array('pid'=>I('id')))->count() == 0);
+	}
+}
+?>

+ 137 - 0
Application/Admin/Model/PowerModel.class.php

@@ -0,0 +1,137 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 权限模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class PowerModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(		
+		// 添加,编辑
+		array('name', 'CheckName', '{%power_name_format}', 1, 'callback', 3),
+		array('control', 'CheckControl', '{%power_control_format}', 1, 'callback', 3),
+		array('action', 'CheckAction', '{%power_action_format}', 1, 'callback', 3),
+		array('pid', 'CheckPid', '{%power_level_format}', 2, 'callback', 3),
+		array('sort', 'CheckSort', '{%common_sort_error}', 1, 'function', 3),
+		array('icon', 'CheckIcon', '{%power_icon_format}', 1, 'callback', 3),
+		array('pid', 'CheckMyPid', '{%common_pid_eq_myid_format}', 1, 'callback', 2),
+
+		// 删除
+		array('id', 'CheckPowerIsExist', '{%power_no_exist_tips}', 1, 'callback', 5),
+		array('id', 'CheckPowerIsItem', '{%power_exist_item_tips}', 1, 'callback', 5),
+	);
+
+	/**
+	 * [CheckIcon 图标class校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckIcon()
+	{
+		$len = Utf8Strlen(I('icon'));
+		return ($len <= 60);
+	}
+
+	/**
+	 * [CheckName 权限名称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckName()
+	{
+		$len = Utf8Strlen(I('name'));
+		return ($len >= 2 && $len <= 16);
+	}
+
+	/**
+	 * [CheckAction 方法校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckAction()
+	{
+		return (preg_match('/'.L('common_regex_action').'/', I('action')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckControl 控制器校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckControl()
+	{
+		return (preg_match('/'.L('common_regex_control').'/', I('control')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckPid pid校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:32:40+0800
+	 */
+	public function CheckPid()
+	{
+		$pid = intval(I('pid'));
+		if($pid > 0)
+		{
+			$id = $this->db(0)->where(array('id'=>$pid))->getField('id');
+			return !empty($id);
+		}
+		return true;
+	}
+
+	/**
+	 * [CheckMyPid pid是否是当前节点校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:32:40+0800
+	 */
+	public function CheckMyPid()
+	{
+		return (I('id') != I('pid'));
+	}
+
+	/**
+	 * [CheckPowerIsExist 校验权限是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 */
+	public function CheckPowerIsExist()
+	{
+		$id = $this->db(0)->where(array('id'=>I('id')))->getField('id');
+		return !empty($id);
+	}
+
+	/**
+	 * [CheckPowerIsItem 校验权限是否存在子级]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 */
+	public function CheckPowerIsItem()
+	{
+		$count = $this->db(0)->where(array('pid'=>I('id')))->count();
+		return ($count <= 0);
+	}
+}
+?>

+ 64 - 0
Application/Admin/Model/RegionModel.class.php

@@ -0,0 +1,64 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 地区模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class RegionModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('name', 'CheckName', '{%common_name_format}', 1, 'callback', 3),
+		array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
+		array('sort', 'CheckSort', '{%common_sort_error}', 1, 'function', 3),
+		array('pid', 'CheckMyPid', '{%common_pid_eq_myid_format}', 1, 'callback', 2),
+
+		// 删除校验是否存在子级
+		array('id', 'IsExistSon', '{%common_is_exist_son_error}', 1, 'callback', 5),
+	);
+
+	/**
+	 * [CheckName 地区名称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckName()
+	{
+		$len = Utf8Strlen(I('name'));
+		return ($len >= 2 && $len <= 16);
+	}
+
+	/**
+	 * [CheckMyPid pid是否是当前节点校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:32:40+0800
+	 */
+	public function CheckMyPid()
+	{
+		return (I('id') != I('pid'));
+	}
+
+	/**
+	 * [IsExistSon 校验节点下是否存在子级数据]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 */
+	public function IsExistSon()
+	{
+		return ($this->db(0)->where(array('pid'=>I('id')))->count() == 0);
+	}
+}
+?>

+ 51 - 0
Application/Admin/Model/RoleModel.class.php

@@ -0,0 +1,51 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 角色模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class RoleModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('name', 'CheckName', '{%role_name_format}', 1, 'callback', 3),
+		array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
+
+		// 删除
+		array('id', 'IsExistRole', '{%role_no_exist_tips}', 1, 'callback', 5),
+	);
+
+	/**
+	 * [CheckName 权限名称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckName()
+	{
+		$len = Utf8Strlen(I('name'));
+		return ($len >= 2 && $len <= 16);
+	}
+
+	/**
+	 * [IsExistRole 校验角色是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 */
+	public function IsExistRole()
+	{
+		$id = $this->db(0)->where(array('id'=>I('id')))->getField('id');
+		return !empty($id);
+	}
+}
+?>

+ 64 - 0
Application/Admin/Model/RoomModel.class.php

@@ -0,0 +1,64 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 教室模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class RoomModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('name', 'CheckName', '{%common_name_format}', 1, 'callback', 3),
+		array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
+		array('sort', 'CheckSort', '{%common_sort_error}', 1, 'function', 3),
+		array('pid', 'CheckMyPid', '{%common_pid_eq_myid_format}', 1, 'callback', 2),
+
+		// 删除校验是否存在子级
+		array('id', 'IsExistSon', '{%common_is_exist_son_error}', 1, 'callback', 5),
+	);
+
+	/**
+	 * [CheckName 教室名称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckName()
+	{
+		$len = Utf8Strlen(I('name'));
+		return ($len >= 2 && $len <= 16);
+	}
+
+	/**
+	 * [CheckMyPid pid是否是当前节点校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:32:40+0800
+	 */
+	public function CheckMyPid()
+	{
+		return (I('id') != I('pid'));
+	}
+
+	/**
+	 * [IsExistSon 校验节点下是否存在子级数据]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 */
+	public function IsExistSon()
+	{
+		return ($this->db(0)->where(array('pid'=>I('id')))->count() == 0);
+	}
+}
+?>

+ 36 - 0
Application/Admin/Model/ScoreModel.class.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 成绩模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class ScoreModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('name', 'CheckName', '{%common_name_format}', 1, 'callback', 3),
+		array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
+		array('sort', 'CheckSort', '{%common_sort_error}', 1, 'function', 3),
+	);
+
+	/**
+	 * [CheckName 成绩名称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckName()
+	{
+		$len = Utf8Strlen(I('name'));
+		return ($len >= 2 && $len <= 16);
+	}
+}
+?>

+ 36 - 0
Application/Admin/Model/SemesterModel.class.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 学期模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class SemesterModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('name', 'CheckName', '{%common_name_format}', 1, 'callback', 3),
+		array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
+		array('sort', 'CheckSort', '{%common_sort_error}', 1, 'function', 3),
+	);
+
+	/**
+	 * [CheckName 学期名称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckName()
+	{
+		$len = Utf8Strlen(I('name'));
+		return ($len >= 2 && $len <= 16);
+	}
+}
+?>

+ 201 - 0
Application/Admin/Model/StudentImportModel.class.php

@@ -0,0 +1,201 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 学生导入模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class StudentImportModel extends CommonModel
+{
+	// 表名
+	protected $tableName = 'student';
+
+	// 开启批量验证状态
+	protected $patchValidate = true;
+
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('username', 'CheckUserName', '{%student_username_format}', 1, 'callback', 3),
+		array('id_card', 'CheckIdCard', '{%common_view_id_card_format}', 1, 'callback', 3),
+		array('gender', array(0,1,2), '{%common_gender_tips}', 1, 'in', 3),
+		array('birthday', 'CheckBirthday', '{%student_birthday_format}', 1, 'callback', 3),
+		array('class_id', 'IsExistClass', '{%student_class_tips}', 1, 'callback', 3),
+		array('region_id', 'IsExistRegion', '{%student_region_tips}', 1, 'callback', 3),
+		array('state', array(0,1,2,3,4), '{%common_student_state_tips}', 1, 'in', 3),
+		array('tel', 'CheckTel', '{%common_view_tel_error}', 2, 'callback', 3),
+		array('my_mobile', 'CheckMyMobile', '{%student_my_mobile_error}', 2, 'callback', 3),
+		array('parent_mobile', 'CheckParentMobile', '{%common_view_parent_mobile_error}', 1, 'callback', 3),
+		array('email', 'CheckEmail', '{%common_email_format_error}', 2, 'callback', 3),
+		array('tuition_state', array(0,1), '{%common_tuition_state_tips}', 1, 'in', 3),
+
+		// 添加
+		array('id_card', 'UniqueIdCard', '{%common_student_exist_error}', 1, 'callback', 1),
+	);
+
+	/**
+	 * [UniqueIdCard 身份证和学期号必须唯一]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-29T17:12:27+0800
+	 * @param    [string] $value [校验值]
+	 * @return   [boolean]       [存在false, 不存在true]
+	 */
+	public function UniqueIdCard($value)
+	{
+		// 读取学期配置信息
+		$semester_id = MyC('admin_semester_id');
+		if(empty($semester_id) || empty($value))
+		{
+			return false;
+		}
+
+		// 校验是否唯一
+		$id = $this->db(0)->where(array('id_card'=>$value, 'semester_id'=>$semester_id))->getField('id');
+		return empty($id);
+	}
+
+	/**
+	 * [CheckUserName 姓名校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 * @param    [string] $value [校验值]
+	 */
+	public function CheckUserName($value)
+	{
+		$len = Utf8Strlen($value);
+		return ($len >= 2 && $len <= 16);
+	}
+
+	/**
+	 * [CheckIdCard 身份证号码校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 * @param    [string] $value [校验值]
+	 */
+	public function CheckIdCard($value)
+	{
+		return (preg_match('/'.L('common_regex_id_card').'/', $value) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckBirthday 生日校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 * @param    [string] $value [校验值]
+	 */
+	public function CheckBirthday($value)
+	{
+		return (preg_match('/'.L('common_regex_birthday').'/', $value) == 1) ? true : false;
+	}
+
+	/**
+	 * [IsExistClass 班级id是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-21T22:13:52+0800
+	 * @param    [string] $value [校验值]
+	 * @return   [boolean]       [存在true, 不存在false]
+	 */
+	public function IsExistClass($value)
+	{
+		// 当用户操作自身的情况下不需要校验
+		$class = $this->db(0)->table('__CLASS__')->field(array('id', 'pid'))->find($value);
+		if(empty($class))
+		{
+			return false;
+		}
+
+		if($class['pid'] == 0)
+		{
+			// 是否存在子级
+			$count = $this->db(0)->table('__CLASS__')->where(array('pid'=>$class['id']))->count();
+			return ($count == 0);
+		} else {
+			// 父级是否存在
+			$count = $this->db(0)->table('__CLASS__')->where(array('id'=>$class['pid']))->count();
+			return ($count > 0);
+		}
+	}
+
+	/**
+	 * [IsExistRegion 地区是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @param    [string] $value [校验值]
+	 * @return   [boolean]       [存在true, 不存在false]
+	 */
+	public function IsExistRegion($value)
+	{
+		$id = $this->db(0)->table('__REGION__')->where(array('id'=>$value))->getField('id');
+		return !empty($id);
+	}
+
+	/**
+	 * [CheckTel 座机号码校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 * @param    [string] $value [校验值]
+	 */
+	public function CheckTel($value)
+	{
+		return (preg_match('/'.L('common_regex_tel').'/', $value) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckMyMobile 学生手机号码校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 * @param    [string] $value [校验值]
+	 */
+	public function CheckMyMobile($value)
+	{
+		return (preg_match('/'.L('common_regex_mobile').'/', $value) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckParentMobile 家长手机号码校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 * @param    [string] $value [校验值]
+	 */
+	public function CheckParentMobile($value)
+	{
+		return (preg_match('/'.L('common_regex_mobile').'/', $value) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckEmail 电子邮箱校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 * @param    [string] $value [校验值]
+	 */
+	public function CheckEmail($value)
+	{
+		return (preg_match('/'.L('common_regex_email').'/', $value) == 1) ? true : false;
+	}
+}
+?>

+ 202 - 0
Application/Admin/Model/StudentModel.class.php

@@ -0,0 +1,202 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 学生模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class StudentModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('username', 'CheckUserName', '{%student_username_format}', 1, 'callback', 3),
+		array('id_card', 'CheckIdCard', '{%common_view_id_card_format}', 1, 'callback', 3),
+		array('gender', array(0,1,2), '{%common_gender_tips}', 1, 'in', 3),
+		array('birthday', 'CheckBirthday', '{%student_birthday_format}', 1, 'callback', 3),
+		array('class_id', 'IsExistClass', '{%student_class_tips}', 1, 'callback', 3),
+		array('region_id', 'IsExistRegion', '{%student_region_tips}', 1, 'callback', 3),
+		array('state', array(0,1,2,3,4), '{%common_student_state_tips}', 1, 'in', 3),
+		array('tel', 'CheckTel', '{%common_view_tel_error}', 2, 'callback', 3),
+		array('my_mobile', 'CheckMyMobile', '{%student_my_mobile_error}', 2, 'callback', 3),
+		array('parent_mobile', 'CheckParentMobile', '{%common_view_parent_mobile_error}', 1, 'callback', 3),
+		array('email', 'CheckEmail', '{%common_email_format_error}', 2, 'callback', 3),
+		array('tuition_state', array(0,1), '{%common_tuition_state_tips}', 1, 'in', 3),
+
+		// 添加
+		array('id_card', 'UniqueIdCard', '{%common_student_exist_error}', 1, 'callback', 1),
+
+		// 编辑
+		array('id_card', 'NoExistIdCard', '{%common_no_exist_id_card_tips}', 1, 'callback', 2),
+	);
+
+	/**
+	 * [UniqueIdCard 身份证和学期号必须唯一]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-29T17:12:27+0800
+	 * @return [boolean] [存在false, 不存在true]
+	 */
+	public function UniqueIdCard()
+	{
+		// 读取学期配置信息
+		$semester_id = MyC('admin_semester_id');
+		if(empty($semester_id) || empty($_POST['id_card']))
+		{
+			return false;
+		}
+
+		// 校验是否唯一
+		$id = $this->db(0)->where(array('id_card'=>I('id_card'), 'semester_id'=>$semester_id))->getField('id');
+		return empty($id);
+	}
+
+	/**
+	 * [CheckUserName 姓名校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckUserName()
+	{
+		$len = Utf8Strlen(I('username'));
+		return ($len >= 2 && $len <= 16);
+	}
+
+	/**
+	 * [CheckIdCard 身份证号码校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckIdCard()
+	{
+		return (preg_match('/'.L('common_regex_id_card').'/', I('id_card')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckBirthday 生日校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckBirthday()
+	{
+		return (preg_match('/'.L('common_regex_birthday').'/', I('birthday')) == 1) ? true : false;
+	}
+
+	/**
+	 * [IsExistClass 班级id是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-21T22:13:52+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistClass()
+	{
+		// 当用户操作自身的情况下不需要校验
+		$class = $this->db(0)->table('__CLASS__')->field(array('id', 'pid'))->find(I('class_id'));
+		if(empty($class))
+		{
+			return false;
+		}
+
+		if($class['pid'] == 0)
+		{
+			// 是否存在子级
+			$count = $this->db(0)->table('__CLASS__')->where(array('pid'=>$class['id']))->count();
+			return ($count == 0);
+		} else {
+			// 父级是否存在
+			$count = $this->db(0)->table('__CLASS__')->where(array('id'=>$class['pid']))->count();
+			return ($count > 0);
+		}
+	}
+
+	/**
+	 * [IsExistRegion 地区是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function IsExistRegion()
+	{
+		$id = $this->db(0)->table('__REGION__')->where(array('id'=>I('region_id')))->getField('id');
+		return !empty($id);
+	}
+
+	/**
+	 * [CheckTel 座机号码校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckTel()
+	{
+		return (preg_match('/'.L('common_regex_tel').'/', I('tel')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckMyMobile 学生手机号码校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckMyMobile()
+	{
+		return (preg_match('/'.L('common_regex_mobile').'/', I('my_mobile')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckParentMobile 家长手机号码校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckParentMobile()
+	{
+		return (preg_match('/'.L('common_regex_mobile').'/', I('parent_mobile')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckEmail 电子邮箱校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckEmail()
+	{
+		return (preg_match('/'.L('common_regex_email').'/', I('email')) == 1) ? true : false;
+	}
+
+	/**
+	 * [NoExistIdCard 身份证号码是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function NoExistIdCard()
+	{
+		$id = $this->db(0)->where(array('id_card'=>I('id_card')))->getField('id');
+		return !empty($id);
+	}
+}
+?>

+ 36 - 0
Application/Admin/Model/SubjectModel.class.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 科目模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class SubjectModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('name', 'CheckName', '{%common_name_format}', 1, 'callback', 3),
+		array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
+		array('sort', 'CheckSort', '{%common_sort_error}', 1, 'function', 3),
+	);
+
+	/**
+	 * [CheckName 科目名称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckName()
+	{
+		$len = Utf8Strlen(I('name'));
+		return ($len >= 2 && $len <= 16);
+	}
+}
+?>

+ 135 - 0
Application/Admin/Model/TeacherModel.class.php

@@ -0,0 +1,135 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 教师模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class TeacherModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(		
+		// 添加,编辑
+		array('username', 'CheckUserName', '{%teacher_username_format}', 1, 'callback', 3),
+		array('id_card', 'CheckIdCard', '{%common_view_id_card_format}', 1, 'callback', 3),
+		array('gender', array(0,1,2), '{%common_gender_tips}', 1, 'in', 3),
+		array('birthday', 'CheckBirthday', '{%teacher_birthday_format}', 2, 'callback', 3),
+		array('state', array(0,1,2,3,4), '{%common_teacher_state_tips}', 1, 'in', 3),
+		array('mobile', 'CheckMobile', '{%common_mobile_format_error}', 1, 'callback', 3),
+		array('tel', 'CheckTel', '{%common_view_tel_error}', 2, 'callback', 3),
+		array('email', 'CheckEmail', '{%common_email_format_error}', 2, 'callback', 3),
+
+		// 添加
+		array('id_card', 'UniqueIdCard', '{%common_is_exist_id_card_tips}', 1, 'callback', 1),
+
+		// 编辑
+		array('id_card', 'NoExistIdCard', '{%common_no_exist_id_card_tips}', 1, 'callback', 2),
+	);
+
+	/**
+	 * [UniqueIdCard 身份证必须唯一]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-29T17:12:27+0800
+	 * @return [boolean] [存在false, 不存在true]
+	 */
+	public function UniqueIdCard()
+	{
+		$id = $this->db(0)->where(array('id_card'=>I('id_card')))->getField('id');
+		return empty($id);
+	}
+
+	/**
+	 * [CheckUserName 姓名校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckUserName()
+	{
+		$len = Utf8Strlen(I('username'));
+		return ($len >= 2 && $len <= 16);
+	}
+
+	/**
+	 * [CheckIdCard 身份证号码校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckIdCard()
+	{
+		return (preg_match('/'.L('common_regex_id_card').'/', I('id_card')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckBirthday 生日校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckBirthday()
+	{
+		return (preg_match('/'.L('common_regex_birthday').'/', I('birthday')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckMobile 手机号码校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckMobile()
+	{
+		return (preg_match('/'.L('common_regex_mobile').'/', I('mobile')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckTel 联系方式校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckTel()
+	{
+		return (preg_match('/'.L('common_regex_tel').'/', I('tel')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckEmail 电子邮箱校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckEmail()
+	{
+		return (preg_match('/'.L('common_regex_email').'/', I('email')) == 1) ? true : false;
+	}
+
+	/**
+	 * [NoExistIdCard 身份证号码是否存在]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-10T14:09:40+0800
+	 * @return [boolean] [存在true, 不存在false]
+	 */
+	public function NoExistIdCard()
+	{
+		$id = $this->db(0)->where(array('id_card'=>I('id_card')))->getField('id');
+		return !empty($id);
+	}
+}
+?>

+ 147 - 0
Application/Admin/Model/UploaderModel.class.php

@@ -0,0 +1,147 @@
+<?php
+
+namespace Admin\Model;
+
+use Think\Model;
+
+/**
+ * 用户模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class UploaderModel extends CommonModel {
+
+    public function Uploader($path) {
+        $files = array();
+        $success = 0; //用户统计有多少张图片上传成功了
+//         var_dump($_FILES);die;
+        foreach ($_FILES as $item) {
+            $index = count($files);
+            
+            $files[$index]['srcName'] = $item['name']; //上传图片的原名字
+            $files[$index]['error'] = $item['error']; //和该文件上传相关的错误代码
+            $files[$index]['size'] = $item['size']; //已上传文件的大小,单位为字节
+            $files[$index]['type'] = $item['type']; //文件的 MIME 类型,需要浏览器提供该信息的支持,例如"image/gif"
+            $files[$index]['success'] = false;  //这个用于标志该图片是否上传成功
+            $files[$index]['path'] = '';  //存图片路径
+            // 接收过程有没有错误
+            if ($item['error'] != 0)
+                continue;
+            //判断图片能不能上传
+            if (!is_uploaded_file($item['tmp_name'])) {
+                $files[$index]['error'] = 8000;
+                continue;
+            }
+            //扩展名
+            $extension = '';
+            if (strcmp($item['type'], 'image/jpeg') == 0) {
+                $extension = '.jpg';
+            } else if (strcmp($item['type'], 'image/png') == 0) {
+                $extension = '.png';
+            } else if (strcmp($item['type'], 'image/gif') == 0) {
+                $extension = '.gif';
+            } else {
+                //如果type不是以上三者,我们就从图片原名称里面去截取判断去取得(处于严谨性) 
+                $substr = strrchr($item['name'], '.');
+                if (FALSE == $substr) {
+                    $files[$index]['error'] = 8002;
+                    continue;
+                }
+
+                //取得元名字的扩展名后,再通过扩展名去给type赋上对应的值
+                if (strcasecmp($substr, '.jpg') == 0 || strcasecmp($substr, '.jpeg') == 0 || strcasecmp($substr, '.jfif') == 0 || strcasecmp($substr, '.jpe') == 0) {
+                    $files[$index]['type'] = 'image/jpeg';
+                } else if (strcasecmp($substr, '.png') == 0) {
+                    $files[$index]['type'] = 'image/png';
+                } else if (strcasecmp($substr, '.gif') == 0) {
+                    $files[$index]['type'] = 'image/gif';
+                }else if (strcasecmp($substr, '.webp') == 0){
+                    $files[$index]['type'] = 'image/webp';
+                }else if (strcasecmp($substr, '.xls') == 0){
+                    $files[$index]['type'] = 'image/xls';
+                } else {
+                    $files[$index]['error'] = 8003;
+                    continue;
+                }
+                $extension = $substr;
+            }
+
+            //对临时文件名加密,用于后面生成复杂的新文件名
+            $md5 = md5_file($item['tmp_name']);
+            //取得图片的大小
+            $imageInfo = getimagesize($item['tmp_name']);
+            $rawImageWidth = $imageInfo[0];
+            $rawImageHeight = $imageInfo[1];
+
+            //设置图片上传路径,放在upload文件夹,以年月日生成文件夹分类存储,
+            //rtrim(base_url(), '/')其实就是网站的根目录,大家自己处理
+            //define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
+            //$path = BASE_PATH . 'upload/' . date('Ymd') . '/';
+            //确保目录可写
+            $this->ensure_writable_dir($path);
+            //文件名
+            $name = "$md5.0x{$rawImageWidth}x{$rawImageHeight}{$extension}";
+            //加入图片文件没变化到,也就是存在,就不必重复上传了,不存在则上传
+            $ret = file_exists($path . $name) ? true : move_uploaded_file($item['tmp_name'], $path . $name);
+            if ($ret === false) {
+                $files[$index]['error'] = 8004;
+                continue;
+            } else {
+                $files[$index]['path'] = $path . $name; //存图片路径
+                $files[$index]['success'] = true;  //图片上传成功标志
+                $files[$index]['width'] = $rawImageWidth; //图片宽度
+                $files[$index]['height'] = $rawImageHeight; //图片高度
+                $success ++; //成功+1
+            }
+        }
+        $num = 0;
+        if($files[$index]['type'] == 'image/xls'){
+            $file = $files[$index]['path'];
+            $title = array(
+			'title'	=>	array('col' => 'A', 'name' => '资料标题'),
+                );
+            $excel = new \My\Excel(array('title'=>$title,'msg'=>L('common_not_data_tips')));
+            $data = $excel->Import($file);
+            $num = $this->add_robots_info($data);
+        }
+
+        //将图片已json形式返回给js处理页面 ,这里大家可以改成自己的json返回处理代码
+        echo json_encode(array(
+            'total' => count($files),
+            'success' => $success,
+            'imgurl' => $path . $name,
+            'num' => $num,
+        ));
+        //echo $path . $name;
+    }
+
+    function ensure_writable_dir($dir) {
+        if (!file_exists($dir)) {
+            mkdir($dir, 0766, true);
+            chmod($dir, 0766);
+            chmod($dir, 0777);
+        } else if (!is_writable($dir)) {
+            chmod($dir, 0766);
+            chmod($dir, 0777);
+            if (!is_writable($dir)) {
+                throw new FileSystemException("目录 $dir 不可写");
+            }
+        }
+    }
+    
+    public function add_robots_info($data){
+        $i = 0;
+         foreach($data as $v){
+             $info['creat_at'] = date('Y-m-d H:i:s', time());
+             $info['title'] = $v['title'];
+             M('robots')->add($info);
+             $i++;
+         }
+         return $i;
+    }
+
+}
+
+?>

+ 110 - 0
Application/Admin/Model/UserModel.class.php

@@ -0,0 +1,110 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 用户模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class UserModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(		
+		// 添加,编辑
+		array('nickname', 'CheckNickName', '{%user_nickname_format}', 2, 'callback', 3),
+		array('gender', array(0,1,2), '{%common_gender_tips}', 2, 'in', 3),
+		array('birthday', 'CheckBirthday', '{%user_birthday_format}', 2, 'callback', 3),
+		array('signature', 'CheckSignature', '{%user_signature_format}', 2, 'callback', 3),
+		array('describe', 'CheckDescribe', '{%user_describe_format}', 2, 'callback', 3),
+		array('mobile', 'CheckMobile', '{%common_mobile_format_error}', 2, 'callback', 3),
+		array('email', 'CheckEmail', '{%common_email_format_error}', 2, 'callback', 3),
+		array('mobile', '', '{%common_mobile_exist_error}', 2, 'unique', 3),
+		array('email', '', '{%common_email_exist_error}', 2, 'unique', 3),
+
+		// 添加
+		array('pwd', 'CheckLoginPwd', '{%user_login_pwd_format}', 1, 'function', 1),
+
+		// 编辑
+		array('pwd', 'CheckLoginPwd', '{%user_login_pwd_format}', 2, 'function', 2),
+	);
+
+	/**
+	 * [CheckNickName 昵称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckNickName()
+	{
+		$len = Utf8Strlen(I('nickname'));
+		return ($len <= 16);
+	}
+
+	/**
+	 * [CheckBirthday 生日校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckBirthday()
+	{
+		return (preg_match('/'.L('common_regex_birthday').'/', I('birthday')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckSignature 个人签名校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckSignature()
+	{
+		$len = Utf8Strlen(I('signature'));
+		return ($len <= 168);
+	}
+
+	/**
+	 * [CheckDescribe 个人描述校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckDescribe()
+	{
+		$len = Utf8Strlen(I('describe'));
+		return ($len <= 255);
+	}
+
+	/**
+	 * [CheckMobile 手机号码校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckMobile()
+	{
+		return (preg_match('/'.L('common_regex_mobile').'/', I('mobile')) == 1) ? true : false;
+	}
+
+	/**
+	 * [CheckEmail 电子邮箱校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T15:12:32+0800
+	 */
+	public function CheckEmail()
+	{
+		return (preg_match('/'.L('common_regex_email').'/', I('email')) == 1) ? true : false;
+	}
+}
+?>

+ 36 - 0
Application/Admin/Model/WeekModel.class.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace Admin\Model;
+use Think\Model;
+
+/**
+ * 周模型
+ * @author   Devil
+ * @blog     http://gong.gg/
+ * @version  0.0.1
+ * @datetime 2016-12-01T21:51:08+0800
+ */
+class WeekModel extends CommonModel
+{
+	// 数据自动校验
+	protected $_validate = array(
+		// 添加,编辑
+		array('name', 'CheckName', '{%common_name_format}', 1, 'callback', 3),
+		array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
+		array('sort', 'CheckSort', '{%common_sort_error}', 1, 'function', 3),
+	);
+
+	/**
+	 * [CheckName 周名称校验]
+	 * @author   Devil
+	 * @blog     http://gong.gg/
+	 * @version  0.0.1
+	 * @datetime 2016-12-13T19:29:30+0800
+	 */
+	public function CheckName()
+	{
+		$len = Utf8Strlen(I('name'));
+		return ($len >= 2 && $len <= 16);
+	}
+}
+?>

+ 1 - 0
Application/Admin/Model/index.html

@@ -0,0 +1 @@
+ 

+ 61 - 0
Application/Admin/View/Default/ActivityV2/Index.html

@@ -0,0 +1,61 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+		<!-- form start -->
+		<div class="am-g m-t-15">
+            <a href="{{:U('Admin/SelectActivity/Index')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> {{:L('common_operation_add')}}</a>
+        </div>
+		<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10">
+			<thead>
+				<tr>
+					<th>序号</th>
+					<th>活动ID</th>
+					<th class="am-hide-sm-only">活动名称</th>
+					<th class="am-hide-sm-only">开始时间</th>
+					<th class="am-hide-sm-only">结束时间</th>
+					<th class="am-hide-sm-only">创建时间</th>
+					<th>{{:L('common_operation_name')}}</th>
+				</tr>
+			</thead>
+			<tbody>
+				<if condition="!empty($List)">
+					<foreach name="List" item="v">
+						<tr id="data-list-{{$v.id}}">
+							<input type="hidden" value="{{$v.id}}" />
+							<td class="am-hide-sm-only">{{$key+1}}</td>
+							<td class="am-hide-sm-only">{{$v.id}}</td>
+							<td class="am-hide-sm-only">{{$v.activity_name}}</td>
+							<td class="am-hide-sm-only">{{$v.start_at}}</td>
+							<td class="am-hide-sm-only">{{$v.end_at}}</td>
+							<td class="am-hide-sm-only">{{$v.created_at}}</td>
+							<td class="view-operation">
+								<a href="{{:U('Admin/ActivityV2/SaveInfo', array('id'=>$v['id']))}}">
+									<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit" data-am-popover="{content: '{{:L('common_operation_edit')}}', trigger: 'hover focus'}"></button>
+								</a>
+								<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:U('Admin/ActivityV2/Delete')}}" data-am-popover="{content: '{{:L('common_operation_delete')}}', trigger: 'hover focus'}" data-id="{{$v.id}}"></button>
+							</td>
+						</tr>
+					</foreach>
+				<else />
+					<tr><td colspan="10" class="table-no">{{:L('common_not_data_tips')}}</td></tr>
+				</if>
+			</tbody>
+		</table>
+		<!-- list end -->
+
+		<!-- page start -->
+		<if condition="!empty($List)">
+			{{$page_html}}
+		</if>
+		<!-- page end -->
+	</div>
+</div>
+<!-- right content end  -->
+		
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end

Разлика између датотеке није приказан због своје велике величине
+ 622 - 0
Application/Admin/View/Default/ActivityV2/collect.html


+ 88 - 0
Application/Admin/View/Default/Admin/Index.html

@@ -0,0 +1,88 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+		<!-- form start -->
+		<form class="am-form admin-list" action="{{:U('Admin/Admin/Index')}}" method="POST">
+			<div class="am-g">
+				<select  class="am-radius c-p" name="role_id">
+					<option value="">{{:L('common_select_can_choose')}}</option>
+					<foreach name="role" item="v">
+						<option value="{{$v.id}}" <if condition="isset($param['role_id']) and $param['role_id'] eq $v['id']">selected</if>>{{$v.name}}</option>
+					</foreach>
+				</select>
+				<input type="text" class="am-radius" placeholder="{{:L('login_username_text')}}" name="username" <present name="param['username']"> value="{{$param.username}}"</present> />
+				<button type="submit" class="am-btn am-btn-secondary am-btn-sm am-radius">{{:L('common_operation_query')}}</button>
+			</div>
+		</form>
+		<!-- form end -->
+
+		<!-- operation start -->
+		<div class="am-g m-t-15">
+			<a href="{{:U('Admin/Admin/SaveInfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> {{:L('common_operation_add')}}</a>
+		</div>
+		<!-- operation end -->
+
+		<!-- list start -->
+		<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10">
+			<thead>
+				<tr>
+					<th>{{:L('common_admin_name')}}</th>
+					<th>{{:L('common_view_gender_name')}}</th>
+					<th>{{:L('login_total_name')}}</th>
+					<th class="am-hide-sm-only">{{:L('login_last_time_name')}}</th>
+					<th class="am-hide-sm-only">{{:L('common_create_time_name')}}</th>
+					<th>{{:L('common_operation_name')}}</th>
+				</tr>
+			</thead>
+			<tbody>
+				<if condition="!empty($list)">
+					<foreach name="list" item="v">
+						<tr id="data-list-{{$v.id}}">
+							<td>{{$v.username}}</td>
+							<td>{{:L('common_gender_list')[$v['gender']]['name']}}</td>
+							<td>{{$v.login_total}}</td>
+							<td class="am-hide-sm-only">
+								<if condition="$v['login_total'] eq 0">
+									{{:L('common_not_login_name')}}
+								<else />
+									{{:date('Y-m-d H:i:s', $v['login_time'])}}
+								</if>
+							</td>
+							<td class="am-hide-sm-only">{{:date('Y-m-d H:i:s', $v['add_time'])}}</td>
+							<td>
+								<if condition="$v['id'] eq 1">
+									<span class="cr-ccc">{{:L('common_do_not_operate')}}</span>
+								<else />
+									<a href="{{:U('Admin/Admin/SaveInfo', array('id'=>$v['id']))}}">
+										<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit" data-am-popover="{content: '{{:L('common_operation_edit')}}', trigger: 'hover focus'}"></button>
+									</a>
+									<if condition="$v['id'] neq $admin['id']">
+										<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:U('Admin/Admin/Delete')}}" data-am-popover="{content: '{{:L('common_operation_delete')}}', trigger: 'hover focus'}" data-id="{{$v.id}}"></button>
+									</if>
+								</if>
+							</td>
+						</tr>
+					</foreach>
+				<else />
+					<tr><td colspan="5" class="table-no">{{:L('common_not_data_tips')}}</td></tr>
+				</if>
+			</tbody>
+		</table>
+		<!-- list end -->
+
+		<!-- page start -->
+		<if condition="!empty($list)">
+			{{$page_html}}
+		</if>
+		<!-- page end -->
+	</div>
+</div>
+<!-- right content end  -->
+
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end -->

+ 38 - 0
Application/Admin/View/Default/Admin/LoginInfo.html

@@ -0,0 +1,38 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- content start -->
+<div class="account-pages">
+	<div class="wrapper-page">
+		<div class="text-center">
+            <span class="logo fw-700">{{:L('common_site_name')}}</span>
+        </div>
+        <div class="m-t-40 card-box">
+            <div class="panel-body">
+            	<form class="am-form form-validation" action="{{:U('Admin/Admin/Login')}}" method="POST" request-type="ajax-url" request-value="{{:U('Admin/Index/Index')}}">
+            		<div class="am-g">
+            			<div class="am-form-group">
+					      <input type="text" placeholder="{{:L('login_username_text')}}" name="username" pattern="{{:L('common_regex_username')}}" data-validation-message="{{:L('login_username_format')}}" class="am-radius" required />
+					    </div>
+					    <div class="am-form-group form-horizontal m-t-20">
+					      <input type="password" placeholder="{{:L('login_login_pwd_text')}}" name="login_pwd" pattern="{{:L('common_regex_pwd')}}" data-validation-message="{{:L('login_login_pwd_format')}}" class="am-radius" required />
+					    </div>
+                        <div class="am-form-group">
+                        	<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_login_loading_tips')}}'}">{{:L('login_button_text')}}</button>
+                        </div>
+                        
+                        <div class="am-form-group">
+                        	<a href="javascript:;" class="text-muted" data-am-popover="{theme: 'danger sm', content: '{{:L('login_forgot_pwd_tips')}}', trigger: 'hover focus'}">{{:L('login_forgot_pwd_text')}}</a>
+                        </div>
+            		</div>
+            	</form>
+            </div>
+        </div>
+	</div>
+</div>
+<!-- content end -->
+		
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end -->

+ 56 - 0
Application/Admin/View/Default/Admin/SaveInfo.html

@@ -0,0 +1,56 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+		<!-- form start -->
+		<form class="am-form form-validation view-save" action="{{:U('Admin/Admin/Save')}}" method="POST" request-type="ajax-url" request-value="{{:U('Admin/Admin/Index')}}">
+			<legend>
+				<span class="fs-16">
+					<if condition="empty($user['id'])">
+						{{:L('admin_add_name')}}
+					<else />
+						{{:L('admin_edit_name')}}
+					</if>
+				</span>
+				<a href="{{:U('Admin/Admin/Index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
+			</legend>
+			<div class="am-form-group">
+				<label>{{:L('login_username_text')}}</label>
+				<input type="text" placeholder="{{:L('login_username_text')}}" name="username" pattern="{{:L('common_regex_username')}}" data-validation-message="{{:L('login_username_format')}}" class="am-radius" <present name="data"> value="{{$data.username}}" disabled</present> required />
+			</div>
+			<div class="am-form-group">
+				<label>{{:L('login_login_pwd_text')}}</label>
+				<input type="password" placeholder="{{:L('login_login_pwd_text')}}" name="login_pwd" pattern="{{:L('common_regex_pwd')}}"  data-validation-message="{{:L('login_login_pwd_format')}}" class="am-radius" <notpresent name="data">required</notpresent> />
+			</div>
+			<div class="am-form-group">
+				<label>{{:L('common_mobile_name')}}</label>
+				<input type="text" placeholder="{{:L('common_mobile_name')}}" name="mobile" pattern="{{:L('common_regex_mobile')}}" data-validation-message="{{:L('common_mobile_format_error')}}" class="am-radius" <present name="data"> value="{{$data.mobile}}"</present> />
+			</div>
+			<if condition="$admin['id'] neq $data['id']">
+				<div class="am-form-group">
+					<label>{{:L('admin_view_role_name')}}</label>
+					<select  class="am-radius c-p" name="role_id" data-validation-message="{{:L('login_role_id_format')}}" required>
+						<option value="">{{:L('common_select_can_choose')}}</option>
+						<foreach name="role" item="v">
+							<option value="{{$v.id}}" <if condition="isset($data['role_id']) and $data['role_id'] eq $v['id']">selected</if>>{{$v.name}}</option>
+						</foreach>
+					</select>
+				</div>
+			</if>
+			<include file="Lib/Gender" />
+			<div class="am-form-group">
+				<input type="hidden" name="id" <present name="id"> value="{{$id}}"</present>" />
+				<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>
+			</div>
+		</form>
+        <!-- form end -->
+	</div>
+</div>
+<!-- right content end  -->
+		
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end -->

+ 27 - 0
Application/Admin/View/Default/Cache/Index.html

@@ -0,0 +1,27 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+		<!-- cache list start -->
+		<foreach name="cache_type_list" item="v">
+			<if condition="$v['is_enable'] eq 1">
+				<div class="am-panel am-panel-default am-radius">
+					<div class="am-panel-hd">{{$v.name}}</div>
+					<a href="{{$v.url}}">
+						<button type="button" class="am-btn am-btn-secondary am-radius am-btn-xs am-fr cache-submit">{{:L('common_operation_update')}}</button>
+					</a>
+					<div class="am-panel-bd">{{$v.desc}}</div>
+				</div>
+			</if>
+		</foreach>
+		<!-- cache list end -->
+	</div>
+</div>
+<!-- right content end  -->
+		
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end -->

+ 61 - 0
Application/Admin/View/Default/CleanPrizeLog/Index.html

@@ -0,0 +1,61 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+            <!-- form start -->
+            <form class="am-form view-list" action="{{:U('Admin/CleanPrizeLog/Index')}}" method="post">
+                <div class="am-g">
+                    <input type="text" class="am-radius form-keyword" placeholder="活动名称" name="keyword" value="{{$keyword}}" style="display: inline-block;width: 20rem;">
+                    <button type="submit" class="am-btn am-btn-secondary am-btn-sm am-radius form-submit">查询</button>
+                </div>
+            </form>
+		<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10">
+                    <thead>
+                        <tr>
+                            <th>ID</th>
+                            <th class="am-hide-sm-only">活动id</th>
+                            <th class="am-hide-sm-only">活动名称</th>
+                            <th>{{:L('common_operation_name')}}</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                            <if condition="!empty($List)">
+                                <?php $vip = [0=>'非会员',1=>'会员',2=>'双会员'];?>
+                                <foreach name="List" item="v">
+                                    <tr id="data-list-{{$v.id}}">
+                                        <input type="hidden" value="{{$v.id}}" />
+                                        <td class="am-hide-sm-only">{{$v.id}}</td>
+                                        <td class="am-hide-sm-only">{{$v.id}}</td>
+                                        <td class="am-hide-sm-only">{{$v.activity_name}}</td>
+                                        <td class="view-operation">
+                                            <button type="button" class="am-btn am-btn-secondary am-btn-sm am-radius" onclick="cleanData({{$v.id}});">清理活动数据</button>
+                                        </td>
+                                    </tr>
+                                </foreach>
+                            <else />
+                                    <tr><td colspan="10" class="table-no">{{$act_id ? '没有记录':'请先选择活动'}}</td></tr>
+                            </if>
+                    </tbody>
+		</table>
+		<!-- list end -->
+
+		<!-- page start -->
+		<div id="pages" class="p">{{$page}}</div>
+		<!-- page end -->
+	</div>
+</div>
+<!-- right content end  -->
+<script type="text/javascript">
+    function cleanData(act_id){
+        // alert(act_id);return;
+        $.post('{{:U("Admin/CleanPrizeLog/clean")}}', {act_id: act_id}, function(data) {
+            alert(data);
+        });
+    }  
+</script>		
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end

+ 54 - 0
Application/Admin/View/Default/Config/Index.html

@@ -0,0 +1,54 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+		<!-- form start -->
+		<form class="am-form form-validation view-save" action="{{:U('Admin/Config/Save')}}" method="POST" request-type="ajax-url" request-value="{{:U('Admin/Config/Index')}}">
+			<div class="am-form-group">
+				<label>{{$data.admin_semester_id.name}}<span class="fs-12 fw-100 cr-999">({{$data.admin_semester_id.describe}})</span></label>
+				<select name="{{$data.admin_semester_id.only_tag}}" class="am-radius c-p" data-validation-message="{{$data.admin_semester_id.error_tips}}" required>
+					<option value="">{{:L('common_select_can_choose')}}</option>
+					<foreach name="semester_list" item="v">
+						<option value="{{$v.id}}" <if condition="isset($data['admin_semester_id']['value']) and $data['admin_semester_id']['value'] eq $v['id']">selected</if>>{{$v.name}}</option>
+					</foreach>
+				</select>
+			</div>
+			<div class="am-form-group">
+				<label>{{$data.admin_excel_charset.name}}<span class="fs-12 fw-100 cr-999">({{$data.admin_excel_charset.describe}})</span></label>
+				<select name="{{$data.admin_excel_charset.only_tag}}" class="am-radius c-p" data-validation-message="{{$data.admin_excel_charset.error_tips}}" required>
+					<foreach name="common_excel_charset_list" item="v">
+						<option value="{{$v.id}}" <if condition="isset($data['admin_excel_charset']['value']) and $data['admin_excel_charset']['value'] eq $v['id']">selected</if>>{{$v.name}}</option>
+					</foreach>
+				</select>
+			</div>
+			<div class="am-form-group">
+				<label>{{$data.admin_page_number.name}}<span class="fs-12 fw-100 cr-999">({{$data.admin_page_number.describe}})</span></label>
+				<input type="number" name="{{$data.admin_page_number.only_tag}}" placeholder="{{$data.admin_page_number.describe}}" pattern="{{:L('common_regex_page_number')}}" data-validation-message="{{$data.admin_page_number.error_tips}}" class="am-radius" <present name="data"> value="{{$data.admin_page_number.value}}"</present> required />
+			</div>
+			<div class="am-form-group form-fraction-list">
+				<label class="block">{{$data.admin_fraction_weak.name}}<span class="fs-12 fw-100 cr-999">({{$data.admin_fraction_weak.error_tips}})</span></label>
+				<input type="number" name="{{$data.admin_fraction_weak.only_tag}}" placeholder="{{$data.admin_fraction_weak.describe}}" pattern="{{:L('common_regex_score')}}" data-validation-message="{{$data.admin_fraction_weak.error_tips}}" class="am-radius" <present name="data"> value="{{$data.admin_fraction_weak.value}}"</present> required />
+				<input type="number" name="{{$data.admin_fraction_poor.only_tag}}" placeholder="{{$data.admin_fraction_poor.describe}}" pattern="{{:L('common_regex_score')}}" data-validation-message="{{$data.admin_fraction_poor.error_tips}}" class="am-radius" <present name="data"> value="{{$data.admin_fraction_poor.value}}"</present> required />
+				<input type="number" name="{{$data.admin_fraction_commonly.only_tag}}" placeholder="{{$data.admin_fraction_commonly.describe}}" pattern="{{:L('common_regex_score')}}" data-validation-message="{{$data.admin_fraction_commonly.error_tips}}" class="am-radius" <present name="data"> value="{{$data.admin_fraction_commonly.value}}"</present> required />
+				<input type="number" name="{{$data.admin_fraction_good.only_tag}}" placeholder="{{$data.admin_fraction_good.describe}}" pattern="{{:L('common_regex_score')}}" data-validation-message="{{$data.admin_fraction_good.error_tips}}" class="am-radius" <present name="data"> value="{{$data.admin_fraction_good.value}}"</present> required />
+				<input type="number" name="{{$data.admin_fraction_excellent.only_tag}}" placeholder="{{$data.admin_fraction_excellent.describe}}" pattern="{{:L('common_regex_score')}}" data-validation-message="{{$data.admin_fraction_excellent.error_tips}}" class="am-radius" <present name="data"> value="{{$data.admin_fraction_excellent.value}}"</present> required />
+			</div>
+			<div class="am-form-group">
+				<label>{{$data.common_image_proportion.name}}<span class="fs-12 fw-100 cr-999">({{$data.common_image_proportion.describe}})</span></label>
+				<input type="text" name="{{$data.common_image_proportion.only_tag}}" placeholder="{{$data.common_image_proportion.name}}" pattern="{{:L('common_regex_image_proportion')}}" data-validation-message="{{$data.common_image_proportion.error_tips}}" class="am-radius" <present name="data"> value="{{$data.common_image_proportion.value}}"</present> required />
+			</div>
+			<div class="am-form-group">
+				<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>
+			</div>
+		</form>
+        <!-- form end -->
+	</div>
+</div>
+<!-- right content end  -->
+		
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end -->

+ 79 - 0
Application/Admin/View/Default/Daoju/Index.html

@@ -0,0 +1,79 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+            <!-- form start -->
+            <form class="am-form view-list" action="{{:U('Admin/Daoju/Index')}}" method="post">
+                <div class="am-g">
+                    <input type="text" class="am-radius form-keyword" placeholder="用户uid" name="keyword" value="{{$keyword}}" style="display: inline-block;width: 20rem;">
+                    <select name="act_id" style="display: inline-block;width: 10rem;">
+                            <option value="">全部活动</option>
+                            <?php foreach($acts as $act):?>
+                            <option value="<?php echo $act['id'];?>" <?php if($act_id == $act['id']):?>selected<?php endif;?>><?php echo $act['activity_name'];?></option>
+                            <?php endforeach;?>
+                    </select>
+                    <if condition="!IsMobile()">
+                         <a href="#" id="export" class="am-btn am-btn-success am-btn-xs m-l-10 am-icon-file-excel-o am-radius"> {{:L('common_operation_excel_export_name')}}</a> 
+                    </if>
+                    <button type="submit" class="am-btn am-btn-secondary am-btn-sm am-radius form-submit">查询</button>
+                </div>
+            </form>
+		<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10">
+                    <thead>
+                        <tr>
+                            <th>ID</th>
+                            <th class="am-hide-sm-only">用户id</th>
+                            <th class="am-hide-sm-only">道具名称</th>
+                            <th class="am-hide-sm-only">活动名称</th>
+                            <th class="am-hide-sm-only">收支情况</th>
+                            <th class="am-hide-sm-only">时间</th>
+                            <th>{{:L('common_operation_name')}}</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                            <if condition="!empty($List)">
+                                <foreach name="List" item="v">
+                                    <tr id="data-list-{{$v.id}}">
+                                        <input type="hidden" value="{{$v.id}}" />
+                                        <td class="am-hide-sm-only">{{$v.id}}</td>
+                                        <td class="am-hide-sm-only">{{$v.uid}}</td>
+                                        <td class="am-hide-sm-only">{{$v.name}}</td>
+                                        <td class="am-hide-sm-only">{{$v.activity_name}}</td>
+                                        <td class="am-hide-sm-only">{{$v.operate}}</td>
+                                        <td class="am-hide-sm-only">{{$v.created_at}}</td>
+                                        <td class="view-operation">
+                                            <button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:U('Admin/Daoju/Delete')}}" data-am-popover="{content: '{{:L('common_operation_delete')}}', trigger: 'hover focus'}" data-id="{{$v.id}}"></button>
+                                        </td>
+                                    </tr>
+                                </foreach>
+                            <else />
+                                    <tr><td colspan="10" class="table-no">{{$act_id ? '没有记录':'请先选择活动'}}</td></tr>
+                            </if>
+                    </tbody>
+		</table>
+		<!-- list end -->
+
+		<!-- page start -->
+		<div id="pages" class="p">{{$page}}</div>
+		<!-- page end -->
+	</div>
+</div>
+<!-- right content end  -->
+<script type="text/javascript">
+$("#export").on("click",function(){
+        var keyword = $("input[name=keyword]").val();
+        var prize_status = $("select[name=prize_status]").val();
+        var act_id = $("select[name=act_id]").val();
+        
+        var params = '&keyword='+keyword+'&prize_status='+prize_status+'&act_id='+act_id;
+        var url = 'index.php?m=Admin&c=PrizeLog&a=Index&model=exportExcel'+params;
+//        alert(url);return ;
+        window.open(url);
+});    
+</script>		
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end

+ 126 - 0
Application/Admin/View/Default/Daoju/SaveInfo.html

@@ -0,0 +1,126 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+		<!-- form start -->
+		<div id="success" style="color:#fff;display: none;background: limegreen;height: 3rem;text-align: center;"></div>
+		<form class="am-form form-validation view-save" action="{{:U('Admin/Version/Save')}}" method="POST" request-type="ajax-url" request-value="{{:U('Admin/Version/Index')}}" enctype="multipart/form-data">
+			<legend>
+				<span class="fs-16">
+					<if condition="empty($data['id'])">
+						奖项添加
+					<else />
+						奖项编辑
+					</if>
+				</span>
+				<a href="{{:U('Admin/Version/Index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
+			</legend>
+			<div class="am-form-group">
+				<label>版本名称</label>
+				<div class="am-input-group am-input-group-sm">
+					<input type="text" name="prize_name" placeholder="奖项名称" data-validation-message="请填写奖项名称" class="am-form-field am-radius" 
+					<notempty name="data"> value="{{$data.prize_name}}" </notempty>/>
+				</div>
+			</div>
+			<div class="am-form-group">
+				<label>中奖份额</label>
+				<div class="am-input-group am-input-group-sm">
+					<input type="number" name="prize_num" placeholder="中奖份额" class="am-form-field am-radius" 
+					<notempty name="data"> value="{{$data.prize_num}}" </notempty>/>
+				</div>
+			</div>
+			<div class="am-form-group">
+				<label>宣传图片</label>
+                <div class="am-input-group am-input-group-sm">
+                    <input type="file" style="border: hidden;"   id="file1" name='file' placeholder="上传图片" class="am-form-field am-radius" />
+                    <input type="hidden" class="prize_img" name="prize_img" value="{{$data.prize_img}}" />
+                    <p><img id="img1" alt="上传成功啦" src="{{$data.prize_img}}" /></p>
+                </div>
+			</div>	
+			<div class="am-form-group" style="padding-top: 2rem">
+				<input type="hidden" name="id" <notempty name="data"> value="{{$data.id}}"</notempty>" />
+				<div data-id = "1" class="bt" style="display:inline-block;margin-right:3rem;width: 20rem;height: 3rem;text-align: center;padding: 0.5rem;border: 0.1rem solid black;border-radius: 0.3rem;background: blue;color: #fff;cursor: pointer;">保存</div>
+				<!--<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>-->
+			</div>
+		</form>
+        <!-- form end -->
+	</div>
+</div>
+<!-- right content end  -->
+
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end -->
+<script src="__PUBLIC__/Common/Lib/uploader/jquery-1.9.1.min.js" type="text/javascript"></script>
+<script src="__PUBLIC__/Common/Lib/uploader/ajaxfileupload.js" type="text/javascript"></script>
+<script type="text/javascript">
+$(function() {
+	$("#file1").change(function() {
+        ajaxFileUpload();
+    })
+    $('.bt').click(function(){
+    	var prize_name = $("input[name='prize_name']").val();
+    	if(prize_name == ''){
+    		$('#success').html('请填写奖项名称');
+			$('#success').css('display','block')
+    		window.setTimeout("$('#success').css('display','none')", 2000);
+    		return false;
+    	}
+    	var prize_num = $("input[name='prize_num']").val();
+    	if(prize_num == ''){
+    		$('#success').html('请填写中奖份额');
+			$('#success').css('display','block')
+    		window.setTimeout("$('#success').css('display','none')", 2000);
+    		return false;
+    	}
+    	var prize_img = $("input[name='prize_img']").val();
+    	var id = $("input[name='id']").val();
+    	if(id.length>0){
+	        	id = id;
+	        }else{
+	        	id = -2;
+	        }
+    	$.ajax({
+	        type: "POST", //提交方式  
+	        url: "{{:U('Admin/Prize/Save')}}", //路径  
+	        data: {"prize_name":prize_name,"prize_num":prize_num,"id":id,"prize_img":prize_img},
+	        success: function(result) {//返回数据根据结果进行相应的处理
+	        	if(result == 100){
+	        		$('#success').html('保存成功');
+					$('#success').css('display','block')
+	        		window.setTimeout("location.href = '{{:U('Admin/Prize/Index')}}'", 1000);
+	        	}else if(result == -100){
+	        		alert('保存失败!');
+	        	}
+	        }
+    	});
+    })
+    
+})
+function ajaxFileUpload() {
+    $.ajaxFileUpload
+        (
+            {
+                url: '{{:U('Admin/Source/Uploader')}}', //用于文件上传的服务器端请求地址
+                secureuri: false, //是否需要安全协议,一般设置为false
+                fileElementId: 'file1', //文件上传域的ID
+                dataType: 'text', //返回值类型 一般设置为json
+                success: function(data, status) //服务器成功响应处理函数
+                {
+                    data =  eval('(' + data + ')');
+                    $(".prize_img").attr("value", data.imgurl);
+                    $("#img1").attr("src", data.imgurl);
+                    
+                },
+                error: function(data, status, e)//服务器响应失败处理函数
+                {
+                    alert(status);
+                }
+            }
+        )
+    return false;
+}
+</script>

+ 26 - 0
Application/Admin/View/Default/Index/Index.html

@@ -0,0 +1,26 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+<!-- nav start -->
+<include file="Public/Nav" />
+<!-- nav end -->
+		
+<!-- content start -->
+<div class="admin">
+	<!-- left menu start -->
+	<include file="Public/Menu" />
+	<!-- left menu end -->
+
+	<!-- right content start  -->
+	<iframe id="ifcontent" src="{{:U('Admin/Index/Init')}}"></iframe>
+	<!-- right content end  -->
+</div>
+<!-- content end -->
+
+<!-- navbar start -->
+<include file="Public/NavBar" />
+<!-- navbar end -->
+		
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end -->

+ 49 - 0
Application/Admin/View/Default/Index/Init.html

@@ -0,0 +1,49 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+		<p class="fw-700 list-title">{{:L('os_view_title')}}</p>
+		<dl class="dl-content">
+			<dt>{{:L('ver_name')}}</dt>
+			<dd>{{$data.ver}}<a href="{{:L('common_application_website')}}" target="_blank" class="m-l-10">{{:L('ver_to_view_name')}}</a></dd>
+
+			<dt>{{:L('os_ver_name')}}</dt>
+			<dd>{{$data.os_ver}}</dd>
+
+			<dt>{{:L('php_ver_name')}}</dt>
+			<dd>{{$data.php_ver}}</dd>
+
+			<dt>{{:L('mysql_ver_name')}}</dt>
+			<dd>{{$data.mysql_ver}}</dd>
+
+			<dt>{{:L('server_ver_name')}}</dt>
+			<dd>{{$data.server_ver}}</dd>
+
+			<dt>{{:L('host_name')}}</dt>
+			<dd>{{$data.host}}</dd>
+		</dl>
+
+		<p class="fw-700 list-title">{{:L('team_view_title')}}</p>
+		<dl class="dl-content">
+			<dt>{{:L('copyright_name')}}</dt>
+			<dd>{{:L('common_application_name')}}</dd>
+
+			<dt>{{:L('originator_name')}}</dt>
+			<dd>魔鬼</dd>
+
+			<dt>{{:L('research_name')}}</dt>
+			<dd>
+				<a href="http://gong.gg/" target="_blank">魔鬼</a>
+				<a href="javascript:;" class="m-l-10">小会</a>
+			</dd>
+		</dl>
+	</div>
+</div>
+<!-- right content end  -->
+
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end -->

+ 107 - 0
Application/Admin/View/Default/Power/Index.html

@@ -0,0 +1,107 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+		<!-- operation start -->
+		<div class="am-g">
+			<button class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus submit-add" data-am-modal="{target: '#power-save-win'}"> {{:L('common_operation_add')}}</button>
+		</div>
+		<!-- operation end -->
+
+		<!-- save win start -->
+		<div class="am-popup am-radius" id="power-save-win">
+			<div class="am-popup-inner">
+				<div class="am-popup-hd">
+					<h4 class="am-popup-title" data-add-title="{{:L('power_add_name')}}" data-edit-title="{{:L('power_edit_name')}}">{{:L('power_add_name')}}</h4>
+					<span data-am-modal-close class="am-close">&times;</span>
+				</div>
+				<div class="am-popup-bd">
+					<!-- form start -->
+					<form class="am-form form-validation admin-save" action="{{:U('Admin/Power/PowerSave')}}" method="POST" request-type="ajax-reload" request-value="">
+						<div class="am-form-group">
+							<label>{{:L('power_level_text')}}</label>
+							<select  class="am-radius c-p" name="pid" data-validation-message="{{:L('power_level_format')}}">
+								<option value="0">{{:L('common_select_level_one_choice')}}</option>
+								<foreach name="list" item="v">
+									<option value="{{$v.id}}">{{$v.name}}</option>
+								</foreach>
+							</select>
+						</div>
+						<div class="am-form-group">
+							<label>{{:L('power_name_text')}}</label>
+							<input type="text" placeholder="{{:L('power_name_text')}}" name="name" minlength="2" maxlength="16" data-validation-message="{{:L('power_name_format')}}" class="am-radius" required />
+						</div>
+						<div class="am-form-group">
+							<label>{{:L('power_control_text')}}</label>
+							<input type="text" placeholder="{{:L('power_control_text')}}" name="control" pattern="{{:L('common_regex_control')}}"  data-validation-message="{{:L('power_control_format')}}" class="am-radius" required />
+						</div>
+						<div class="am-form-group">
+							<label>{{:L('power_action_text')}}</label>
+							<input type="text" placeholder="{{:L('power_action_text')}}" name="action" pattern="{{:L('common_regex_action')}}"  data-validation-message="{{:L('power_action_format')}}" class="am-radius" required />
+						</div>
+						<div class="am-form-group">
+							<label>{{:L('power_icon_text')}}<span class="fs-12 fw-100 cr-999">({{:L('power_icon_tips')}})</span></label>
+							<input type="text" placeholder="{{:L('power_icon_text')}}" name="icon" maxlength="60" data-validation-message="{{:L('power_icon_format')}}" class="am-radius" />
+						</div>
+						<div class="am-form-group">
+							<label>{{:L('common_view_sort_title')}}</label>
+							<input type="number" placeholder="{{:L('common_view_sort_title')}}" name="sort" min="0" max="255" data-validation-message="{{:L('common_sort_error')}}" class="am-radius" value="0" required />
+						</div>
+						<include file="Lib/IsShow" />
+						<div class="am-form-group">
+							<input type="hidden" name="id" />
+							<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>
+						</div>
+					</form>
+					<!-- form end -->
+				</div>
+			</div>
+		</div>
+		<!-- save win end -->
+
+        <!-- content start -->
+		<ul class="tree-list p-0 m-t-15">
+			<foreach name="list" item="v">
+				<li id="data-list-{{$v.id}}" <if condition="$v['is_show'] eq 0">class="bk-cr-ffd"</if>>
+					<if condition="!empty($v['item'])">
+						<i class="am-icon-plus c-p m-r-5"></i>
+						<label class="c-p">
+					<else />
+						<label class="c-p m-l-20">
+					</if>
+						<span><if condition="!empty($v['icon'])"><span class="{{$v.icon}}"></span></if> {{$v.name}}</span>
+					</label>
+					<div class="fr m-r-20 list-submit">
+						<span class="am-icon-edit am-icon-md c-p submit-edit <if condition="!empty($v['item'])">m-r-5</if>" data-am-popover="{content: '{{:L('common_operation_edit')}}', trigger: 'hover focus'}" data-am-modal="{target: '#power-save-win'}" data-json='{{:json_encode($v)}}' data-tag="power-save-win" data-item="<if condition="!empty($v['item'])">ok<else />no</if>"></span>
+						<if condition="empty($v['item'])">
+							<span class="am-icon-trash-o am-icon-md c-p m-l-20 m-r-15 submit-delete" data-url="{{:U('Admin/Power/PowerDelete')}}" data-am-popover="{content: '{{:L('common_operation_delete')}}', trigger: 'hover focus'}" data-id="{{$v.id}}"></span>
+						</if>
+					</div>
+				</li>
+				<if condition="!empty($v['item'])">
+					<ul class="list-find p-0 m-t-5" style="display:none;">
+						<foreach name="v.item" item="vs">
+							<li id="data-list-{{$vs.id}}" <if condition="$vs['is_show'] eq 0">class="bk-cr-ffd"</if>>
+								<label class="c-p">
+									<span><if condition="!empty($vs['icon'])"><span class="{{$vs.icon}}"></span></if> {{$vs.name}}</span>
+								</label>
+								<div class="fr m-r-20 find-submit">
+									<span class="am-icon-edit am-icon-md c-p submit-edit" data-am-popover="{content: '{{:L('common_operation_edit')}}', trigger: 'hover focus'}" data-am-modal="{target: '#power-save-win'}" data-json='{{:json_encode($vs)}}' data-tag="power-save-win" data-item="no"></span>
+									<span class="am-icon-trash-o am-icon-md c-p m-l-20 m-r-15 submit-delete" data-url="{{:U('Admin/Power/PowerDelete')}}" data-am-popover="{content: '{{:L('common_operation_delete')}}', trigger: 'hover focus'}" data-id="{{$vs.id}}"></span>
+								</div>
+							</li>
+						</foreach>
+					</ul>
+				</if>
+			</foreach>
+		</ul>
+	</div>
+</div>
+<!-- right content end  -->
+		
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end -->

+ 65 - 0
Application/Admin/View/Default/Power/Role.html

@@ -0,0 +1,65 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+        <!-- operation start -->
+        <div class="am-g">
+            <a href="{{:U('Admin/Power/RoleSaveInfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> {{:L('common_operation_add')}}</a>
+        </div>
+        <!-- operation end -->
+
+        <!-- list start -->
+		<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10 role-list">
+			<thead>
+				<tr>
+					<th>{{:L('common_view_name_title')}}</th>
+					<th>{{:L('common_view_state_title')}}</th>
+					<th>{{:L('power_view_have_title')}}</th>
+					<th class="am-hide-sm-only">{{:L('common_create_time_name')}}</th>
+					<th>{{:L('common_operation_name')}}</th>
+				</tr>
+			</thead>
+			<tbody>
+				<if condition="!empty($list)">
+					<foreach name="list" item="v">
+						<tr id="data-list-{{$v.id}}" <if condition="$v['is_enable'] eq 0">class="am-active"</if>>
+							<td>{{$v.name}}</td>
+							<td>
+								<span <if condition="$v['is_enable'] eq 0">class="cr-ccc"</if>>{{:L('common_is_enable_tips')[$v['is_enable']]['name']}}</span>
+							</td>
+							<td class="power-text">
+								<if condition="!empty($v['item'])">
+									<foreach name="v.item" item="vs">
+										<span class="am-badge {{:L('common_color_list')[rand(0, 5)]}} am-round m-r-5">{{$vs.name}}</span>
+									</foreach>
+								</if>
+							</td>
+							<td class="am-hide-sm-only">{{:date('Y-m-d H:i:s', $v['add_time'])}}</td>
+							<td>
+								<if condition="$v['id'] eq 1">
+									<span class="cr-ccc">{{:L('common_do_not_operate')}}</span>
+								<else />
+									<a href="{{:U('Admin/Power/RoleSaveInfo', array('id'=>$v['id']))}}">
+										<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit" data-am-popover="{content: '{{:L('common_operation_edit')}}', trigger: 'hover focus'}"></button>
+									</a>
+									<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:U('Admin/Power/RoleDelete')}}" data-am-popover="{content: '{{:L('common_operation_delete')}}', trigger: 'hover focus'}" data-id="{{$v.id}}"></button>
+								</if>
+							</td>
+						</tr>
+					</foreach>
+				<else />
+					<tr><td colspan="5" class="table-no">{{:L('common_not_data_tips')}}</td></tr>
+				</if>
+			</tbody>
+		</table>
+		<!-- list end -->
+	</div>
+</div>
+<!-- right content end  -->
+		
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end -->

+ 67 - 0
Application/Admin/View/Default/Power/RoleSaveInfo.html

@@ -0,0 +1,67 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+        <!-- form start -->
+        <form class="am-form form-validation view-save" action="{{:U('Admin/Power/RoleSave')}}" method="POST" request-type="ajax-url" request-value="{{:U('Admin/Power/Role')}}">
+        	<legend>
+				<span class="fs-16">
+					<if condition="empty($data['id'])">
+						{{:L('role_add_name')}}
+					<else />
+						{{:L('role_edit_name')}}
+					</if>
+				</span>
+				<a href="{{:U('Admin/Power/Role')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
+			</legend>
+        	<div class="am-form-group">
+				<label>{{:L('role_view_role_text')}}</label>
+				<input type="text" placeholder="{{:L('role_view_role_text')}}" name="name" minlength="2" maxlength="16" data-validation-message="{{:L('role_name_format')}}" class="am-radius" <present name="data"> value="{{$data.name}}"</present> required />
+			</div>
+			<include file="Lib/Enable" />
+			<div class="am-form-group">
+				<label>{{:L('power_view_have_title')}}</label>
+				<ul class="tree-list p-0">
+					<foreach name="power" item="v">
+						<li <if condition="$v['is_show'] eq 0">class="bk-cr-ffd"</if>>
+							<if condition="!empty($v['item'])">
+								<i class="am-icon-minus-square c-p m-r-5"></i>
+								<label class="c-p">
+							<else />
+								<label class="c-p m-l-20">
+							</if>
+								<input type="checkbox" name="power_id" value="{{$v.id}}" class="node-choice" <if condition="$v['is_power'] eq 'ok'">checked</if> />
+								<span>{{$v.name}}</span>
+							</label>
+						</li>
+						<if condition="!empty($v['item'])">
+							<ul class="list-find p-0 m-t-5">
+								<foreach name="v.item" item="vs">
+									<li <if condition="$vs['is_show'] eq 0">class="bk-cr-ffd"</if>>
+										<label class="c-p">
+											<input type="checkbox" name="power_id" value="{{$vs.id}}" <if condition="$vs['is_power'] eq 'ok'">checked</if> />
+											<span>{{$vs.name}}</span>
+										</label>
+									</li>
+								</foreach>
+							</ul>
+						</if>
+					</foreach>
+				</ul>
+			</div>
+			<div class="am-form-group">
+				<input type="hidden" name="id" <present name="data"> value="{{$data.id}}"</present>" />
+				<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>
+			</div>
+		</form>
+		<!-- right form end  -->
+	</div>
+</div>
+<!-- right content end  -->
+		
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end -->

+ 58 - 0
Application/Admin/View/Default/PrizeDefaultV2/Index.html

@@ -0,0 +1,58 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+		<div class="am-g m-t-15">
+            <a href="{{:U('Admin/PrizeDefaultV2/SaveInfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-radius am-btn-xs">增加中奖信息</a>
+        </div>
+		<!-- list start -->
+		<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10">
+			<thead>
+				<tr>
+					<th>序号</th>
+					<th>活动名称</th>
+					<th class="am-hide-sm-only">奖品名称</th>
+					<th class="am-hide-sm-only">uid</th>
+					<th class="am-hide-sm-only">号码</th>
+					<th class="am-hide-sm-only">中奖时间</th>
+					<th>{{:L('common_operation_name')}}</th>
+				</tr>
+			</thead>
+			<tbody>
+				<if condition="!empty($List)">
+					<foreach name="List" item="v">
+						<tr id="data-list-{{$v.id}}">
+							<td class="am-hide-sm-only">{{$key+1}}</td>
+							<td class="am-hide-sm-only">{{$Prizes[$v['act_id']]['activity_name']}}</td>
+							<td class="am-hide-sm-only">{{$Prizes[$v['act_id']]['prize_list'][$v['prize_id']]['prize_name']}}</td>
+							<td class="am-hide-sm-only">{{$v.uid}}</td>
+							<td class="am-hide-sm-only">{{$v.phone}}</td>
+							<td class="am-hide-sm-only">{{$v.prize_date}}</td>
+							<td class="view-operation">
+								<!-- <a href="{{:U('Admin/PrizeSet/SaveInfo', array('id'=>$v['id']))}}">
+									<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit" data-am-popover="{content: '{{:L('common_operation_edit')}}', trigger: 'hover focus'}"></button>
+								</a> -->
+								<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:U('Admin/PrizeDefault/Delete')}}" data-am-popover="{content: '{{:L('common_operation_delete')}}', trigger: 'hover focus'}" data-id="{{$v.id}}"></button>
+							</td>
+						</tr>
+					</foreach>
+				<else />
+					<tr><td colspan="10" class="table-no">{{:L('common_not_data_tips')}}</td></tr>
+				</if>
+			</tbody>
+		</table>
+		<!-- list end -->
+
+		<!-- page start -->
+		<div id="pages" class="p">{{$page}}</div>
+		<!-- page end -->
+	</div>
+</div>
+<!-- right content end  -->
+<script src="__PUBLIC__/Admin/Default/Js/lyz.calendar.min.js" type="text/javascript"></script>
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end

+ 108 - 0
Application/Admin/View/Default/PrizeDefaultV2/SaveInfo.html

@@ -0,0 +1,108 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+<!-- right content start  -->
+<div class="content-right">
+    <div class="content">
+        <!-- form start -->
+        <div id="success" style="color:#fff;display: none;background: limegreen;height: 3rem;text-align: center;"></div>
+        <form class="am-form form-validation view-save" action="{{:U('Admin/PrizeDefaultV2/Save')}}" method="POST" request-type="ajax-reload" enctype="multipart/form-data">
+            <legend>
+                <span class="fs-16">
+                    <if condition="empty($data['id'])">
+                        增加中奖信息
+                        <else />
+                        编辑中奖信息
+                    </if>
+                </span>
+                <a href="{{:U('Admin/PrizeDefaultV2/Index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
+            </legend>
+
+            <div class="am-g">
+                <label>活动绑定</label>
+                <select name="act_id" id="act_id" class="am-radius c-p" required>
+                    <option value="">请绑定活动</option>
+                    <foreach name="Acts" item="v">
+                        <option value="{{$v.id}}" <if condition="isset($data['act_id']) and $data['act_id'] eq $v['id']">selected</if> >{{$v.activity_name}}</option>
+                    </foreach>
+                </select>
+            </div>
+
+            <div class="am-form-group">
+                <label>奖品绑定</label>
+                <select class="form-control input-sm" id="prize_id" name="prize_id" required>
+                    <if condition = "$prizes">
+                        <foreach name="prizes" item ="p">
+                            <option value="{{$p.id}}" <if condition="isset($data['prize_id']) and $data['prize_id'] eq $p['id']">selected</if>>{{$p.prize_name}}</option>
+                        </foreach>
+                        <else/>
+                        <option value="">请先选择活动</option>
+                    </if>	
+                </select>
+            </div>
+            <div class="am-g">
+                <label>UID设定</label>
+                <input type="text" name="uid" placeholder="UID,注意号段" data-validation-message="请填UID,注意号段" class="am-form-field am-radius" required
+                       <notempty name="data"> value="{{$data.uid}}" </notempty>/>
+            </div>
+
+            <div class="am-g">
+                <label>Phone设定</label>
+                <input type="number" name="phone" placeholder="手机号码,注意号段" data-validation-message="请填手机号码,注意号段" class="am-form-field am-radius" required
+                       <notempty name="data"> value="{{$data.phone}}" </notempty>/>
+            </div>
+
+            <div class="am-form-group">
+                <label>中奖日期设定</label> <label><font color="red" id="warning"></font></label>
+                <input type="text" name="prize_date" placeholder="格式 2018-12-18 12:23:33" class="am-form-field am-radius" 
+                       <notempty name="data"> value="{{$data.prize_date}}" </notempty>/>
+            </div>
+
+            <div class="am-form-group" style="padding-top: 2rem">
+                <input type="hidden" name="id" <notempty name="data"> value="{{$data.id}}"</notempty>" />
+                <button class="am-btn am-btn-primary">保存</button>
+            </div>
+        </form>
+        <!-- form end -->
+    </div>
+</div>
+<!-- right content end  -->
+
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end -->
+<script src="__PUBLIC__/Common/Lib/uploader/jquery-1.9.1.min.js" type="text/javascript"></script>
+<script type="text/javascript">
+//two AJAX获取数据方式(每次请求)
+$("#act_id").on("change", function () {
+    var act_id = $("#act_id").val();
+    // console.log(act_id);	
+    $.ajax({
+        url: "{{:U('Admin/PrizeDefaultV2/Search')}}",
+        type: 'POST',
+        dateType: 'JSON',
+        data: {"act_id": act_id},
+        success: function (data) //服务器成功响应处理函数
+        {
+            var obj = jQuery.parseJSON(data);
+//             console.log(obj);     return ;
+            $("#prize_id").html('');
+            var html = '<option value ="">请选择奖品</option>';
+            for (var i = obj.prizes.length - 1; i >= 0; i--) {
+                html += '<option value ="' + obj.prizes[i]['prize_id'] + '">' + obj.prizes[i]['prize_name'] + '</option>';
+            }
+            // console.log(html);
+            $("#prize_id").html(html);
+            
+            var warning = obj.activity['start_at'] + ' 至 ' +obj.activity['end_at'];
+            $('#warning').html(warning);
+        },
+    })
+});
+
+</script>
+<script>
+    jeDate("input[name=prize_date]",{
+        format: "YYYY-MM-DD hh:mm:ss"
+    });
+</script>

+ 90 - 0
Application/Admin/View/Default/PrizeLogV2/Index.html

@@ -0,0 +1,90 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+            <!-- form start -->
+            <form class="am-form view-list" action="{{:U('Admin/PrizeLogV2/Index')}}" method="post">
+                <div class="am-g">
+                    <input type="text" class="am-radius form-keyword" placeholder="用户uid" name="keyword" value="{{$keyword}}" style="display: inline-block;width: 20rem;">
+                    <select name="prize_status" style="display: inline-block;width: 10rem;">
+                            <option value="-1">全部类型</option>
+                            <option value="1" <?php if($prize_status == 1):?>selected<?php endif;?>>中奖</option>
+                            <option value="0" <?php if($prize_status == 0):?>selected<?php endif;?>>不中奖</option>
+                    </select>
+
+                    <select name="act_id" style="display: inline-block;width: 10rem;">
+                            <option value="">全部活动</option>
+                            <?php foreach($acts as $act):?>
+                            <option value="<?php echo $act['id'];?>" <?php if($act_id == $act['id']):?>selected<?php endif;?>><?php echo $act['activity_name'];?></option>
+                            <?php endforeach;?>
+                    </select>
+                    <if condition="!IsMobile()">
+                         <a href="#" id="export" class="am-btn am-btn-success am-btn-xs m-l-10 am-icon-file-excel-o am-radius"> {{:L('common_operation_excel_export_name')}}</a> 
+                    </if>
+                    <button type="submit" class="am-btn am-btn-secondary am-btn-sm am-radius form-submit">查询</button>
+                </div>
+            </form>
+		<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10">
+                    <thead>
+                        <tr>
+                            <th>ID</th>
+                            <th class="am-hide-sm-only">用户id</th>
+                            <th class="am-hide-sm-only">是否会员</th>
+                            <th class="am-hide-sm-only">奖品名称</th>
+                            <th class="am-hide-sm-only">中奖时间</th>
+                            <th class="am-hide-sm-only">登记号码</th>
+                            <th class="am-hide-sm-only">登记联系人</th>
+                            <th class="am-hide-sm-only">登记地址</th>
+                            <th>{{:L('common_operation_name')}}</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                            <if condition="!empty($List)">
+                                <?php $vip = [0=>'非会员',1=>'会员',2=>'双会员'];?>
+                                <foreach name="List" item="v">
+                                    <tr id="data-list-{{$v.id}}">
+                                        <input type="hidden" value="{{$v.id}}" />
+                                        <td class="am-hide-sm-only">{{$v.id}}</td>
+                                        <td class="am-hide-sm-only">{{$v.uid}}</td>
+                                        <td class="am-hide-sm-only"><?php echo $vip[$v['is_vip']];?></td>
+                                        <td class="am-hide-sm-only">{{$v['prize_name']}}</td>
+                                        <td class="am-hide-sm-only">{{$v.created_at}}</td>
+                                        <td class="am-hide-sm-only"> {{$v['user_phone']}}</td>
+                                        <td class="am-hide-sm-only"> {{$v['receiver']}}</td>
+                                        <td class="am-hide-sm-only"> {{$v['address']}}</td>
+                                        <td class="view-operation">
+                                            <button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:U('Admin/PrizeLogV2/Delete')}}" data-am-popover="{content: '{{:L('common_operation_delete')}}', trigger: 'hover focus'}" data-id="{{$v.id}}"></button>
+                                        </td>
+                                    </tr>
+                                </foreach>
+                            <else />
+                                    <tr><td colspan="10" class="table-no">{{$act_id ? '没有记录':'请先选择活动'}}</td></tr>
+                            </if>
+                    </tbody>
+		</table>
+		<!-- list end -->
+
+		<!-- page start -->
+		<div id="pages" class="p">{{$page}}</div>
+		<!-- page end -->
+	</div>
+</div>
+<!-- right content end  -->
+<script type="text/javascript">
+$("#export").on("click",function(){
+        var keyword = $("input[name=keyword]").val();
+        var prize_status = $("select[name=prize_status]").val();
+        var act_id = $("select[name=act_id]").val();
+        
+        var params = '&keyword='+keyword+'&prize_status='+prize_status+'&act_id='+act_id;
+        var url = 'index.php?m=Admin&c=PrizeLog&a=Index&model=exportExcel'+params;
+//        alert(url);return ;
+        window.open(url);
+});    
+</script>		
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end

+ 126 - 0
Application/Admin/View/Default/PrizeLogV2/SaveInfo.html

@@ -0,0 +1,126 @@
+<!-- header start -->
+<include file="Public/Header" />
+<!-- header end -->
+
+<!-- right content start  -->
+<div class="content-right">
+	<div class="content">
+		<!-- form start -->
+		<div id="success" style="color:#fff;display: none;background: limegreen;height: 3rem;text-align: center;"></div>
+		<form class="am-form form-validation view-save" action="{{:U('Admin/Version/Save')}}" method="POST" request-type="ajax-url" request-value="{{:U('Admin/Version/Index')}}" enctype="multipart/form-data">
+			<legend>
+				<span class="fs-16">
+					<if condition="empty($data['id'])">
+						奖项添加
+					<else />
+						奖项编辑
+					</if>
+				</span>
+				<a href="{{:U('Admin/Version/Index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
+			</legend>
+			<div class="am-form-group">
+				<label>版本名称</label>
+				<div class="am-input-group am-input-group-sm">
+					<input type="text" name="prize_name" placeholder="奖项名称" data-validation-message="请填写奖项名称" class="am-form-field am-radius" 
+					<notempty name="data"> value="{{$data.prize_name}}" </notempty>/>
+				</div>
+			</div>
+			<div class="am-form-group">
+				<label>中奖份额</label>
+				<div class="am-input-group am-input-group-sm">
+					<input type="number" name="prize_num" placeholder="中奖份额" class="am-form-field am-radius" 
+					<notempty name="data"> value="{{$data.prize_num}}" </notempty>/>
+				</div>
+			</div>
+			<div class="am-form-group">
+				<label>宣传图片</label>
+                <div class="am-input-group am-input-group-sm">
+                    <input type="file" style="border: hidden;"   id="file1" name='file' placeholder="上传图片" class="am-form-field am-radius" />
+                    <input type="hidden" class="prize_img" name="prize_img" value="{{$data.prize_img}}" />
+                    <p><img id="img1" alt="上传成功啦" src="{{$data.prize_img}}" /></p>
+                </div>
+			</div>	
+			<div class="am-form-group" style="padding-top: 2rem">
+				<input type="hidden" name="id" <notempty name="data"> value="{{$data.id}}"</notempty>" />
+				<div data-id = "1" class="bt" style="display:inline-block;margin-right:3rem;width: 20rem;height: 3rem;text-align: center;padding: 0.5rem;border: 0.1rem solid black;border-radius: 0.3rem;background: blue;color: #fff;cursor: pointer;">保存</div>
+				<!--<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>-->
+			</div>
+		</form>
+        <!-- form end -->
+	</div>
+</div>
+<!-- right content end  -->
+
+<!-- footer start -->
+<include file="Public/Footer" />
+<!-- footer end -->
+<script src="__PUBLIC__/Common/Lib/uploader/jquery-1.9.1.min.js" type="text/javascript"></script>
+<script src="__PUBLIC__/Common/Lib/uploader/ajaxfileupload.js" type="text/javascript"></script>
+<script type="text/javascript">
+$(function() {
+	$("#file1").change(function() {
+        ajaxFileUpload();
+    })
+    $('.bt').click(function(){
+    	var prize_name = $("input[name='prize_name']").val();
+    	if(prize_name == ''){
+    		$('#success').html('请填写奖项名称');
+			$('#success').css('display','block')
+    		window.setTimeout("$('#success').css('display','none')", 2000);
+    		return false;
+    	}
+    	var prize_num = $("input[name='prize_num']").val();
+    	if(prize_num == ''){
+    		$('#success').html('请填写中奖份额');
+			$('#success').css('display','block')
+    		window.setTimeout("$('#success').css('display','none')", 2000);
+    		return false;
+    	}
+    	var prize_img = $("input[name='prize_img']").val();
+    	var id = $("input[name='id']").val();
+    	if(id.length>0){
+	        	id = id;
+	        }else{
+	        	id = -2;
+	        }
+    	$.ajax({
+	        type: "POST", //提交方式  
+	        url: "{{:U('Admin/Prize/Save')}}", //路径  
+	        data: {"prize_name":prize_name,"prize_num":prize_num,"id":id,"prize_img":prize_img},
+	        success: function(result) {//返回数据根据结果进行相应的处理
+	        	if(result == 100){
+	        		$('#success').html('保存成功');
+					$('#success').css('display','block')
+	        		window.setTimeout("location.href = '{{:U('Admin/Prize/Index')}}'", 1000);
+	        	}else if(result == -100){
+	        		alert('保存失败!');
+	        	}
+	        }
+    	});
+    })
+    
+})
+function ajaxFileUpload() {
+    $.ajaxFileUpload
+        (
+            {
+                url: '{{:U('Admin/Source/Uploader')}}', //用于文件上传的服务器端请求地址
+                secureuri: false, //是否需要安全协议,一般设置为false
+                fileElementId: 'file1', //文件上传域的ID
+                dataType: 'text', //返回值类型 一般设置为json
+                success: function(data, status) //服务器成功响应处理函数
+                {
+                    data =  eval('(' + data + ')');
+                    $(".prize_img").attr("value", data.imgurl);
+                    $("#img1").attr("src", data.imgurl);
+                    
+                },
+                error: function(data, status, e)//服务器响应失败处理函数
+                {
+                    alert(status);
+                }
+            }
+        )
+    return false;
+}
+</script>

+ 11 - 0
Application/Admin/View/Default/Public/Common.html

@@ -0,0 +1,11 @@
+<!-- delete html start -->
+<div class="am-modal am-modal-confirm" tabindex="-1" id="common-confirm-delete">
+	<div class="am-modal-dialog am-radius">
+		<div class="am-modal-bd">{{:L('common_delete_tips')}}</div>
+		<div class="am-modal-footer">
+			<span class="am-modal-btn" data-am-modal-cancel>{{:L('common_operation_cancel')}}</span>
+			<span class="am-modal-btn" data-am-modal-confirm>{{:L('common_operation_confirm')}}</span>
+		</div>
+	</div>
+</div>
+<!-- delete html end -->

+ 33 - 0
Application/Admin/View/Default/Public/Footer.html

@@ -0,0 +1,33 @@
+<!-- commom html start -->
+<include file="Public/Common" />
+<!-- commom html end -->
+</body>
+</html>
+
+<!-- 类库 -->
+<js href="__PUBLIC__/Common/Lib/jquery/jquery-2.1.0.js" />
+<js href="__PUBLIC__/Common/Lib/assets/js/amazeui.min.js" />
+<js href="__PUBLIC__/Common/Lib/echarts/echarts.min.js" />
+
+<!-- ueditor 编辑器 -->
+<js href="__PUBLIC__/Common/Lib/ueditor/ueditor.config.js" />
+<js href="__PUBLIC__/Common/Lib/ueditor/ueditor.all.min.js" />
+<js href="__PUBLIC__/Common/Lib/ueditor/lang/zh-cn/zh-cn.js" />
+
+<!-- 颜色选择器 -->
+<js href="__PUBLIC__/Common/Lib/colorpicker/jquery.colorpicker.js" />
+
+<!-- 元素拖拽排序插件 -->
+<js href="__PUBLIC__/Common/Lib/dragsort/jquery.dragsort-0.5.2.min.js" />
+
+<!-- amazeui插件 -->
+<js href="__PUBLIC__/Common/Lib/amazeui-switch/amazeui.switch.min.js" />
+<js href="__PUBLIC__/Common/Lib/amazeui-chosen/amazeui.chosen.min.js" />
+
+<!-- 项目公共 -->
+<js href="__PUBLIC__/Common/Js/Common.js" />
+
+<!-- 控制器 -->
+<if condition="!empty($module_js)">
+	<js href="__PUBLIC__/{{$module_js}}" />
+</if>

+ 0 - 0
Application/Admin/View/Default/Public/Header.html


Неке датотеке нису приказане због велике количине промена