magicblack 5 tahun lalu
melakukan
e33b27f464
100 mengubah file dengan 14820 tambahan dan 0 penghapusan
  1. 201 0
      LICENSE
  2. 16 0
      README.md
  3. 44 0
      addons/adminloginbg/Adminloginbg.php
  4. 37 0
      addons/adminloginbg/config.php
  5. 16 0
      addons/adminloginbg/controller/Index.php
  6. 8 0
      addons/adminloginbg/info.ini
  7. 43 0
      admin.php
  8. 41 0
      api.php
  9. 1 0
      application/.htaccess
  10. 276 0
      application/admin/common/auth.php
  11. 147 0
      application/admin/controller/Actor.php
  12. 344 0
      application/admin/controller/Addon.php
  13. 138 0
      application/admin/controller/Admin.php
  14. 297 0
      application/admin/controller/Art.php
  15. 109 0
      application/admin/controller/Base.php
  16. 127 0
      application/admin/controller/Card.php
  17. 81 0
      application/admin/controller/Cash.php
  18. 525 0
      application/admin/controller/Cj.php
  19. 465 0
      application/admin/controller/Collect.php
  20. 119 0
      application/admin/controller/Comment.php
  21. 296 0
      application/admin/controller/Database.php
  22. 120 0
      application/admin/controller/Domain.php
  23. 119 0
      application/admin/controller/Gbook.php
  24. 109 0
      application/admin/controller/Group.php
  25. 310 0
      application/admin/controller/Images.php
  26. 221 0
      application/admin/controller/Index.php
  27. 101 0
      application/admin/controller/Link.php
  28. 910 0
      application/admin/controller/Make.php
  29. 71 0
      application/admin/controller/Order.php
  30. 61 0
      application/admin/controller/Plog.php
  31. 146 0
      application/admin/controller/Role.php
  32. 645 0
      application/admin/controller/System.php
  33. 229 0
      application/admin/controller/Template.php
  34. 79 0
      application/admin/controller/Timming.php
  35. 112 0
      application/admin/controller/Topic.php
  36. 261 0
      application/admin/controller/Type.php
  37. 64 0
      application/admin/controller/Ulog.php
  38. 165 0
      application/admin/controller/Update.php
  39. 305 0
      application/admin/controller/Upload.php
  40. 340 0
      application/admin/controller/Urlsend.php
  41. 204 0
      application/admin/controller/User.php
  42. 76 0
      application/admin/controller/Visit.php
  43. 521 0
      application/admin/controller/Vod.php
  44. 86 0
      application/admin/controller/Voddowner.php
  45. 155 0
      application/admin/controller/Vodplayer.php
  46. 86 0
      application/admin/controller/Vodserver.php
  47. 298 0
      application/admin/controller/Website.php
  48. 154 0
      application/admin/view/actor/index.html
  49. 386 0
      application/admin/view/actor/info.html
  50. 157 0
      application/admin/view/addon/config.html
  51. 156 0
      application/admin/view/addon/index.html
  52. 10 0
      application/admin/view/addon/info.html
  53. 80 0
      application/admin/view/admin/index.html
  54. 145 0
      application/admin/view/admin/info.html
  55. 165 0
      application/admin/view/art/batch.html
  56. 169 0
      application/admin/view/art/index.html
  57. 482 0
      application/admin/view/art/info.html
  58. 118 0
      application/admin/view/card/index.html
  59. 83 0
      application/admin/view/card/info.html
  60. 102 0
      application/admin/view/cash/index.html
  61. 10 0
      application/admin/view/cj/col_content.html
  62. 43 0
      application/admin/view/cj/col_url.html
  63. 79 0
      application/admin/view/cj/index.html
  64. 415 0
      application/admin/view/cj/info.html
  65. 49 0
      application/admin/view/cj/program.html
  66. 83 0
      application/admin/view/cj/publish.html
  67. 29 0
      application/admin/view/cj/show_url.html
  68. 122 0
      application/admin/view/collect/actor.html
  69. 128 0
      application/admin/view/collect/art.html
  70. 71 0
      application/admin/view/collect/index.html
  71. 140 0
      application/admin/view/collect/info.html
  72. 122 0
      application/admin/view/collect/role.html
  73. 153 0
      application/admin/view/collect/timing.html
  74. 31 0
      application/admin/view/collect/union.html
  75. 128 0
      application/admin/view/collect/vod.html
  76. 122 0
      application/admin/view/collect/website.html
  77. 134 0
      application/admin/view/comment/index.html
  78. 71 0
      application/admin/view/comment/info.html
  79. 68 0
      application/admin/view/database/export.html
  80. 59 0
      application/admin/view/database/import.html
  81. 133 0
      application/admin/view/database/rep.html
  82. 60 0
      application/admin/view/database/sql.html
  83. 119 0
      application/admin/view/domain/index.html
  84. 27 0
      application/admin/view/extend/pay/alipay.html
  85. 33 0
      application/admin/view/extend/pay/codepay.html
  86. 26 0
      application/admin/view/extend/pay/weixin.html
  87. 33 0
      application/admin/view/extend/pay/zhapay.html
  88. 9 0
      application/admin/view/extend/upload/alibaba.html
  89. 32 0
      application/admin/view/extend/upload/ftp.html
  90. 24 0
      application/admin/view/extend/upload/qiniu.html
  91. 28 0
      application/admin/view/extend/upload/uomg.html
  92. 24 0
      application/admin/view/extend/upload/upyun.html
  93. 37 0
      application/admin/view/extend/upload/weibo.html
  94. 122 0
      application/admin/view/gbook/index.html
  95. 67 0
      application/admin/view/gbook/info.html
  96. 78 0
      application/admin/view/group/index.html
  97. 137 0
      application/admin/view/group/info.html
  98. 56 0
      application/admin/view/images/index.html
  99. 75 0
      application/admin/view/images/opt.html
  100. 311 0
      application/admin/view/index/index.html

+ 201 - 0
LICENSE

@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

+ 16 - 0
README.md

@@ -0,0 +1,16 @@
+## 苹果cms-v10
+
+苹果CMS程序是一套采用PHP+MYSQL环境下运行的完善而强大的快速建站系统。经过近多年的开发经验和技术积累,苹果CMS程序已逐步走向成熟,在易用性和功能上已经成为同行中的佼佼者。程序体积小->优化程序代码,运行速度快->高效的缓存处理,只要普通的虚拟主机就可以完美搭建起来,建站成本非常低。仿MVC模板分离,内置标签,自定义函数标签接口,强大的自定义采集功能,只要你会HTML就可以轻松做出个性化的网站。 程序易用性和功能上一直以来都积极采纳广大站长提出的各种好的建议,迅速响应各种紧急问题,我们的服务理念贯穿其中,保证每一位站长每一个环节都可以从容应对。v10采用tp5.x内核进行开发,扩展了模板处理引擎,将后台程序与html模板简单的分离出来,让设计人员与程序人员最大限度的发挥自己的优势而互不干扰,大大加快了项目有序、快速的完成。即使您是第一次接触,也会在最短的时间内熟练掌握它的使用方法。后台管理模块,一目了然,操作简单,绝对不会让您眼花缭乱。
+
+## 免责声明
+
+本程序仅供内部学习和交流使用,没有内置任何数据和采集资源,请在遵守当地法律的前提下使用本站程序,对用户在使用过程中的自行维护的信息内容本站不负任何责任!
+
+对于使用网路上出现的盗版程序,本站将保留追究其法律的责任,出现任何问题本站概不负责!
+
+倡导富强、民主、文明、和谐,倡导、平等、公正、法治,倡导爱、敬业、信、友善,积极培育和践行社会主义核心价值观。
+
+
+## 特别鸣谢
+
+特别感谢又拍云长期以来提供存储、CDN、HTTPS访问服务的赞助!!!

+ 44 - 0
addons/adminloginbg/Adminloginbg.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace addons\adminloginbg;
+
+use think\Addons;
+
+/**
+ * 登录背景图插件
+ */
+class Adminloginbg extends Addons
+{
+
+    /**
+     * 插件安装方法
+     * @return bool
+     */
+    public function install()
+    {
+        return true;
+    }
+
+    /**
+     * 插件卸载方法
+     * @return bool
+     */
+    public function uninstall()
+    {
+        return true;
+    }
+
+    public function adminLoginInit(\think\Request &$request)
+    {
+        $config = $this->getConfig();
+        if ($config['mode'] == 'random' || $config['mode'] == 'daily') {
+            $index = $config['mode'] == 'random' ? mt_rand(1, 4000) : date("Ymd") % 4000;
+            $background = "http://img.infinitynewtab.com/wallpaper/" . $index . ".jpg";
+        }
+        else {
+            $background = $config['image'];
+        }
+        \think\View::instance()->assign('background', $background);
+    }
+
+}

+ 37 - 0
addons/adminloginbg/config.php

@@ -0,0 +1,37 @@
+<?php
+
+return array (
+  0 => 
+  array (
+    'name' => 'mode',
+    'title' => '模式',
+    'type' => 'radio',
+    'content' => 
+    array (
+      'fixed' => '固定',
+      'random' => '每次随机',
+      'daily' => '每日切换',
+    ),
+    'value' => 'random',
+    'rule' => 'required',
+    'msg' => '',
+    'tip' => '根据自身爱好选择',
+    'ok' => '',
+    'extend' => '',
+  ),
+  1 => 
+  array (
+    'name' => 'image',
+    'title' => '固定背景图',
+    'type' => 'image',
+    'content' => 
+    array (
+    ),
+    'value' => 'upload/addon/20180419/60766c894977757d436b641f97356b40.jpg',
+    'rule' => 'required',
+    'msg' => '',
+    'tip' => '请选择文件...',
+    'ok' => '',
+    'extend' => '',
+  ),
+);

+ 16 - 0
addons/adminloginbg/controller/Index.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace addons\adminloginbg\controller;
+
+use think\addons\Controller;
+
+class Index extends Controller
+{
+
+    public function index()
+    {
+        $this->error("当前插件暂无前台页面");
+    }
+
+}
+

+ 8 - 0
addons/adminloginbg/info.ini

@@ -0,0 +1,8 @@
+name = adminloginbg
+title = 后台登录背景图
+intro = 可自定义后台登录背景图
+author = MagicBlack
+website = http://www.maccms.la
+version = 1.0.0
+state = 0
+url = /admin.php/addons/adminloginbg.html

+ 43 - 0
admin.php

@@ -0,0 +1,43 @@
+<?php
+/*
+'软件名称:苹果CMS  官方网站:http://www.maccms.la/  源码库:https://github.com/magicblack
+'--------------------------------------------------------
+'Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+'遵循Apache2开源协议发布,并提供免费使用。
+'--------------------------------------------------------
+*/
+header('Content-Type:text/html;charset=utf-8');
+// 检测PHP环境
+if(version_compare(PHP_VERSION,'5.5.0','<'))  die('PHP版本过低,最少需要PHP5.5,请升级PHP版本!');
+//超时时间
+@ini_set('max_execution_time', '0');
+//内存限制 取消内存限制
+@ini_set("memory_limit",'-1');
+// 定义应用目录
+define('ROOT_PATH', __DIR__ . '/');
+define('APP_PATH', __DIR__ . '/application/');
+define('MAC_COMM', __DIR__.'/application/common/common/');
+define('MAC_HOME_COMM', __DIR__.'/application/index/common/');
+define('MAC_ADMIN_COMM', __DIR__.'/application/admin/common/');
+define('MAC_START_TIME', microtime(true) );
+//define('BIND_MODULE','admin');
+define('ENTRANCE', 'admin');
+$in_file = rtrim($_SERVER['SCRIPT_NAME'],'/');
+if(substr($in_file,strlen($in_file)-4)!=='.php'){
+    $in_file = substr($in_file,0,strpos($in_file,'.php')) .'.php';
+}
+define('IN_FILE',$in_file);
+
+if(!is_file('./application/data/install/install.lock')) {
+    header("Location: ./install.php");
+    exit;
+}
+if(strpos($_SERVER["SCRIPT_NAME"],'/admin.php')!==false){
+    echo '请将后台入口文件admin.php改名,避免被黑客入侵攻击';
+    exit;
+}
+if (!@mb_check_encoding($_SERVER['PATH_INFO'], 'utf-8')){
+    $_SERVER['PATH_INFO']=@mb_convert_encoding($_SERVER['PATH_INFO'], 'UTF-8', 'GBK');
+}
+// 加载框架引导文件
+require __DIR__ . '/thinkphp/start.php';

+ 41 - 0
api.php

@@ -0,0 +1,41 @@
+<?php
+/*
+'软件名称:苹果CMS  官方网站:http://www.maccms.la/  源码库:https://github.com/magicblack
+'--------------------------------------------------------
+'Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+'遵循Apache2开源协议发布,并提供免费使用。
+'--------------------------------------------------------
+*/
+header('Content-Type:text/html;charset=utf-8');
+// 检测PHP环境
+if(version_compare(PHP_VERSION,'5.5.0','<'))  die('PHP版本过低,最少需要PHP5.5,请升级PHP版本!');
+//超时时间
+@ini_set('max_execution_time', '0');
+//内存限制 取消内存限制
+@ini_set("memory_limit",'-1');
+// 定义应用目录
+define('ROOT_PATH', __DIR__ . '/');
+define('APP_PATH', __DIR__ . '/application/');
+define('MAC_COMM', __DIR__.'/application/common/common/');
+define('MAC_HOME_COMM', __DIR__.'/application/index/common/');
+define('MAC_ADMIN_COMM', __DIR__.'/application/admin/common/');
+define('MAC_START_TIME', microtime(true) );
+define('BIND_MODULE','api');
+define('ENTRANCE', 'api');
+$in_file = rtrim($_SERVER['SCRIPT_NAME'],'/');
+if(substr($in_file,strlen($in_file)-4)!=='.php'){
+    $in_file = substr($in_file,0,strpos($in_file,'.php')) .'.php';
+}
+define('IN_FILE',$in_file);
+
+if(!is_file('./application/data/install/install.lock')) {
+    header("Location: ./install.php");
+    exit;
+}
+if (!@mb_check_encoding($_SERVER['PATH_INFO'], 'utf-8')){
+    $_SERVER['PATH_INFO']=@mb_convert_encoding($_SERVER['PATH_INFO'], 'UTF-8', 'GBK');
+}
+// 加载框架引导文件
+require __DIR__ . '/thinkphp/start.php';
+
+

+ 1 - 0
application/.htaccess

@@ -0,0 +1 @@
+deny from all

+ 276 - 0
application/admin/common/auth.php

@@ -0,0 +1,276 @@
+<?php
+return array(
+
+    '1' => array('name' => '首页', 'icon' => 'xe625', 'sub' => array(
+        '11' => array("show"=>1,"name" => '欢迎页面', 'controller' => 'index', 'action' => 'welcome'),
+        '12' => array("show"=>1,"name" => '自定义菜单配置', 'controller' => 'index', 'action' => 'quickmenu'),
+
+        '1001' => array("show"=>0,"name" => '--切换布局', 'controller' => 'index', 'action' => 'iframe'),
+        '1002' => array("show"=>0,"name" => '--清理缓存', 'controller' => 'index', 'action' => 'clear'),
+        '1003' => array("show"=>0,"name" => '--锁屏解锁', 'controller' => 'index', 'action' => 'unlocked'),
+
+        '1004' => array("show"=>0,"name" => '--公共下拉选择框', 'controller' => 'index', 'action' => 'select'),
+        '1005' => array("show"=>0,"name" => '--文件上传', 'controller' => 'upload', 'action' => 'upload'),
+
+    )),
+
+    '2' => array('name' => '系统', 'icon' => 'xe62e', 'sub' => array(
+        '21' => array("show"=>1,'name' => '网站参数配置', 'controller' => 'system',				'action' => 'config'),
+        '210' => array("show"=>1,"name" => 'SEO参数配置', 'controller' => 'system',			'action' => 'configseo'),
+        '211' => array("show"=>1,"name" => '会员参数配置', 'controller' => 'system',			'action' => 'configuser'),
+        '212' => array("show"=>1,"name" => '评论留言配置', 'controller' => 'system',			'action' => 'configcomment'),
+        '213' => array("show"=>1,"name" => '附件参数配置', 'controller' => 'system',			'action' => 'configupload'),
+        '22' => array("show"=>1,"name" => 'URL地址配置', 'controller' => 'system',				'action' => 'configurl'),
+        '23' => array("show"=>1,"name" => '播放器参数配置', 'controller' => 'system',			'action' => 'configplay'),
+        '24' => array("show"=>1,"name" => '采集参数配置', 'controller' => 'system',			'action' => 'configcollect'),
+        '25' => array("show"=>1,"name" => '站外入库配置', 'controller' => 'system',			'action' => 'configinterface'),
+        '26' => array("show"=>1,"name" => '开放API配置', 'controller' => 'system',			'action' => 'configapi'),
+        '27' => array("show"=>1,"name" => '整合登录配置', 'controller' => 'system',			'action' => 'configconnect'),
+        '28' => array("show"=>1,"name" => '在线支付配置', 'controller' => 'system',			'action' => 'configpay'),
+        '29' => array("show"=>1,"name" => '微信对接配置', 'controller' => 'system',			'action' => 'configweixin'),
+        '291' => array("show"=>1,"name" => '邮件发送配置', 'controller' => 'system',			'action' => 'configemail'),
+        '292' => array("show"=>1,"name" => '短信发送配置', 'controller' => 'system',			'action' => 'configsms'),
+
+        '2910' => array("show"=>1,"name" => '定时任务配置', 'controller' => 'timming',	'action' => 'index'),
+        '2911' => array("show"=>0,'name' => '--定时任务信息维护', 'controller' => 'timming',		'action' => 'info'),
+        '2912' => array("show"=>0,'name' => '--定时任务删除', 'controller' => 'timming',		'action' => 'del'),
+        '2913' => array("show"=>0,'name' => '--定时任务状态', 'controller' => 'timming',		'action' => 'field'),
+
+        '2920' => array("show"=>1,"name" => '站群配置', 'controller' => 'domain',	'action' => 'index'),
+        '2922' => array("show"=>0,'name' => '--站群删除', 'controller' => 'domain',		'action' => 'del'),
+        '2923' => array("show"=>0,'name' => '--站群导出', 'controller' => 'domain',		'action' => 'export'),
+        '2924' => array("show"=>0,'name' => '--站群导入', 'controller' => 'domain',		'action' => 'import'),
+    )),
+
+    '3' => array('name' => '基础', 'icon' => 'xe64b', 'sub' => array(
+        '31' => array("show"=>1,'name' => '分类管理', 'controller' => 'type',		'action' => 'index'),
+
+        '3101' => array("show"=>0,'name' => '--分类信息维护', 'controller' => 'type',		'action' => 'info'),
+        '3102' => array("show"=>0,'name' => '--分类批量修改', 'controller' => 'type',		'action' => 'batch'),
+        '3103' => array("show"=>0,'name' => '--分类删除', 'controller' => 'type',		'action' => 'del'),
+        '3104' => array("show"=>0,'name' => '--分类状态', 'controller' => 'type',		'action' => 'field'),
+        '3105' => array("show"=>0,'name' => '--分类扩展配置信息', 'controller' => 'type',		'action' => 'extend'),
+
+
+        '32' => array("show"=>1,'name' => '专题管理', 'controller' => 'topic',		'action' => 'data'),
+        '3201' => array("show"=>0,'name' => '--专题信息维护', 'controller' => 'topic',		'action' => 'info'),
+        '3202' => array("show"=>0,'name' => '--专题批量修改', 'controller' => 'topic',		'action' => 'batch'),
+        '3203' => array("show"=>0,'name' => '--专题删除', 'controller' => 'topic',		'action' => 'del'),
+        '3204' => array("show"=>0,'name' => '--专题状态', 'controller' => 'topic',		'action' => 'field'),
+
+        '33' => array("show"=>1,'name' => '友链管理', 'controller' => 'link',		'action' => 'index'),
+        '3301' => array("show"=>0,'name' => '--友链信息维护', 'controller' => 'link',		'action' => 'info'),
+        '3302' => array("show"=>0,'name' => '--友链批量修改', 'controller' => 'link',		'action' => 'batch'),
+        '3303' => array("show"=>0,'name' => '--友链删除', 'controller' => 'link',		'action' => 'del'),
+        '3304' => array("show"=>0,'name' => '--友链状态', 'controller' => 'link',		'action' => 'field'),
+
+
+        '34' => array("show"=>1,'name' => '留言管理', 'controller' => 'gbook',		'action' => 'data'),
+        '3401' => array("show"=>0,'name' => '--留言信息维护', 'controller' => 'gbook',		'action' => 'info'),
+        '3402' => array("show"=>0,'name' => '--留言删除', 'controller' => 'gbook',		'action' => 'del'),
+        '3404' => array("show"=>0,'name' => '--留言状态', 'controller' => 'gbook',		'action' => 'field'),
+
+        '35' => array("show"=>1,'name' => '评论管理', 'controller' => 'comment',		'action' => 'data'),
+        '3501' => array("show"=>0,'name' => '--评论信息维护', 'controller' => 'comment',		'action' => 'info'),
+        '3502' => array("show"=>0,'name' => '--评论删除', 'controller' => 'comment',		'action' => 'del'),
+        '3504' => array("show"=>0,'name' => '--评论状态', 'controller' => 'comment',		'action' => 'field'),
+
+        '36' => array("show"=>1,'name' => '附件管理', 'controller' => 'images',		'action' => 'index'),
+        '3601' => array("show"=>0,'name' => '--附件删除', 'controller' => 'images',		'action' => 'del'),
+        '3602' => array("show"=>0,'name' => '--同步图片选项', 'controller' => 'images',		'action' => 'opt'),
+        '3603' => array("show"=>0,'name' => '--同步图片方法', 'controller' => 'images',		'action' => 'sync'),
+    )),
+
+    '5' => array('name' => '文章', 'icon' => 'xe616', 'sub' => array(
+
+        '51' => array("show"=>1,'name' => '文章数据', 'controller' => 'art',		'action' => 'data'),
+        '5101' => array("show"=>0,'name' => '--文章信息维护', 'controller' => 'art',		'action' => 'info'),
+        '5102' => array("show"=>0,'name' => '--文章删除', 'controller' => 'art',		'action' => 'del'),
+        '5103' => array("show"=>0,'name' => '--文章状态', 'controller' => 'art',		'action' => 'field'),
+
+        '52' => array("show"=>1,'name' => '添加文章', 'controller' => 'art',		'action' => 'info'),
+        '53' => array("show"=>1,'name' => '已锁定文章', 'controller' => 'art',		'action' => 'data','param'=>'lock=1'),
+        '54' => array("show"=>1,'name' => '未审核文章', 'controller' => 'art',		'action' => 'data','param'=>'status=0'),
+
+        '59' => array("show"=>1,'name' => '批量操作文章', 'controller' => 'art',		'action' => 'batch'),
+        '591' => array("show"=>1,'name' => '重名文章数据', 'controller' => 'art',		'action' => 'data', 'param'=>'repeat=1'),
+    )),
+
+
+    '4' => array('name' => '视频', 'icon' => 'xe639', 'sub' => array(
+        '41' => array("show"=>1,'name' => '服务器组', 'controller' => 'vodserver',		'action' => 'index'),
+        '4101' => array("show"=>0,'name' => '--服务器组信息维护', 'controller' => 'vodserver',		'action' => 'info'),
+        '4102' => array("show"=>0,'name' => '--服务器组删除', 'controller' => 'vodserver',		'action' => 'del'),
+        '4103' => array("show"=>0,'name' => '--服务器组状态', 'controller' => 'vodserver',		'action' => 'field'),
+
+        '42' => array("show"=>1,'name' => '播放器', 'controller' => 'vodplayer',		'action' => 'index'),
+        '4201' => array("show"=>0,'name' => '--播放器信息维护', 'controller' => 'vodplayer',		'action' => 'info'),
+        '4202' => array("show"=>0,'name' => '--播放器删除', 'controller' => 'vodplayer',		'action' => 'del'),
+        '4203' => array("show"=>0,'name' => '--播放器组状态', 'controller' => 'vodplayer',		'action' => 'field'),
+
+        '43' => array("show"=>1,'name' => '下载器', 'controller' => 'voddowner',		'action' => 'index'),
+        '4301' => array("show"=>0,'name' => '--下载器信息维护', 'controller' => 'voddowner',		'action' => 'info'),
+        '4302' => array("show"=>0,'name' => '--下载器删除', 'controller' => 'voddowner',		'action' => 'del'),
+        '4303' => array("show"=>0,'name' => '--下载器组状态', 'controller' => 'voddowner',		'action' => 'field'),
+
+        '44' => array("show"=>1,'name' => '视频数据', 'controller' => 'vod',		'action' => 'data'),
+        '4401' => array("show"=>0,'name' => '--视频信息维护', 'controller' => 'vod',		'action' => 'info'),
+        '4402' => array("show"=>0,'name' => '--视频删除', 'controller' => 'vod',		'action' => 'del'),
+        '4403' => array("show"=>0,'name' => '--视频状态', 'controller' => 'vod',		'action' => 'field'),
+
+        '45' => array("show"=>1,'name' => '添加视频', 'controller' => 'vod',		'action' => 'info'),
+
+        '46' => array("show"=>1,'name' => '无地址视频', 'controller' => 'vod',		'action' => 'data' , 'param'=>'url=1'),
+        '47' => array("show"=>1,'name' => '已锁定视频', 'controller' => 'vod',		'action' => 'data', 'param'=>'lock=1'),
+        '48' => array("show"=>1,'name' => '未审核视频', 'controller' => 'vod',		'action' => 'data', 'param'=>'status=0'),
+        '481' => array("show"=>1,'name' => '需积分视频', 'controller' => 'vod',		'action' => 'data', 'param'=>'points=1'),
+        '481' => array("show"=>1,'name' => '有分集剧情', 'controller' => 'vod',		'action' => 'data', 'param'=>'plot=1'),
+
+        '49' => array("show"=>1,'name' => '批量操作视频', 'controller' => 'vod',		'action' => 'batch'),
+        '491' => array("show"=>1,'name' => '重名视频数据', 'controller' => 'vod',		'action' => 'data', 'param'=>'repeat=1'),
+
+        '495' => array("show"=>1,'name' => '演员库', 'controller' => 'actor',		'action' => 'data', 'param'=>''),
+        '4951' => array("show"=>0,'name' => '--演员信息维护', 'controller' => 'actor',		'action' => 'info'),
+        '4952' => array("show"=>0,'name' => '--演员删除', 'controller' => 'actor',		'action' => 'del'),
+        '4953' => array("show"=>0,'name' => '--演员状态', 'controller' => 'actor',		'action' => 'field'),
+        '4954' => array("show"=>0,'name' => '添加演员', 'controller' => 'actor',		'action' => 'info'),
+
+        '496' => array("show"=>1,'name' => '角色库', 'controller' => 'role',		'action' => 'data', 'param'=>''),
+        '4961' => array("show"=>0,'name' => '--角色信息维护', 'controller' => 'role',		'action' => 'info'),
+        '4962' => array("show"=>0,'name' => '--角色删除', 'controller' => 'role',		'action' => 'del'),
+        '4963' => array("show"=>0,'name' => '--角色状态', 'controller' => 'role',		'action' => 'field'),
+        '4964' => array("show"=>0,'name' => '添加角色', 'controller' => 'role',		'action' => 'info'),
+    )),
+
+
+    '12' => array('name' => '网址', 'icon' => 'xe616', 'sub' => array(
+
+        '121' => array("show"=>1,'name' => '网址数据', 'controller' => 'website',		'action' => 'data'),
+        '12101' => array("show"=>0,'name' => '--网址信息维护', 'controller' => 'website',		'action' => 'info'),
+        '12102' => array("show"=>0,'name' => '--网址删除', 'controller' => 'website',		'action' => 'del'),
+        '12103' => array("show"=>0,'name' => '--网址状态', 'controller' => 'website',		'action' => 'field'),
+
+        '122' => array("show"=>1,'name' => '添加网址', 'controller' => 'website',		'action' => 'info'),
+        '123' => array("show"=>1,'name' => '已锁定网址', 'controller' => 'website',		'action' => 'data','param'=>'lock=1'),
+        '124' => array("show"=>1,'name' => '未审核网址', 'controller' => 'website',		'action' => 'data','param'=>'status=0'),
+
+        '129' => array("show"=>1,'name' => '批量操作网址', 'controller' => 'website',		'action' => 'batch'),
+        '1291' => array("show"=>1,'name' => '重名网址数据', 'controller' => 'website',		'action' => 'data', 'param'=>'repeat=1'),
+    )),
+
+    '6' => array('name' => '用户', 'icon' => 'xe62c', 'sub' => array(
+        '61' => array("show"=>1,'name' => '管理员', 'controller' => 'admin',		'action' => 'index'),
+        '6101' => array("show"=>0,'name' => '--管理员信息维护', 'controller' => 'admin',		'action' => 'info'),
+        '6102' => array("show"=>0,'name' => '--管理员删除', 'controller' => 'admin',		'action' => 'del'),
+        '6103' => array("show"=>0,'name' => '--管理员状态', 'controller' => 'admin',		'action' => 'field'),
+
+        '62' => array("show"=>1,'name' => '会员组', 'controller' => 'group',		'action' => 'index'),
+        '6201' => array("show"=>0,'name' => '--会员组信息维护', 'controller' => 'group',		'action' => 'info'),
+        '6202' => array("show"=>0,'name' => '--会员组删除', 'controller' => 'group',		'action' => 'del'),
+        '6203' => array("show"=>0,'name' => '--会员组状态', 'controller' => 'group',		'action' => 'field'),
+
+        '63' => array("show"=>1,'name' => '会员', 'controller' => 'user',		'action' => 'data'),
+        '6301' => array("show"=>0,'name' => '--会员信息维护', 'controller' => 'user',		'action' => 'info'),
+        '6302' => array("show"=>0,'name' => '--会员删除', 'controller' => 'user',		'action' => 'del'),
+        '6303' => array("show"=>0,'name' => '--会员状态', 'controller' => 'user',		'action' => 'field'),
+
+        '64' => array("show"=>1,'name' => '充值卡', 'controller' => 'card',		'action' => 'index'),
+        '6401' => array("show"=>0,'name' => '--充值卡信息维护', 'controller' => 'card',		'action' => 'info'),
+        '6402' => array("show"=>0,'name' => '--充值卡删除', 'controller' => 'card',		'action' => 'del'),
+
+        '65' => array("show"=>1,'name' => '会员订单', 'controller' => 'order',		'action' => 'index'),
+        '6501' => array("show"=>0,'name' => '--订单删除', 'controller' => 'order',		'action' => 'del'),
+
+        '66' => array("show"=>1,'name' => '访问日志', 'controller' => 'ulog',		'action' => 'index'),
+        '6601' => array("show"=>0,'name' => '--访问日志删除', 'controller' => 'ulog',		'action' => 'del'),
+
+        '67' => array("show"=>1,'name' => '积分日志', 'controller' => 'plog',		'action' => 'index'),
+        '6701' => array("show"=>0,'name' => '--积分日志删除', 'controller' => 'plog',		'action' => 'del'),
+
+        '68' => array("show"=>1,'name' => '提现记录', 'controller' => 'cash',		'action' => 'index'),
+        '6801' => array("show"=>0,'name' => '--提现删除', 'controller' => 'cash',		'action' => 'del'),
+        '6802' => array("show"=>0,'name' => '--提现审核', 'controller' => 'cash',		'action' => 'audit'),
+
+    )),
+
+    '7' => array('name' => '模版', 'icon' => 'xe72d', 'sub' => array(
+        '71' => array("show"=>1,'name' => '模板管理', 'controller' => 'template',		'action' => 'index'),
+        '7101' => array("show"=>0,'name' => '--模板信息维护', 'controller' => 'template',		'action' => 'info'),
+        '7102' => array("show"=>0,'name' => '--模板删除', 'controller' => 'template',		'action' => 'del'),
+
+        '72' => array("show"=>1,'name' => '广告位管理', 'controller' => 'template',		'action' => 'ads',  'param'=>''),
+        '73' => array("show"=>1,'name' => '标签向导', 'controller' => 'template',		'action' => 'wizard'),
+    )),
+
+    '8' => array('name' => '生成', 'icon' => 'xe63e', 'sub' => array(
+        '81' => array("show"=>1,'name' => '生成选项', 'controller' => 'make',		'action' => 'opt'),
+        '82' => array("show"=>1,'name' => '生成首页', 'controller' => 'make',		'action' => 'index'),
+                '83' => array("show"=>1,'name' => '生成地图', 'controller' => 'make',		'action' => 'map'),
+
+
+        '8101' => array("show"=>0,'name' => '--生成入口', 'controller' => 'make',		'action' => 'make'),
+        '8102' => array("show"=>0,'name' => '--生成RSS', 'controller' => 'make',		'action' => 'rss'),
+        '8103' => array("show"=>0,'name' => '--生成分类', 'controller' => 'make',		'action' => 'type'),
+        '8104' => array("show"=>0,'name' => '--生成专题首页', 'controller' => 'make',		'action' => 'topic_index'),
+        '8105' => array("show"=>0,'name' => '--生成专题内容', 'controller' => 'make',		'action' => 'topic_info'),
+        '8106' => array("show"=>0,'name' => '--生成内容页', 'controller' => 'make',		'action' => 'info'),
+        '8107' => array("show"=>0,'name' => '--生成自定义页', 'controller' => 'make',		'action' => 'label'),
+
+
+    )),
+
+    '9' => array('name' => '采集', 'icon' => 'xe727', 'sub' => array(
+        '91' => array("show"=>0,'name' => '推荐资源', 'controller' => 'collect',		'action' => 'union'),
+        '9101' => array("show"=>0,'name' => '--采集入口', 'controller' => 'collect',		'action' => 'api'),
+        '9102' => array("show"=>0,'name' => '--断点采集', 'controller' => 'collect',		'action' => 'load'),
+        '9103' => array("show"=>0,'name' => '--绑定分类', 'controller' => 'collect',		'action' => 'bind'),
+        '9104' => array("show"=>0,'name' => '--采集视频', 'controller' => 'collect',		'action' => 'vod'),
+        '9105' => array("show"=>0,'name' => '--采集文章', 'controller' => 'collect',		'action' => 'art'),
+        '92' => array("show"=>0,'name' => '定时挂机', 'controller' => 'collect',		'action' => 'timing'),
+
+        '93' => array("show"=>1,'name' => '自定义资源', 'controller' => 'collect',		'action' => 'index'),
+        '9301' => array("show"=>0,'name' => '--自定义资源信息维护', 'controller' => 'collect',		'action' => 'info'),
+        '9302' => array("show"=>0,'name' => '--自定义资源删除', 'controller' => 'collect',		'action' => 'del'),
+
+        '94' => array("show"=>1,'name' => '自定义规则', 'controller' => 'cj',		'action' => 'index'),
+        '9401' => array("show"=>0,'name' => '--自定义规则信息维护', 'controller' => 'cj',		'action' => 'info'),
+        '9402' => array("show"=>0,'name' => '--自定义规则删除', 'controller' => 'cj',		'action' => 'del'),
+        '9403' => array("show"=>0,'name' => '--自定义规则发布方案', 'controller' => 'cj',		'action' => 'program'),
+        '9404' => array("show"=>0,'name' => '--自定义规则采集网址', 'controller' => 'cj',		'action' => 'col_url'),
+        '9405' => array("show"=>0,'name' => '--自定义规则采集内容', 'controller' => 'cj',		'action' => 'col_content'),
+        '9406' => array("show"=>0,'name' => '--自定义规则发布内容', 'controller' => 'cj',		'action' => 'publish'),
+        '9407' => array("show"=>0,'name' => '--自定义规则导出', 'controller' => 'cj',		'action' => 'export'),
+        '9408' => array("show"=>0,'name' => '--自定义规则导入', 'controller' => 'cj',		'action' => 'import'),
+
+    )),
+
+    '10' => array('name' => '数据库', 'icon' => 'xe621', 'sub' => array(
+        '101' => array("show"=>1,'name' => '数据库管理', 'controller' => 'database',		'action' => 'index'),
+        '10001' => array("show"=>0,'name' => '--数据库备份', 'controller' => 'database',		'action' => 'export'),
+        '10002' => array("show"=>0,'name' => '--数据库还原', 'controller' => 'database',		'action' => 'import'),
+        '10003' => array("show"=>0,'name' => '--数据库优化', 'controller' => 'database',		'action' => 'optimize'),
+        '10004' => array("show"=>0,'name' => '--数据库修复', 'controller' => 'database',		'action' => 'repair'),
+        '10005' => array("show"=>0,'name' => '--数据库删除备份', 'controller' => 'database',		'action' => 'del'),
+        '10006' => array("show"=>0,'name' => '--数据库表信息', 'controller' => 'database',		'action' => 'columns'),
+
+        '102' => array("show"=>1,'name' => '执行SQL语句', 'controller' => 'database',		'action' => 'sql'),
+        '103' => array("show"=>1,'name' => '数据批量替换', 'controller' => 'database',		'action' => 'rep'),
+    )),
+    '11' => array('name' => '应用', 'icon' => 'xe621', 'sub' => array(
+        '111' => array("show"=>1,'name' => '应用市场', 'controller' => 'addon',		'action' => 'index', 'param'=>''),
+
+        '112' => array("show"=>1,'name' => 'URL推送', 'controller' => 'urlsend',		'action' => 'index', 'param'=>''),
+        '11200' => array("show"=>0,'name' => '--推送入口', 'controller' => 'urlsend',		'action' => 'push'),
+        '11201' => array("show"=>0,'name' => '--百度主动推送', 'controller' => 'urlsend',		'action' => 'baidu_push'),
+        '11202' => array("show"=>0,'name' => '--百度熊掌推送', 'controller' => 'urlsend',		'action' => 'baidu_bear'),
+
+        '11100' => array("show"=>0,'name' => '--应用插件列表', 'controller' => 'addon',		'action' => 'downloaded'),
+        '11101' => array("show"=>0,'name' => '--应用插件安装', 'controller' => 'addon',		'action' => 'install'),
+        '11102' => array("show"=>0,'name' => '--应用插件卸载', 'controller' => 'addon',		'action' => 'uninstall'),
+        '11103' => array("show"=>0,'name' => '--应用插件配置', 'controller' => 'addon',		'action' => 'config'),
+        '11104' => array("show"=>0,'name' => '--应用插件状态', 'controller' => 'addon',		'action' => 'state'),
+        '11105' => array("show"=>0,'name' => '--应用插件上传', 'controller' => 'addon',		'action' => 'local'),
+        '11106' => array("show"=>0,'name' => '--应用插件升级', 'controller' => 'addon',		'action' => 'upgrade'),
+    )),
+
+);

+ 147 - 0
application/admin/controller/Actor.php

@@ -0,0 +1,147 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+use app\common\util\Pinyin;
+
+class Actor extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function data()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) < 1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) < 1 ? $this->_pagesize : $param['limit'];
+
+        $where = [];
+        if (!empty($param['type'])) {
+            $where['type_id'] = ['eq', $param['type']];
+        }
+        if (!empty($param['level'])) {
+            $where['actor_level'] = ['eq', $param['level']];
+        }
+        if (in_array($param['status'], ['0', '1'])) {
+            $where['actor_status'] = ['eq', $param['status']];
+        }
+        if(!empty($param['pic'])){
+            if($param['pic'] == '1'){
+                $where['actor_pic'] = ['eq',''];
+            }
+            elseif($param['pic'] == '2'){
+                $where['actor_pic'] = ['like','http%'];
+            }
+            elseif($param['pic'] == '3'){
+                $where['actor_pic'] = ['like','%#err%'];
+            }
+        }
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['actor_name'] = ['like','%'.$param['wd'].'%'];
+        }
+
+        $order='actor_time desc';
+        $res = model('Actor')->listData($where,$order,$param['page'],$param['limit']);
+
+        $this->assign('list', $res['list']);
+        $this->assign('total', $res['total']);
+        $this->assign('page', $res['page']);
+        $this->assign('limit', $res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param', $param);
+
+        $type_tree = model('Type')->getCache('type_tree');
+        $this->assign('type_tree', $type_tree);
+
+        $this->assign('title', '演员管理');
+        return $this->fetch('admin@actor/index');
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input('post.');
+            $res = model('Actor')->saveData($param);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+        $where=[];
+        $where['actor_id'] = ['eq',$id];
+        $res = model('Actor')->infoData($where);
+        $info = $res['info'];
+        $this->assign('info',$info);
+
+        $type_tree = model('Type')->getCache('type_tree');
+        $this->assign('type_tree', $type_tree);
+
+        $this->assign('title','演员信息');
+        return $this->fetch('admin@actor/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['actor_id'] = ['in',$ids];
+            $res = model('Actor')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+        $start = $param['start'];
+        $end = $param['end'];
+
+
+        if(!empty($ids) && in_array($col,['actor_status','actor_lock','actor_level','type_id','actor_hits'])){
+            $where=[];
+            $update = [];
+            $where['actor_id'] = ['in',$ids];
+            if(empty($start)){
+                $update[$col] = $val;
+                if($col == 'type_id'){
+                    $type_list = model('Type')->getCache();
+                    $id1 = intval($type_list[$val]['type_pid']);
+                    $update['type_id_1'] = $id1;
+                }
+                $res = model('Actor')->fieldData($where, $update);
+            }
+            else{
+                if(empty($end)){$end = 9999;}
+                $ids = explode(',',$ids);
+                foreach($ids as $k=>$v){
+                    $val = rand($start,$end);
+                    $where['actor_id'] = ['eq',$v];
+                    $update[$col] = $val;
+                    $res = model('Actor')->fieldData($where, $update);
+                }
+            }
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+}

+ 344 - 0
application/admin/controller/Addon.php

@@ -0,0 +1,344 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+use think\addons\AddonException;
+use think\addons\Service;
+use think\Cache;
+use think\Config;
+use think\Exception;
+use app\common\util\Dir;
+
+class Addon extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $param = input();
+
+        $this->assign('title','插件管理');
+        return $this->fetch('admin@addon/index');
+    }
+
+    public function config()
+    {
+        $param = input();
+        $name = $param['name'];
+        if(empty($name)){
+            return $this->error('参数错误');
+        }
+
+        if (!is_dir(ADDON_PATH . $name)) {
+            return $this->error('获取插件目录失败');
+        }
+
+        $info = get_addon_info($name);
+        $config = get_addon_fullconfig($name);
+        if (!$info){
+            return $this->error('获取插件信息失败');
+        }
+        if ($this->request->isPost()) {
+            $params = $this->request->post("row/a");
+            if(empty($params)){
+                return $this->error('参数错误');
+            }
+            foreach ($config as $k => &$v) {
+                if (isset($params[$v['name']])) {
+                    if ($v['type'] == 'array') {
+                        $params[$v['name']] = is_array($params[$v['name']]) ? $params[$v['name']] : (array)json_decode($params[$v['name']], true);
+                        $value = $params[$v['name']];
+                    } else {
+                        $value = is_array($params[$v['name']]) ? implode(',', $params[$v['name']]) : $params[$v['name']];
+                    }
+                    $v['value'] = $value;
+                }
+            }
+
+            try {
+                //更新配置文件
+                set_addon_fullconfig($name, $config);
+                Service::refresh();
+                return $this->success('保存成功');
+            } catch (Exception $e) {
+                return $this->error($e->getMessage());
+            }
+        }
+
+        $this->assign('info',$info);
+        $this->assign('config',$config);
+
+        return $this->fetch('admin@addon/config');
+    }
+
+    public function info()
+    {
+
+    }
+
+    public function downloaded()
+    {
+        $offset = (int)$this->request->get("offset");
+        $limit = (int)$this->request->get("limit");
+        $filter = $this->request->get("filter");
+        $search = $this->request->get("search");
+        $search = htmlspecialchars(strip_tags($search));
+        $key = $GLOBALS['config']['app']['cache_flag']. '_'. 'onlineaddons';
+        $onlineaddons = Cache::get($key);
+        if (!is_array($onlineaddons)) {
+            $onlineaddons = [];
+            $result = mac_curl_get( "h"."t"."t"."p:/"."/a"."p"."i"."."."m"."a"."c"."c"."m"."s."."c"."o"."m"."/" . 'addon/index');
+            if ($result['ret']) {
+                $json = json_decode($result['msg'], TRUE);
+                $rows = isset($json['rows']) ? $json['rows'] : [];
+                foreach ($rows as $index => $row) {
+                    $onlineaddons[$row['name']] = $row;
+                }
+            }
+            Cache::set($key, $onlineaddons, 600);
+        }
+        $filter = (array)json_decode($filter, true);
+        $addons = get_addon_list();
+        $list = [];
+        foreach ($addons as $k => $v) {
+            if ($search && stripos($v['name'], $search) === FALSE && stripos($v['intro'], $search) === FALSE)
+                continue;
+
+            if (isset($onlineaddons[$v['name']])) {
+                $v = array_merge($onlineaddons[$v['name']], $v);
+            } else {
+                if(!isset($v['category_id'])) {
+                    $v['category_id'] = 0;
+                }
+                if(!isset($v['flag'])) {
+                    $v['flag'] = '';
+                }
+                if(!isset($v['banner'])) {
+                    $v['banner'] = '';
+                }
+                if(!isset($v['image'])) {
+                    $v['image'] = '';
+                }
+                if(!isset($v['donateimage'])) {
+                    $v['donateimage'] = '';
+                }
+                if(!isset($v['demourl'])) {
+                    $v['demourl'] = '';
+                }
+                if(!isset($v['price'])) {
+                    $v['price'] = '0.00';
+                }
+            }
+            $v['url'] = addon_url($v['name']);
+            $v['createtime'] = filemtime(ADDON_PATH . $v['name']);
+            $v['install'] = '1';
+            if ($filter && isset($filter['category_id']) && is_numeric($filter['category_id']) && $filter['category_id'] != $v['category_id']) {
+                continue;
+            }
+            $list[] = $v;
+        }
+        $total = count($list);
+        if ($limit) {
+            $list = array_slice($list, $offset, $limit);
+        }
+        $result = array("total" => $total, "rows" => $list);
+
+        $callback = $this->request->get('callback') ? "jsonp" : "json";
+        return $callback($result);
+    }
+
+    /**
+     * 安装
+     */
+    public function install()
+    {
+        $param = input();
+        $name = $param['name'];
+        $force = (int)$param['force'];
+        if (!$name) {
+            return $this->error('参数错误');
+        }
+        try {
+            $uid = $this->request->post("uid");
+            $token = $this->request->post("token");
+            $version = $this->request->post("version");
+            $faversion = $this->request->post("faversion");
+            $extend = [
+                'uid'       => $uid,
+                'token'     => $token,
+                'version'   => $version,
+                'faversion' => $faversion
+            ];
+            Service::install($name, $force, $extend);
+            $info = get_addon_info($name);
+            $info['config'] = get_addon_config($name) ? 1 : 0;
+            $info['state'] = 1;
+            return $this->success('安装成功');
+        } catch (AddonException $e) {
+            return $this->result($e->getData(), $e->getCode(), $e->getMessage());
+        } catch (Exception $e) {
+            return $this->error($e->getMessage(), $e->getCode());
+        }
+    }
+
+    /**
+     * 卸载
+     */
+    public function uninstall()
+    {
+        $param = input();
+        $name = $param['name'];
+        $force = (int)$param['force'];
+        if (!$name) {
+            return $this->error('参数错误');
+        }
+        try {
+            if( strpos($name,".")!==false ||  strpos($name,"/")!==false ||  strpos($name,"\\")!==false  ) {
+                $this->error('非法目录请求');
+                return;
+            }
+
+
+            Service::uninstall($name, $force);
+            return $this->success('卸载成功');
+        } catch (AddonException $e) {
+            return $this->result($e->getData(), $e->getCode(), $e->getMessage());
+        } catch (Exception $e) {
+            return $this->error($e->getMessage());
+        }
+    }
+
+    /**
+     * 禁用启用
+     */
+    public function state()
+    {
+        $param = input();
+        $name = $param['name'];
+        $action = $param['action'];
+        $force = (int)$param['force'];
+        if (!$name) {
+            return $this->error('参数错误');
+        }
+        try {
+            $action = $action == 'enable' ? $action : 'disable';
+            //调用启用、禁用的方法
+            Service::$action($name, $force);
+            Cache::rm('__menu__');
+            return $this->success('状态设置成功');
+        } catch (AddonException $e) {
+            return $this->result($e->getData(), $e->getCode(), $e->getMessage());
+        } catch (Exception $e) {
+            return $this->error($e->getMessage());
+        }
+    }
+
+    /**
+     * 本地上传
+     */
+    public function local()
+    {
+        $file = $this->request->file('file');
+        $addonTmpDir = RUNTIME_PATH . 'addons' . DS;
+        if (!is_dir($addonTmpDir)) {
+            @mkdir($addonTmpDir, 0755, true);
+        }
+        $info = $file->rule('uniqid')->validate(['size' => 10240000, 'ext' => 'zip'])->move($addonTmpDir);
+        if ($info) {
+            $tmpName = substr($info->getFilename(), 0, stripos($info->getFilename(), '.'));
+            $tmpAddonDir = ADDON_PATH . $tmpName . DS;
+            $tmpFile = $addonTmpDir . $info->getSaveName();
+            try {
+                Service::unzip($tmpName);
+                @unlink($tmpFile);
+                $infoFile = $tmpAddonDir . 'info.ini';
+                if (!is_file($infoFile)) {
+                    throw new Exception('缺少插件配置文件info.ini');
+                }
+
+                $config = Config::parse($infoFile, '', $tmpName);
+                $name = isset($config['name']) ? $config['name'] : '';
+                if (!$name) {
+                    throw new Exception('插件名称不能为空');
+                }
+
+                $newAddonDir = ADDON_PATH . $name . DS;
+                if (is_dir($newAddonDir)) {
+                    throw new Exception('已经存在插件');
+                }
+
+                //重命名插件文件夹
+                rename($tmpAddonDir, $newAddonDir);
+                try {
+                    //默认禁用该插件
+                    $info = get_addon_info($name);
+                    if ($info['state']) {
+                        $info['state'] = 0;
+                        set_addon_info($name, $info);
+                    }
+
+                    //执行插件的安装方法
+                    $class = get_addon_class($name);
+                    if (class_exists($class)) {
+                        $addon = new $class();
+                        $addon->install();
+                    }
+
+                    //导入SQL
+                    Service::importsql($name);
+
+                    $info['config'] = get_addon_config($name) ? 1 : 0;
+                    return $this->success('离线安装成功');
+                } catch (Exception $e) {
+                    if (Dir::delDir($newAddonDir) === false) {
+
+                    }
+                    throw new Exception($e->getMessage());
+                }
+            } catch (Exception $e) {
+                @unlink($tmpFile);
+                if (Dir::delDir($tmpAddonDir) === false) {
+
+                }
+                return $this->error($e->getMessage());
+            }
+        } else {
+            // 上传失败获取错误信息
+            return $this->error($file->getError());
+        }
+    }
+
+    /**
+     * 更新插件
+     */
+    public function upgrade()
+    {
+        $name = $this->request->post("name");
+        if (!$name) {
+            return $this->error('参数错误');
+        }
+        try {
+            $uid = $this->request->post("uid");
+            $token = $this->request->post("token");
+            $version = $this->request->post("version");
+            $faversion = $this->request->post("faversion");
+            $extend = [
+                'uid'       => $uid,
+                'token'     => $token,
+                'version'   => $version,
+                'faversion' => $faversion
+            ];
+            //调用更新的方法
+            Service::upgrade($name, $extend);
+            Cache::rm('__menu__');
+            return $this->success('更新成功');
+        } catch (AddonException $e) {
+            return $this->result($e->getData(), $e->getCode(), $e->getMessage());
+        } catch (Exception $e) {
+            return $this->error($e->getMessage());
+        }
+    }
+
+}

+ 138 - 0
application/admin/controller/Admin.php

@@ -0,0 +1,138 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Admin extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+        $where=[];
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['admin_name'] = ['like','%'.$param['wd'].'%'];
+        }
+
+        $order='admin_id desc';
+        $res = model('Admin')->listData($where,$order,$param['page'],$param['limit']);
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+
+        $this->assign('admin',$this->_admin);
+
+        $this->assign('param',$param);
+        $this->assign('title','管理员管理');
+        return $this->fetch('admin@admin/index');
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input('post.');
+            if(!in_array('index/welcome',$param['admin_auth'])){
+                $param['admin_auth'][] = 'index/welcome';
+            }
+            $res = model('Admin')->saveData($param);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+
+        $where=[];
+        $where['admin_id'] = ['eq',$id];
+
+        $res = model('Admin')->infoData($where);
+        $this->assign('info',$res['info']);
+
+        //权限列表
+        $menus = @include MAC_ADMIN_COMM . 'auth.php';
+
+        foreach($menus as $k1=>$v1){
+            $all = [];
+            $cs = [];
+            $menus[$k1]['ck'] = '';
+            foreach($v1['sub'] as $k2=>$v2){
+                $one = $v2['controller'] . '/' . $v2['action'];
+                $menus[$k1]['sub'][$k2]['url'] = url($one);
+                $menus[$k1]['sub'][$k2]['ck']= '';
+                $all[] = $one;
+
+                if(strpos(','.$res['info']['admin_auth'],$one)>0){
+                    $cs[] = $one;
+                    $menus[$k1]['sub'][$k2]['ck'] = 'checked';
+                }
+                if($k2==11){
+                    $menus[$k1]['sub'][$k2]['ck'] = ' checked  readonly="readonly" ';
+                }
+            }
+            if($all == $cs){
+                $menus[$k1]['ck'] = 'checked';
+            }
+        }
+        $this->assign('menus',$menus);
+
+
+        $this->assign('title','管理员信息');
+        return $this->fetch('admin@admin/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['admin_id'] = ['in',$ids];
+            if(!is_array($ids)) {
+                $ids = explode(',', $ids);
+            }
+            if(in_array($this->_admin['admin_id'],$ids)){
+                return $this->error('禁止删除当前登录账号');
+            }
+            $res = model('Admin')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+
+        if(!empty($ids) && in_array($col,['admin_status']) && in_array($val,['0','1'])){
+            $where=[];
+            $where['admin_id'] = ['in',$ids];
+
+            $res = model('Admin')->fieldData($where,$col,$val);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+}

+ 297 - 0
application/admin/controller/Art.php

@@ -0,0 +1,297 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+use app\common\util\Pinyin;
+
+class Art extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function data()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) < 1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) < 1 ? $this->_pagesize : $param['limit'];
+
+        $where = [];
+        if (!empty($param['type'])) {
+            $where['type_id'] = ['eq', $param['type']];
+        }
+        if (!empty($param['level'])) {
+            $where['art_level'] = ['eq', $param['level']];
+        }
+        if (in_array($param['status'], ['0', '1'])) {
+            $where['art_status'] = ['eq', $param['status']];
+        }
+        if (!empty($param['lock'])) {
+            $where['art_lock'] = ['eq', $param['lock']];
+        }
+        if(!empty($param['pic'])){
+            if($param['pic'] == '1'){
+                $where['art_pic'] = ['eq',''];
+            }
+            elseif($param['pic'] == '2'){
+                $where['art_pic'] = ['like','http%'];
+            }
+            elseif($param['pic'] == '3'){
+                $where['art_pic'] = ['like','%#err%'];
+            }
+        }
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['art_name'] = ['like','%'.$param['wd'].'%'];
+        }
+
+        if(!empty($param['repeat'])){
+            if($param['page'] ==1){
+                Db::execute('DROP TABLE IF EXISTS '.config('database.prefix').'tmpart');
+                Db::execute('CREATE TABLE IF NOT EXISTS `'.config('database.prefix').'tmpart` as (SELECT min(art_id)as id1,art_name as name1 FROM '.config('database.prefix').'art GROUP BY name1 HAVING COUNT(name1)>1)');
+            }
+            $order='art_name asc';
+            $res = model('Art')->listRepeatData($where,$order,$param['page'],$param['limit']);
+        }
+        else{
+            $order='art_time desc';
+            $res = model('Art')->listData($where,$order,$param['page'],$param['limit']);
+        }
+
+        foreach($res['list'] as $k=>&$v){
+            $v['ismake'] = 1;
+            if($GLOBALS['config']['view']['art_detail'] >0 && $v['art_time_make'] < $v['art_time']){
+                $v['ismake'] = 0;
+            }
+        }
+
+        $this->assign('list', $res['list']);
+        $this->assign('total', $res['total']);
+        $this->assign('page', $res['page']);
+        $this->assign('limit', $res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param', $param);
+
+        $type_tree = model('Type')->getCache('type_tree');
+        $this->assign('type_tree', $type_tree);
+
+        $this->assign('title', '文章管理');
+        return $this->fetch('admin@art/index');
+    }
+
+    public function batch()
+    {
+        $param = input();
+        if (!empty($param)) {
+
+            mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+
+            if(empty($param['ck_del']) && empty($param['ck_level']) && empty($param['ck_status']) && empty($param['ck_lock']) && empty($param['ck_hits']) ){
+                return $this->error('没有选择任何参数');
+            }
+            $where = [];
+            if(!empty($param['type'])){
+                $where['type_id'] = ['eq',$param['type']];
+            }
+            if(!empty($param['level'])){
+                $where['art_level'] = ['eq',$param['level']];
+            }
+            if(in_array($param['status'],['0','1'])){
+                $where['art_status'] = ['eq',$param['status']];
+            }
+            if(!empty($param['lock'])){
+                $where['art_lock'] = ['eq',$param['lock']];
+            }
+            if(!empty($param['pic'])){
+                if($param['pic'] == '1'){
+                    $where['art_pic'] = ['eq',''];
+                }
+                elseif($param['pic'] == '2'){
+                    $where['art_pic'] = ['like','http%'];
+                }
+                elseif($param['pic'] == '3'){
+                    $where['art_pic'] = ['like','%#err%'];
+                }
+            }
+            if(!empty($param['wd'])){
+                $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+                $where['art_name'] = ['like','%'.$param['wd'].'%'];
+            }
+
+
+            if($param['ck_del'] == 1){
+                $res = model('Art')->delData($where);
+                mac_echo('批量删除完毕');
+                mac_jump( url('art/batch') ,3);
+                exit;
+            }
+
+            if(empty($param['page'])){
+                $param['page'] = 1;
+            }
+            if(empty($param['limit'])){
+                $param['limit'] = 100;
+            }
+            if(empty($total)) {
+                $total = model('Art')->countData($where);
+                $page_count = ceil($total / $param['limit']);
+            }
+
+            if($param['page'] > $page_count) {
+                mac_echo('批量设置完毕');
+                mac_jump( url('art/batch') ,3);
+                exit;
+            }
+            mac_echo( "<font color=red>共".$total."条数据需要处理,每页".$param['limit']."条,共".$page_count."页,正在处理第".$param['page']."页数据</font>");
+
+            $order='art_id desc';
+            $res = model('Art')->listData($where,$order,$param['page'],$param['limit']);
+
+            foreach($res['list'] as  $k=>$v){
+                $where2 = [];
+                $where2['art_id'] = $v['art_id'];
+
+                $update = [];
+                $des = $v['art_id'].','.$v['art_name'];
+
+                if(!empty($param['ck_level']) && !empty($param['val_level'])){
+                    $update['art_level'] = $param['val_level'];
+                    $des .= '&nbsp;推荐值:'.$param['val_level'].';';
+                }
+                if(!empty($param['ck_status']) && isset($param['val_status'])){
+                    $update['art_status'] = $param['val_status'];
+                    $des .= '&nbsp;状态:'.($param['val_status'] ==1 ? '[已审核]':'[未审核]') .';';
+                }
+                if(!empty($param['ck_lock']) && isset($param['val_lock'])){
+                    $update['art_lock'] = $param['val_lock'];
+                    $des .= '&nbsp;推荐值:'.($param['val_lock']==1 ? '[锁定]':'[解锁]').';';
+                }
+                if(!empty($param['ck_hits']) && !empty($param['val_hits_min']) && !empty($param['val_hits_max']) ){
+                    $update['art_hits'] = rand($param['val_hits_min'],$param['val_hits_max']);
+                    $des .= '&nbsp;人气:'.$update['art_hits'].';';
+                }
+                mac_echo($des);
+                $res2 = model('Art')->where($where2)->update($update);
+
+            }
+            $param['page']++;
+            $url = url('art/batch') .'?'. http_build_query($param);
+            mac_jump( $url ,3);
+            exit;
+        }
+
+        $type_tree = model('Type')->getCache('type_tree');
+        $this->assign('type_tree',$type_tree);
+
+        $this->assign('title','文章批量操作');
+        return $this->fetch('admin@art/batch');
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input('post.');
+            $res = model('Art')->saveData($param);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+        $where=[];
+        $where['art_id'] = ['eq',$id];
+        $res = model('Art')->infoData($where);
+
+        $info = $res['info'];
+        $this->assign('info',$info);
+        $this->assign('art_page_list',$info['art_page_list']);
+
+        $type_tree = model('Type')->getCache('type_tree');
+        $this->assign('type_tree',$type_tree);
+
+        $this->assign('title','文章信息');
+        return $this->fetch('admin@art/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['art_id'] = ['in',$ids];
+            $res = model('Art')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        elseif(!empty($param['repeat'])){
+            $st = ' not in ';
+            if($param['retain']=='max'){
+                $st=' in ';
+            }
+            $sql = 'delete from '.config('database.prefix').'art where art_name in(select name1 from '.config('database.prefix').'tmpart) and art_id '.$st.'(select id1 from '.config('database.prefix').'tmpart)';
+            $res = model('Art')->execute($sql);
+            if($res===false){
+                return $this->success('删除失败');
+            }
+            return $this->success('删除成功');
+        }
+        return $this->error('参数错误');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+        $start = $param['start'];
+        $end = $param['end'];
+
+
+        if(!empty($ids) && in_array($col,['art_status','art_lock','art_level','art_hits','type_id'])){
+            $where=[];
+            $where['art_id'] = ['in',$ids];
+            $update = [];
+            if(empty($start)) {
+                $update[$col] = $val;
+                if($col == 'type_id'){
+                    $type_list = model('Type')->getCache();
+                    $id1 = intval($type_list[$val]['type_pid']);
+                    $update['type_id_1'] = $id1;
+                }
+                $res = model('Art')->fieldData($where, $update);
+            }
+            else{
+                if(empty($end)){$end = 9999;}
+                $ids = explode(',',$ids);
+                foreach($ids as $k=>$v){
+                    $val = rand($start,$end);
+                    $where['art_id'] = ['eq',$v];
+                    $update[$col] = $val;
+                    $res = model('Art')->fieldData($where, $update);
+                }
+            }
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function updateToday()
+    {
+        $param = input();
+        $flag = $param['flag'];
+        $res = model('Art')->updateToday($flag);
+        return json($res);
+    }
+
+}

+ 109 - 0
application/admin/controller/Base.php

@@ -0,0 +1,109 @@
+<?php
+namespace app\admin\controller;
+use think\Controller;
+use app\common\controller\All;
+use think\Cache;
+use app\common\util\Dir;
+
+class Base extends All
+{
+    var $_admin;
+    var $_pagesize;
+    var $_makesize;
+
+    public function __construct()
+    {
+        parent::__construct();
+
+        //判断用户登录状态
+
+        if(in_array($this->_cl,['Index']) && in_array($this->_ac,['login','logout'])) {
+
+        }
+        elseif(ENTRANCE=='api' && in_array($this->_cl,['Timming']) && in_array($this->_ac,['index'])){
+
+        }
+        else {
+            $res = model('Admin')->checkLogin();
+
+            if ($res['code'] > 1) {
+                return $this->redirect('index/login');
+            }
+            $this->_admin = $res['info'];
+            $this->_pagesize = $GLOBALS['config']['app']['pagesize'];
+            $this->_makesize = $GLOBALS['config']['app']['makesize'];
+
+            if($this->_cl!='Update' && !$this->check_auth($this->_cl,$this->_ac)){
+                return $this->error('您没有权限访问此页面');
+            }
+        }
+    }
+
+    public function check_auth($c,$a)
+    {
+        $c = strtolower($c);
+        $a = strtolower($a);
+
+        $auths = $this->_admin['admin_auth'] . ',index/index,index/welcome,';
+        $cur = ','.$c.'/'.$a.',';
+        if($this->_admin['admin_id'] =='1'){
+            return true;
+        }
+        elseif(strpos($auths,$cur)===false){
+            return false;
+        }
+        else{
+            return true;
+        }
+    }
+
+    public function _cache_clear()
+    {
+        //播放器配置缓存
+        $vodplayer = config('vodplayer');
+        $voddowner = config('voddowner');
+        $vodserver = config('vodserver');
+        $player = [];
+        foreach($vodplayer as  $k=>$v){
+            $player[$k] = [
+                'show'=>(string)$v['show'],
+                'des'=>(string)$v['des'],
+                'ps'=>(string)$v['ps'],
+                'parse'=>(string)$v['parse'],
+            ];
+        }
+        $downer = [];
+        foreach($voddowner as  $k=>$v){
+            $downer[$k] = [
+                'show'=>(string)$v['show'],
+                'des'=>(string)$v['des'],
+                'ps'=>(string)$v['ps'],
+                'parse'=>(string)$v['parse'],
+            ];
+        }
+
+        $server = [];
+        foreach($vodserver as  $k=>$v){
+            $server[$k] = [
+                'show'=>(string)$v['show'],
+                'des'=>(string)$v['des']
+            ];
+        }
+        $content = 'MacPlayerConfig.player_list='.json_encode($player) . ',MacPlayerConfig.downer_list='.json_encode($downer) . ',MacPlayerConfig.server_list='.json_encode($server) .';';
+        $path = './static/js/playerconfig.js';
+        if(!file_exists($path)){ $path .= '.bak'; }
+        $fc = @file_get_contents( $path );
+        $jsb = mac_get_body($fc,'//缓存开始','//缓存结束');
+        $fc = str_replace($jsb,"\r\n".$content."\r\n",$fc);
+        @fwrite(fopen('./static/js/playerconfig.js','wb'),$fc);
+
+        Dir::delDir(RUNTIME_PATH.'cache/');
+        Dir::delDir(RUNTIME_PATH.'log/');
+        Dir::delDir(RUNTIME_PATH.'temp/');
+
+        Cache::clear();
+
+        return true;
+    }
+
+}

+ 127 - 0
application/admin/controller/Card.php

@@ -0,0 +1,127 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Card extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+
+        $where=[];
+        if(in_array($param['sale_status'],['0','1'],true)){
+            $where['card_sale_status'] = ['eq',$param['sale_status']];
+        }
+        if(in_array($param['use_status'],['0','1'],true)){
+            $where['card_use_status'] = ['eq',$param['use_status']];
+        }
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['card_no'] = ['like','%'.$param['wd'].'%'];
+        }
+        if(isset($param['time'])){
+            $t=0;
+            if($param['time']=='1'){
+                $t = model('Card')->max('card_add_time');
+            }
+            else{
+                $t = strtotime(date('Y-m-d',strtotime('-'.$param['time'] .' day')));
+            }
+            $where['card_add_time'] = ['egt', intval($t) ];
+        }
+
+        if($param['export'] =='1'){
+            $param['page'] = 1;
+            $param['limit'] = 9999;
+        }
+
+        $order='card_id desc';
+        $res = model('Card')->listData($where,$order,$param['page'],$param['limit']);
+
+        if($param['export'] =='1'){
+            $filename = 'card_' . date('Y-m-d'). '.csv';
+            header("Content-type:text/csv");
+            header("Accept-Ranges:bytes");
+            header("Content-Disposition:attachment;filename=".$filename."");
+            header('Cache-Control:must-revalidate,post-check=0,pre-check=0');
+            header('Expires:0');
+            header('Pragma:public');
+
+            echo '卡号,密码,创建时间' .  "\n";
+            foreach($res['list'] as  $k=>$v){
+                echo $v['card_no'] . "," . $v['card_pwd'] . "," . date('Y-m-d H:i:s',$v['card_add_time']) . "\n";
+            }
+
+            exit;
+        }
+
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+        $this->assign('title','充值卡管理');
+        return $this->fetch('admin@card/index');
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input('post.');
+
+            if(empty($param['num']) || empty($param['money']) || empty($param['point']) ){
+                return $this->error('参数错误');
+            }
+
+            $res = model('Card')->saveAllData(intval($param['num']),intval($param['money']),intval($param['point']),$param['role_no'],$param['role_pwd']);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+
+        $id = input('id');
+        $where=[];
+        $where['card_id'] = ['eq',$id];
+        $res = model('Card')->infoData($where);
+
+        $this->assign('info',$res['info']);
+
+        return $this->fetch('admin@card/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $all = $param['all'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['card_id'] = ['in',$ids];
+            if($all==1){
+                $where['card_id'] = ['gt',0];
+            }
+
+            $res = model('Card')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+}

+ 81 - 0
application/admin/controller/Cash.php

@@ -0,0 +1,81 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Cash extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+        $where=[];
+        if($param['status']!=''){
+            $where['cash_status'] = ['eq',$param['status']];
+        }
+        if(!empty($param['uid'])){
+            $where['user_id'] = ['eq',$param['uid'] ];
+        }
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['cash_bank_no'] = ['like','%'.$param['wd'].'%' ];
+        }
+
+        $order='cash_id desc';
+        $res = model('Cash')->listData($where,$order,$param['page'],$param['limit']);
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+
+        $this->assign('title','提现管理');
+        return $this->fetch('admin@cash/index');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $all = $param['all'];
+        if(!empty($ids)){
+            $where=[];
+            $where['cash_id'] = ['in',$ids];
+            if($all==1){
+                $where['cash_id'] = ['gt',0];
+            }
+            $res = model('Cash')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function audit()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        if(!empty($ids)){
+            $where=[];
+            $where['cash_id'] = ['in',$ids];
+            $res = model('Cash')->auditData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+}

+ 525 - 0
application/admin/controller/Cj.php

@@ -0,0 +1,525 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+use app\common\util\Collection as cjOper;
+
+class Cj extends Base
+{
+    var $_isall=0;
+
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    //列表
+    public function index()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+        $where=[];
+
+        $order='nodeid desc';
+        $res = model('Cj')->listData('cj_node',$where,$order,$param['page'],$param['limit']);
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+        $this->assign('title','自定义采集管理');
+
+        return $this->fetch('admin@cj/index');
+    }
+
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input();
+            $data = $param['data'];
+            $data['urlpage'] = $param['urlpage'.$data['sourcetype']];
+            if(!empty($data['customize_config'])){
+                $customize_config = $data['customize_config'];
+                unset($data['customize_config']);
+                foreach ($customize_config['name'] as $k => $v) {
+                    if (empty($v) || empty($customize_config['name'][$k])) continue;
+                    $data['customize_config'][] = array('name'=>$customize_config['name'][$k], 'en_name'=>$customize_config['en_name'][$k], 'rule'=>$customize_config['rule'][$k], 'html_rule'=>$customize_config['html_rule'][$k]);
+                }
+                $data['customize_config'] = json_encode($data['customize_config'],JSON_FORCE_OBJECT);
+            }
+            $res = model('Cj')->saveData($data);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+        $where=[];
+        $where['nodeid'] = ['eq',$id];
+        $res = model('Cj')->infoData('cj_node',$where);
+        if(!empty($res['info']['customize_config'])){
+            $res['info']['customize_config'] = json_decode($res['info']['customize_config'],true);
+        }
+        $this->assign('data',$res['info']);
+        $this->assign('title','采集信息');
+        return $this->fetch('admin@cj/info');
+    }
+
+    public function program()
+    {
+        $param = input();
+        $where=[];
+        $where['nodeid'] = $param['id'];
+        $res = model('Cj')->infoData('cj_node',$where);
+        if($res['code']>1){
+            return $this->error('获取采集项目信息失败');
+        }
+
+        if (Request()->isPost()) {
+
+            $program_config = [];
+            foreach($param['model_field'] as $k=>$v){
+                if(!empty($param['node_field'][$k])){
+                    $program_config['map'][$v] = $param['node_field'][$k];
+                    $program_config['funcs'][$v] = $param['funcs'][$k];
+                }
+            }
+            $update=[];
+            $update['nodeid'] = $param['id'];
+            $update['program_config'] = json_encode($program_config);
+            $res = model('Cj')->saveData($update);
+            if($res['code']>1){
+                return $this->error('保存失败');
+            }
+            return $this->success('保存成功');
+        }
+
+        $program_config = [];
+        if(!empty($res['info']['program_config'])){
+            $program_config = json_decode($res['info']['program_config'],true);
+        }
+        $this->assign('program_config',$program_config);
+
+
+        $node_field = array('title'=>'标题','type'=>'分类', 'content'=>'内容');
+        $customize_config = [];
+        if(!empty($res['info']['customize_config'])){
+            $customize_config = json_decode($res['info']['customize_config'],true);
+        }
+
+        if (is_array($customize_config)) foreach ($customize_config as $k=>$v) {
+            if (empty($v['en_name']) || empty($v['name'])) continue;
+            $node_field[$v['en_name']] = $v['name'];
+        }
+        $this->assign('node_field',$node_field);
+
+        $table = 'vod';
+        if($res['info']['mid'] =='2'){
+            $table='art';
+        }
+        $column_list = Db::query('SHOW COLUMNS FROM '.config('database.prefix').$table);
+        $this->assign('column_list',$column_list);
+        $this->assign('param',$param);
+        return $this->fetch('admin@cj/program');
+    }
+
+    public function col_all($param)
+    {
+        $this->_isall=1;
+        $this->col_url($param);
+    }
+
+
+    //采集网址
+    public function col_url($param=[]) {
+        if(empty($param)){
+            $param = input();
+        }
+
+        $where=[];
+        $where['nodeid'] = $param['id'];
+        $res = model('Cj')->infoData('cj_node',$where);
+        if($res['code']>1){
+            return $this->error('获取采集项目信息失败');
+        }
+        $data = $res['info'];
+        $collection = new cjOper();
+        $urls = $collection->url_list($data);
+
+
+        $total_page = count($urls);
+        if (empty($total_page)){
+            return $this->error('获取网址信息失败');
+        }
+
+        $param['page'] = isset($param['page']) ? intval($param['page']) : 1;
+
+        $url_list = $urls[$param['page']];
+        $url = $collection->get_url_lists($url_list, $data);
+
+
+        $total = count($url);
+        $re = 0;
+        if (is_array($url) && !empty($url)) {
+            foreach ($url as $v) {
+                if (empty($v['url']) || empty($v['title'])) {
+                    $re++;
+                    continue;
+                }
+                $v['title'] = strip_tags($v['title']);
+                $md5 = md5($v['url']);
+                $where=[];
+                $where['md5'] = $md5;
+                $history = model('Cj')->infoData('cj_history',$where);
+                if($history['code']>1){
+                    Db::name('cj_history')->insert(array('md5' => $md5));
+                    Db::name('cj_content')->insert(array('nodeid'=>$param['id'], 'status'=>1, 'url'=>$v['url'], 'title'=>$v['title']));
+                }
+                else {
+                    $re++;
+                }
+            }
+        }
+        if ($total_page <= $param['page']) {
+            $time = time();
+            Db::name('cj_node')->where('nodeid',$param['id'])->update(array('lastdate' => $time));
+        }
+        if($this->_isall==1){
+            mac_echo('url采集完成');
+            $this->col_content($param);
+            exit;
+        }
+        $this->assign('param',$param);
+		$this->assign('url_list', $url_list);
+		$this->assign('total_page', $total_page);
+		$this->assign('re', $re);
+		$this->assign('url', $url);
+		$this->assign('page',$param['page']);
+		$this->assign('total',$total);
+        $this->assign('title','采集url地址');
+        if($total_page > $param['page']){
+            mac_echo('让服务器休息一会,稍后继续');
+            $param['page'] ++;
+            $link = url('cj/col_url') . '?'. http_build_query($param);
+            mac_jump( $link ,3);
+        }
+        else{
+            mac_echo('url采集完成');
+        }
+        return $this->fetch('admin@cj/col_url');
+    }
+
+    //采集文章
+    public function col_content($param=[]) {
+        if(empty($param)){
+            $param = input();
+        }
+
+        $collection = new cjOper();
+        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
+        $total = isset($_GET['total']) ? intval($_GET['total']) : 0;
+
+        $where=[];
+        $where['nodeid'] = $param['id'];
+        $res = model('Cj')->infoData('cj_node',$where);
+        if($res['code']>1){
+            return $this->error('获取采集项目信息失败');
+        }
+        $data = $res['info'];
+
+        mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+
+        if(empty($total)){
+            $total = Db::name('cj_content')->where('nodeid',$param['id'])->where('status',1)->count();
+        }
+        $limit = 20;
+        $total_page = ceil($total/$limit);
+        mac_echo('正在采集内容,共【'.$total.'】条,分'.$total_page.'页,每页采集'.$limit.'条,当前'.$page.'页');
+
+        $list = Db::name('cj_content')->where('nodeid',$param['id'])->where('status',1)->page($total_page-1,$limit)->select();
+
+        $i = 0;
+        $ids=[];
+        if(!empty($list) && is_array($list)){
+            foreach($list as $v){
+                $html = $collection->get_content($v['url'],$data);
+                Db::name('cj_content')->where('id',$v['id'])->update(['status'=>2, 'data'=>json_encode($html)]);
+                $ids[] = $v['id'];
+                $i++;
+
+                mac_echo($v['url'].'&nbsp;&nbsp;'.'ok');
+            }
+        }
+        else{
+            mac_echo('内容采集完成');
+            exit;
+        }
+
+        if($this->_isall==1){
+            mac_echo('内容采集完成');
+            $param['ids'] = implode(',',$ids);
+            $param['limit'] = 999;
+            $this->content_into($param);
+            exit;
+        }
+
+        if ($total_page > $page){
+            mac_echo('让服务器休息一会,稍后继续');
+            $param['page'] ++;
+            $link = url('cj/col_content') . '?'. http_build_query($param);
+            mac_jump( $link ,3);
+        }
+        else{
+            $time = time();
+            Db::name('cj_node')->where('nodeid',$param['id'])->update(array('lastdate' => $time));
+            mac_echo('采集完成');
+            exit;
+        }
+    }
+
+
+    public function publish()
+    {
+        $param = input();
+
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <20 ? $this->_pagesize : $param['limit'];
+        $where=[];
+        $where['nodeid'] = $param['id'];
+        if(!empty($param['status'])){
+            $where['status'] = ['eq',$param['status']];
+        }
+
+        $order='id desc';
+        $res = model('Cj')->listData('cj_content',$where,$order,$param['page'],$param['limit']);
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+        $this->assign('title','内容发布管理');
+
+        return $this->fetch('admin@cj/publish');
+    }
+
+    public function content_del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $all = $param['all'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['id'] = ['in',$ids];
+            if($all=='1'){
+                $where['id'] = ['gt',0];
+            }
+            $urls = [];
+            $list = Db::name('cj_content')->field('url')->where($where)->select();
+            foreach ($list as $k => $v) {
+                $md5 = md5($v['url']);
+                $urls[] = $md5;
+            }
+
+            $where2=[];
+            $where2['md5'] = ['in',$md5];
+            Db::name('cj_history')->where($where2)->delete();
+
+            $res = Db::name('cj_content')->where($where)->delete();
+            if($res===false){
+                return $this->error('删除失败'.$this->getError());
+            }
+        }
+        return $this->success('删除成功');
+    }
+
+    public function content_into($param=[])
+    {
+        if(empty($param)){
+            $param = input();
+        }
+
+        $nodeid = $param['id'];
+        $ids = $param['ids'];
+        $all = $param['all'];
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <20 ? $this->_pagesize : $param['limit'];
+
+        $where=[];
+        $where['nodeid'] = $param['id'];
+        $res = model('Cj')->infoData('cj_node',$where);
+        if($res['code']>1){
+            return $this->error('获取采集项目信息失败');
+        }
+        $node = $res['info'];
+
+
+        $where=[];
+        $where['nodeid'] = $nodeid;
+        $where['status'] =['eq',2];
+        $where['id'] = ['in',$ids];
+        if($all=='1'){
+            $where['id'] = ['gt',0];
+        }
+
+        mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+        if(empty($param['total'])) {
+            $param['total'] = Db::name('cj_content')->where($where)->count();
+        }
+
+        $list = Db::name('cj_content')->where($where)->page($param['page'],$param['limit'])->select();
+
+        $total_page = ceil($param['total']/$param['limit']);
+        mac_echo('正在导入内容,共【'.$param['total'].'】条,分'.$total_page.'页,每页采集'.$param['limit'].'条,当前'.$param['page'].'页');
+
+        $program_config =[];
+        if(!empty($node['program_config'])){
+            $program_config = json_decode($node['program_config'],true);
+        }
+
+        $inter = mac_interface_type();
+        $update_ids = [];
+        foreach($list as $k=>$v){
+            $data=[];
+            $content_data = json_decode($v['data'],true);
+            foreach ($program_config['map'] as $a=>$b) {
+                if (isset($program_config['funcs'][$a]) && function_exists($program_config['funcs'][$a])) {
+                    $data['data'][$k][$a] = $program_config['funcs'][$a]($v['data'][$b]);
+                }
+                else {
+                    $data['data'][$k][$a] = $content_data[$b];
+                }
+                if($b=='type' && !is_numeric($content_data[$b])) {
+
+                    if($node['mid'] ==2 ) {
+                        $data['data'][$k][$a] = $inter['arttype'][$content_data[$b]];
+                    }
+                    else{
+                        $data['data'][$k][$a] = $inter['vodtype'][$content_data[$b]];
+                    }
+                }
+            }
+
+
+            if($node['mid'] == '2'){
+                $res = model('Collect')->art_data([],$data,0);
+            }
+            else{
+                $res = model('Collect')->vod_data([],$data,0);
+            }
+            if($res['code'] ==1){
+                $update_ids[] = $v['id'];
+            }
+            mac_echo($res['msg']);
+        }
+
+        if(!empty($update_ids)){
+            $where=[];
+            $where['id'] = ['in',$update_ids];
+            $res = Db::name('cj_content')->where($where)->update(['status' => 3]);
+        }
+
+        if($this->_isall==1){
+            mac_echo('内容入库完成');
+            exit;
+        }
+
+
+        if ($total_page > $param['page']){
+            mac_echo('让服务器休息一会,稍后继续');
+            $param['page'] ++;
+            $link = url('cj/content_into') . '?'. http_build_query($param);
+            mac_jump( $link ,3);
+        }
+        else{
+            mac_echo('数据导入完成...');
+            exit;
+        }
+    }
+
+
+    //序列网址测试
+    public function show_url()
+    {
+        $param = input();
+        $data = $param['data'];
+        $data['urlpage'] = $param['urlpage'.$data['sourcetype']];
+        $collection = new cjOper();
+        $urls = $collection->url_list($data);
+
+        $this->assign('urls',$urls);
+
+        return $this->fetch('admin@cj/show_url');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['nodeid'] = ['in',$ids];
+            $res = model('Cj')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function export()
+    {
+        $param = input();
+
+        $where=[];
+        $where['nodeid'] = $param['id'];
+        $res = model('Cj')->infoData('cj_node',$where);
+        if($res['code']>1){
+            return $this->error('获取采集项目信息失败');
+        }
+        $node = $res['info'];
+
+        header("Content-type: application/octet-stream");
+        if(strpos($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
+            header("Content-Disposition: attachment; filename=mac_cj_" . urlencode($node['name']) . '.txt');
+        }
+        else{
+            header("Content-Disposition: attachment; filename=mac_cj_" . $node['name'] . '.txt');
+        }
+        echo base64_encode(json_encode($node));
+    }
+
+    public function import()
+    {
+        $file = $this->request->file('file');
+        $info = $file->rule('uniqid')->validate(['size' => 10240000, 'ext' => 'txt']);
+        if ($info) {
+            $data = json_decode(base64_decode(file_get_contents($info->getpathName())), true);
+            @unlink($info->getpathName());
+            if($data){
+                unset($data['nodeid']);
+                $res = model('Cj')->saveData($data);
+                if($res['code']>1){
+                    return $this->success($res['msg']);
+                }
+                return $this->success($res['msg']);
+            }
+            return $this->success('导入失败,请检查文件格式');
+        }
+        else{
+            return $this->error($file->getError());
+        }
+    }
+}

+ 465 - 0
application/admin/controller/Collect.php

@@ -0,0 +1,465 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+use think\Cache;
+
+class Collect extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) < 1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) < 1 ? 100 : $param['limit'];
+        $where = [];
+
+        $order = 'collect_id desc';
+        $res = model('Collect')->listData($where, $order, $param['page'], $param['limit']);
+
+        $this->assign('list', $res['list']);
+        $this->assign('total', $res['total']);
+        $this->assign('page', $res['page']);
+        $this->assign('limit', $res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param', $param);
+
+        $key = $GLOBALS['config']['app']['cache_flag']. '_'. 'collect_break_vod';
+        $collect_break_vod = Cache::get($key);
+        $key = $GLOBALS['config']['app']['cache_flag']. '_'. 'collect_break_art';
+        $collect_break_art = Cache::get($key);
+
+        $this->assign('collect_break_vod', $collect_break_vod);
+        $this->assign('collect_break_art', $collect_break_art);
+
+        $this->assign('title', '采集资源管理');
+        return $this->fetch('admin@collect/index');
+    }
+
+    public function test()
+    {
+        $param = input();
+        $res = model('Collect')->vod($param);
+        return json($res);
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input('post.');
+            $res = model('Collect')->saveData($param);
+            if ($res['code'] > 1) {
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+        $where = [];
+        $where['collect_id'] = ['eq', $id];
+        $res = model('Collect')->infoData($where);
+        $this->assign('info', $res['info']);
+        $this->assign('title', '采集接口信息');
+        return $this->fetch('admin@collect/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+
+        if (!empty($ids)) {
+            $where = [];
+            $where['collect_id'] = ['in', $ids];
+
+            $res = model('Collect')->delData($where);
+            if ($res['code'] > 1) {
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function union()
+    {
+        $key = $GLOBALS['config']['app']['cache_flag']. '_'. 'collect_break_vod';
+        $collect_break_vod = Cache::get($key);
+        $key = $GLOBALS['config']['app']['cache_flag']. '_'. 'collect_break_art';
+        $collect_break_art = Cache::get($key);
+
+        $this->assign('collect_break_vod', $collect_break_vod);
+        $this->assign('collect_break_art', $collect_break_art);
+
+        $this->assign('title', '联盟资源库');
+        return $this->fetch('admin@collect/union');
+    }
+
+    public function load()
+    {
+        $param = input();
+        $key = $GLOBALS['config']['app']['cache_flag']. '_'. 'collect_break_' . $param['flag'];
+        $collect_break = Cache::get($key);
+        $url = $this->_ref;
+        if (!empty($collect_break)) {
+            echo '正在载入断点位置,请稍后。。。';
+            $url = $collect_break;
+        }
+        mac_jump($url);
+    }
+
+    public function api($pp = [])
+    {
+        $param = input();
+        if (!empty($pp)) {
+            $param = $pp;
+        }
+
+        //分类
+        $type_list = model('Type')->getCache('type_list');
+        $this->assign('type_list', $type_list);
+
+        if (!empty($param['pg'])) {
+            $param['page'] = $param['pg'];
+            unset($param['pg']);
+        }
+        if ($param['mid'] == '' || $param['mid'] == '1') {
+            return $this->vod($param);
+        } elseif ($param['mid'] == '2') {
+            return $this->art($param);
+        } elseif ($param['mid'] == '8') {
+            return $this->actor($param);
+        }
+        elseif ($param['mid'] == '9') {
+            return $this->role($param);
+        }
+        elseif ($param['mid'] == '11') {
+            return $this->website($param);
+        }
+    }
+
+    public function timing()
+    {
+        //当日视频分类ids
+        $res = model('Vod')->updateToday('type');
+        $this->assign('vod_type_ids_today', $res['data']);
+
+        return $this->fetch('admin@collect/timing');
+    }
+
+    public function clearbind()
+    {
+        $param = input();
+        $config = [];
+        if(!empty($param['cjflag'])){
+            $bind_list = config('bind');
+            foreach($bind_list as $k=>$v){
+                if(strpos($k,$param['cjflag'])===false){
+                    $config[$k] = $v;
+                }
+            }
+        }
+
+        $res = mac_arr2file( APP_PATH .'extra/bind.php', $config);
+        if($res===false){
+            return json(['code'=>0,'msg'=>'清理失败,请重试!']);
+        }
+        return json(['code'=>1,'msg'=>'清理成功!']);
+    }
+
+    public function bind()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+
+        if(!empty($col)){
+            $config = config('bind');
+            $config[$col] = intval($val);
+            $data = [];
+            $data['id'] = $col;
+            $data['st'] = 0;
+            $data['local_type_id'] = $val;
+            $data['local_type_name'] = '';
+            if(intval($val)>0){
+                $data['st'] = 1;
+                $type_list = model('Type')->getCache('type_list');
+                $data['local_type_name'] = $type_list[$val]['type_name'];
+            }
+
+            $res = mac_arr2file( APP_PATH .'extra/bind.php', $config);
+            if($res===false){
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!',null, $data);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function vod($param)
+    {
+        if($param['ac'] != 'list'){
+            $key = $GLOBALS['config']['app']['cache_flag']. '_'.'collect_break_vod';
+            Cache::set($key, url('collect/api').'?'. http_build_query($param) );
+        }
+        $res = model('Collect')->vod($param);
+        if($res['code']>1){
+            return $this->error($res['msg']);
+        }
+
+        if($param['ac'] == 'list'){
+
+            $bind_list = config('bind');
+            $type_list = model('Type')->getCache('type_list');
+
+            foreach($res['type'] as $k=>$v){
+                $key = $param['cjflag'] . '_' . $v['type_id'];
+                $res['type'][$k]['isbind'] = 0;
+                $local_id = intval($bind_list[$key]);
+                if( $local_id>0 ){
+                    $res['type'][$k]['isbind'] = 1;
+                    $res['type'][$k]['local_type_id'] = $local_id;
+                    $type_name = $type_list[$local_id]['type_name'];
+                    if(empty($type_name)){
+                        $type_name = '未知分类';
+                    }
+                    $res['type'][$k]['local_type_name'] = $type_name;
+                }
+            }
+
+            $this->assign('page',$res['page']);
+            $this->assign('type',$res['type']);
+            $this->assign('list',$res['data']);
+
+            $this->assign('total',$res['page']['recordcount']);
+            $this->assign('page',$res['page']['page']);
+            $this->assign('limit',$res['page']['pagesize']);
+
+            $param['page'] = '{page}';
+            $param['limit'] = '{limit}';
+            $this->assign('param',$param);
+
+            $this->assign('param_str',http_build_query($param)) ;
+
+            return $this->fetch('admin@collect/vod');
+        }
+
+        mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+        model('Collect')->vod_data($param,$res );
+
+    }
+
+    public function art($param)
+    {
+        if($param['ac'] != 'list'){
+            $key = $GLOBALS['config']['app']['cache_flag']. '_'.'collect_break_art';
+            Cache::set($key, url('collect/api').'?'. http_build_query($param) );
+        }
+        $res = model('Collect')->art($param);
+        if($res['code']>1){
+            return $this->error($res['msg']);
+        }
+
+        if($param['ac'] == 'list'){
+
+            $bind_list = config('bind');
+            $type_list = model('Type')->getCache('type_list');
+
+            foreach($res['type'] as $k=>$v){
+                $key = $param['cjflag'] . '_' . $v['type_id'];
+                $res['type'][$k]['isbind'] = 0;
+                $local_id = intval($bind_list[$key]);
+                if( $local_id>0 ){
+                    $res['type'][$k]['isbind'] = 1;
+                    $res['type'][$k]['local_type_id'] = $local_id;
+                    $type_name = $type_list[$local_id]['type_name'];
+                    if(empty($type_name)){
+                        $type_name = '未知分类';
+                    }
+                    $res['type'][$k]['local_type_name'] = $type_name;
+                }
+            }
+
+            $this->assign('page',$res['page']);
+            $this->assign('type',$res['type']);
+            $this->assign('list',$res['data']);
+
+            $this->assign('total',$res['page']['recordcount']);
+            $this->assign('page',$res['page']['page']);
+            $this->assign('limit',$res['page']['pagesize']);
+
+            $param['page'] = '{page}';
+            $param['limit'] = '{limit}';
+            $this->assign('param',$param);
+
+            $this->assign('param_str',http_build_query($param)) ;
+
+            return $this->fetch('admin@collect/art');
+        }
+
+        mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+        model('Collect')->art_data($param,$res );
+    }
+
+    public function actor($param)
+    {
+        if($param['ac'] != 'list'){
+            $key = $GLOBALS['config']['app']['cache_flag']. '_'.'collect_break_actor';
+            Cache::set($key, url('collect/api').'?'. http_build_query($param) );
+        }
+        $res = model('Collect')->actor($param);
+        if($res['code']>1){
+            return $this->error($res['msg']);
+        }
+
+        if($param['ac'] == 'list'){
+
+            $bind_list = config('bind');
+            $type_list = model('Type')->getCache('type_list');
+
+            foreach($res['type'] as $k=>$v){
+                $key = $param['cjflag'] . '_' . $v['type_id'];
+                $res['type'][$k]['isbind'] = 0;
+                $local_id = intval($bind_list[$key]);
+                if( $local_id>0 ){
+                    $res['type'][$k]['isbind'] = 1;
+                    $res['type'][$k]['local_type_id'] = $local_id;
+                    $type_name = $type_list[$local_id]['type_name'];
+                    if(empty($type_name)){
+                        $type_name = '未知分类';
+                    }
+                    $res['type'][$k]['local_type_name'] = $type_name;
+                }
+            }
+
+            $this->assign('page',$res['page']);
+            $this->assign('type',$res['type']);
+            $this->assign('list',$res['data']);
+
+            $this->assign('total',$res['page']['recordcount']);
+            $this->assign('page',$res['page']['page']);
+            $this->assign('limit',$res['page']['pagesize']);
+
+            $param['page'] = '{page}';
+            $param['limit'] = '{limit}';
+            $this->assign('param',$param);
+
+            $this->assign('param_str',http_build_query($param)) ;
+
+            return $this->fetch('admin@collect/actor');
+        }
+
+        mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+        model('Collect')->actor_data($param,$res );
+    }
+
+    public function role($param)
+    {
+        if ($param['ac'] != 'list') {
+            $key = $GLOBALS['config']['app']['cache_flag']. '_'.'collect_break_role';
+            Cache::set($key, url('collect/api') . '?' . http_build_query($param));
+        }
+        $res = model('Collect')->role($param);
+        if ($res['code'] > 1) {
+            return $this->error($res['msg']);
+        }
+
+        if ($param['ac'] == 'list') {
+
+            $bind_list = config('bind');
+            $type_list = model('Type')->getCache('type_list');
+
+            foreach ($res['type'] as $k => $v) {
+                $key = $param['cjflag'] . '_' . $v['type_id'];
+                $res['type'][$k]['isbind'] = 0;
+                $local_id = intval($bind_list[$key]);
+                if ($local_id > 0) {
+                    $res['type'][$k]['isbind'] = 1;
+                    $res['type'][$k]['local_type_id'] = $local_id;
+                    $type_name = $type_list[$local_id]['type_name'];
+                    if (empty($type_name)) {
+                        $type_name = '未知分类';
+                    }
+                    $res['type'][$k]['local_type_name'] = $type_name;
+                }
+            }
+
+            $this->assign('page', $res['page']);
+            $this->assign('type', $res['type']);
+            $this->assign('list', $res['data']);
+
+            $this->assign('total', $res['page']['recordcount']);
+            $this->assign('page', $res['page']['page']);
+            $this->assign('limit', $res['page']['pagesize']);
+
+            $param['page'] = '{page}';
+            $param['limit'] = '{limit}';
+            $this->assign('param', $param);
+
+            $this->assign('param_str', http_build_query($param));
+
+            return $this->fetch('admin@collect/role');
+        }
+
+        mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+        model('Collect')->role_data($param,$res );
+    }
+
+    public function website($param)
+    {
+        if ($param['ac'] != 'list') {
+            $key = $GLOBALS['config']['app']['cache_flag']. '_'.'collect_break_website';
+            Cache::set($key, url('collect/api') . '?' . http_build_query($param));
+        }
+        $res = model('Collect')->website($param);
+        if ($res['code'] > 1) {
+            return $this->error($res['msg']);
+        }
+
+        if ($param['ac'] == 'list') {
+
+            $bind_list = config('bind');
+            $type_list = model('Type')->getCache('type_list');
+
+            foreach ($res['type'] as $k => $v) {
+                $key = $param['cjflag'] . '_' . $v['type_id'];
+                $res['type'][$k]['isbind'] = 0;
+                $local_id = intval($bind_list[$key]);
+                if ($local_id > 0) {
+                    $res['type'][$k]['isbind'] = 1;
+                    $res['type'][$k]['local_type_id'] = $local_id;
+                    $type_name = $type_list[$local_id]['type_name'];
+                    if (empty($type_name)) {
+                        $type_name = '未知分类';
+                    }
+                    $res['type'][$k]['local_type_name'] = $type_name;
+                }
+            }
+
+            $this->assign('page', $res['page']);
+            $this->assign('type', $res['type']);
+            $this->assign('list', $res['data']);
+
+            $this->assign('total', $res['page']['recordcount']);
+            $this->assign('page', $res['page']['page']);
+            $this->assign('limit', $res['page']['pagesize']);
+
+            $param['page'] = '{page}';
+            $param['limit'] = '{limit}';
+            $this->assign('param', $param);
+
+            $this->assign('param_str', http_build_query($param));
+
+            return $this->fetch('admin@collect/website');
+        }
+
+        mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+        model('Collect')->website_data($param,$res );
+    }
+}

+ 119 - 0
application/admin/controller/Comment.php

@@ -0,0 +1,119 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Comment extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function data()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+
+        $where=[];
+        if(in_array($param['status'],['0','1'],true)){
+            $where['comment_status'] = ['eq',$param['status']];
+        }
+        if(in_array($param['mid'],['1','2','3'])){
+            $where['comment_mid'] = ['eq',$param['mid']];
+        }
+        if(!empty($param['uid'])){
+            $where['user_id'] = ['eq',$param['uid'] ];
+        }
+        if(!empty($param['report'])){
+            if($param['report'] == 1){
+                $where['comment_report'] = ['eq',0];
+            }
+            else{
+                $where['comment_report'] = ['gt',0];
+            }
+        }
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['comment_name|comment_content'] = ['like','%'.$param['wd'].'%'];
+        }
+
+        $order='comment_id desc';
+        $res = model('Comment')->listData($where,$order,$param['page'],$param['limit']);
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+        $this->assign('title','评论管理');
+        return $this->fetch('admin@comment/index');
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input();
+            $res = model('Comment')->saveData($param);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+        $where=[];
+        $where['comment_id'] = ['eq',$id];
+        $res = model('Comment')->infoData($where);
+
+        $this->assign('info',$res['info']);
+        $this->assign('title','评论信息');
+        return $this->fetch('admin@comment/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $all = $param['all'];
+
+        if(!empty($ids) || !empty($all)){
+            $where=[];
+            $where['comment_id'] = ['in',$ids];
+            if($all==1){
+                $where['comment_id'] = ['gt',0];
+            }
+            $res = model('Comment')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+
+        if(!empty($ids) && in_array($col,['comment_status']) ){
+            $where=[];
+            $where['comment_id'] = ['in',$ids];
+
+            $res = model('Comment')->fieldData($where,$col,$val);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+
+}

+ 296 - 0
application/admin/controller/Database.php

@@ -0,0 +1,296 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+use app\common\util\Dir;
+use app\common\util\Database as dbOper;
+
+class Database extends Base
+{
+    var $_db_config;
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $group = input('group');
+        if($group=='import'){
+            //列出备份文件列表
+            $path = trim( $GLOBALS['config']['db']['backup_path'], '/').DS;
+            if (!is_dir($path)) {
+                Dir::create($path);
+            }
+            $flag = \FilesystemIterator::KEY_AS_FILENAME;
+            $glob = new \FilesystemIterator($path,  $flag);
+
+            $list = [];
+            foreach ($glob as $name => $file) {
+                if(preg_match('/^\d{8,8}-\d{6,6}-\d+\.sql(?:\.gz)?$/', $name)){
+                    $name = sscanf($name, '%4s%2s%2s-%2s%2s%2s-%d');
+                    $date = "{$name[0]}-{$name[1]}-{$name[2]}";
+                    $time = "{$name[3]}:{$name[4]}:{$name[5]}";
+                    $part = $name[6];
+
+                    if(isset($list["{$date} {$time}"])){
+                        $info = $list["{$date} {$time}"];
+                        $info['part'] = max($info['part'], $part);
+                        $info['size'] = $info['size'] + $file->getSize();
+                    } else {
+                        $info['part'] = $part;
+                        $info['size'] = $file->getSize();
+                    }
+
+                    $extension        = strtoupper($file->getExtension());
+                    $info['compress'] = ($extension === 'SQL') ? '无' : $extension;
+                    $info['time']     = strtotime("{$date} {$time}");
+
+                    $list["{$date} {$time}"] = $info;
+                }
+            }
+        }
+        else{
+            $group='export';
+            $list = Db::query("SHOW TABLE STATUS");
+        }
+
+        $this->assign('list',$list);
+        $this->assign('title','数据库管理');
+        return $this->fetch('admin@database/'.$group);
+    }
+
+    public function export($ids = '', $start = 0)
+    {
+        if ($this->request->isPost()) {
+            if (empty($ids)) {
+                return $this->error('请选择您要备份的数据表!');
+            }
+
+            if (!is_array($ids)) {
+                $tables[] = $ids;
+            } else {
+                $tables = $ids;
+            }
+            $have_admin = false;
+            $admin_table='';
+            foreach($tables as $k=>$v){
+                if(strpos($v,'_admin')!==false){
+                    $have_admin=true;
+                    $admin_table = $v;
+                    unset($tables[$k]);
+                }
+            }
+            if($have_admin){
+                $tables[] = $admin_table;
+            }
+
+            //读取备份配置
+            $config = array(
+                'path'     => $GLOBALS['config']['db']['backup_path'] .DS,
+                'part'     => $GLOBALS['config']['db']['part_size'] ,
+                'compress' => $GLOBALS['config']['db']['compress'] ,
+                'level'    => $GLOBALS['config']['db']['compress_level'] ,
+            );
+
+            //检查是否有正在执行的任务
+            $lock = "{$config['path']}backup.lock";
+            if(is_file($lock)){
+                return $this->error('检测到有一个备份任务正在执行,请稍后再试!');
+            } else {
+                if (!is_dir($config['path'])) {
+                    Dir::create($config['path'], 0755, true);
+                }
+                //创建锁文件
+                file_put_contents($lock, $this->request->time());
+            }
+
+            //生成备份文件信息
+            $file = [
+                'name' => date('Ymd-His', $this->request->time()),
+                'part' => 1,
+            ];
+
+            // 创建备份文件
+            $database = new dbOper($file, $config);
+            if($database->create() !== false) {
+                // 备份指定表
+                foreach ($tables as $table) {
+                    $start = $database->backup($table, $start);
+                    while (0 !== $start) {
+                        if (false === $start) {
+                            return $this->error('备份出错!');
+                        }
+                        $start = $database->backup($table, $start[0]);
+                    }
+                }
+                // 备份完成,删除锁定文件
+                unlink($lock);
+            }
+            return $this->success('备份完成。');
+        }
+        return $this->error('备份出错!');
+    }
+
+    /**
+     * 恢复数据库 [参考原作者 麦当苗儿 <[email protected]>]
+     * @param string|array $ids 表名
+     * @param integer $start 起始行数
+     * @author 橘子俊 <[email protected]>
+     * @return mixed
+     */
+    public function import($id = '')
+    {
+        if (empty($id)) {
+            return $this->error('请选择您要恢复的备份文件!');
+        }
+
+        $name  = date('Ymd-His', $id) . '-*.sql*';
+        $path  = trim( $GLOBALS['config']['db']['backup_path'] , '/').DS.$name;
+        $files = glob($path);
+        $list  = array();
+        foreach($files as $name){
+            $basename = basename($name);
+            $match    = sscanf($basename, '%4s%2s%2s-%2s%2s%2s-%d');
+            $gz       = preg_match('/^\d{8,8}-\d{6,6}-\d+\.sql.gz$/', $basename);
+            $list[$match[6]] = array($match[6], $name, $gz);
+        }
+        ksort($list);
+
+        // 检测文件正确性
+        $last = end($list);
+        if(count($list) === $last[0]){
+            foreach ($list as $item) {
+                $config = [
+                    'path'     => trim($GLOBALS['config']['db']['backup_path'], '/').DS,
+                    'compress' => $item[2]
+                ];
+                $database = new dbOper($item, $config);
+                $start = $database->import(0);
+                // 导入所有数据
+                while (0 !== $start) {
+                    if (false === $start) {
+                        return $this->error('数据恢复出错!');
+                    }
+                    $start = $database->import($start[0]);
+                }
+            }
+            return $this->success('数据恢复完成。');
+        }
+        return $this->error('备份文件可能已经损坏,请检查!');
+    }
+
+    public function optimize($ids = '')
+    {
+        if (empty($ids)) {
+            return $this->error('请选择您要优化的数据表!');
+        }
+
+        if (!is_array($ids)) {
+            $table[] = $ids;
+        } else {
+            $table = $ids;
+        }
+
+        $tables = implode('`,`', $table);
+        $res = Db::query("OPTIMIZE TABLE `{$tables}`");
+        if ($res) {
+            return $this->success('数据表优化完成。');
+        }
+        return $this->error('数据表优化失败!');
+    }
+
+    public function repair($ids = '')
+    {
+        if (empty($ids)) {
+            return $this->error('请选择您要修复的数据表!');
+        }
+
+        if (!is_array($ids)) {
+            $table[] = $ids;
+        } else {
+            $table = $ids;
+        }
+
+        $tables = implode('`,`', $table);
+        $res = Db::query("REPAIR TABLE `{$tables}`");
+        if ($res) {
+            return $this->success('数据表修复完成。');
+        }
+        return $this->error('数据表修复失败!');
+    }
+
+
+    public function del($id = '')
+    {
+        if (empty($id)) {
+            return $this->error('请选择您要删除的备份文件!');
+        }
+
+        $name  = date('Ymd-His', $id) . '-*.sql*';
+        $path = trim($GLOBALS['config']['db']['backup_path']).DS.$name;
+        array_map("unlink", glob($path));
+        if(count(glob($path)) && glob($path)){
+            return $this->error('备份文件删除失败,请检查权限!');
+        }
+        return $this->success('备份文件删除成功。');
+    }
+
+    public function sql()
+    {
+        if($this->request->isPost()){
+            $param=input();
+            $sql = trim($param['sql']);
+
+            if(!empty($sql)){
+                $sql = str_replace('{pre}',config('database.prefix'),$sql);
+                //查询语句返回结果集
+                if(strtolower(substr($sql,0,6))=="select"){
+
+                }
+                else{
+                    Db::execute($sql);
+                }
+            }
+            $this->success('执行成功');
+        }
+        return $this->fetch('admin@database/sql');
+    }
+
+    public function columns()
+    {
+        $param = input();
+        $table = $param['table'];
+        if(!empty($table)){
+            $list = Db::query('SHOW COLUMNS FROM '.$table);
+            $this->success('获取成功',null, $list);
+        }
+        $this->error('参数错误');
+    }
+
+
+    public function rep()
+    {
+
+        if($this->request->isPost()){
+
+            $param = input();
+            $table = $param['table'];
+            $field = $param['field'];
+            $findstr = $param['findstr'];
+            $tostr = $param['tostr'];
+            $where = $param['where'];
+
+            if(!empty($table) && !empty($field) && !empty($findstr) && !empty($tostr)){
+                $sql = "UPDATE ".$table." set ".$field."=Replace(".$field.",'".$findstr."','".$tostr."') where 1=1 ". $where;
+                Db::execute($sql);
+                return $this->success('执行成功');
+            }
+
+            return $this->error('参数错误');
+        }
+        $list = Db::query("SHOW TABLE STATUS");
+        $this->assign('list',$list);
+        return $this->fetch('admin@database/rep');
+    }
+
+}

+ 120 - 0
application/admin/controller/Domain.php

@@ -0,0 +1,120 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+use think\Config;
+use think\Cache;
+
+class Domain extends Base
+{
+
+    public function index()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+
+            $tmp = $config['domain'];
+            $domain=[];
+
+
+
+            foreach ($tmp['site_url'] as $k=>$v){
+
+                $domain[$v] =[
+                   'site_url'=>$v,
+                    'site_name'=>$tmp['site_name'][$k],
+                    'site_keywords'=>$tmp['site_keywords'][$k],
+                    'site_description'=>$tmp['site_description'][$k],
+                    'template_dir'=>$tmp['template_dir'][$k],
+                    'html_dir'=>$tmp['html_dir'][$k],
+                    'ads_dir'=>$tmp['ads_dir'][$k],
+                ];
+
+            }
+
+
+            $res = mac_arr2file(APP_PATH . 'extra/domain.php', $domain);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+
+        $templates = glob('./template' . '/*', GLOB_ONLYDIR);
+        foreach ($templates as $k => &$v) {
+            $v = str_replace('./template/', '', $v);
+        }
+        $this->assign('templates', $templates);
+
+        $config = config('domain');
+        $this->assign('domain_list', $config);
+        $this->assign('title', '站群参数配置');
+        return $this->fetch('admin@domain/index');
+    }
+
+    public function del()
+    {
+        $param = input();
+        if(!empty($param['ids'])){
+            $list = config('domain');
+            unset($list[$param['ids']]);
+            $res = mac_arr2file( APP_PATH .'extra/domain.php', $list);
+            if($res===false){
+                return $this->error('删除失败,请重试!');
+            }
+        }
+        return $this->success('删除成功');
+    }
+
+    public function export()
+    {
+        $list = config('domain');
+        $html = '';
+        foreach($list as $k=>$v){
+            $html .= $v['site_url'].'$'.$v['site_name'].'$'.$v['site_keywords'].'$'.$v['site_description'].'$'.$v['template_dir'].'$'.$v['html_dir'].'$'.$v['ads_dir']."\n";
+        }
+
+        header("Content-type: application/octet-stream");
+        header("Content-Disposition: attachment; filename=mac_domains.txt");
+        echo $html;
+    }
+
+    public function import()
+    {
+        $file = $this->request->file('file');
+        $info = $file->rule('uniqid')->validate(['size' => 10240000, 'ext' => 'txt']);
+        if ($info) {
+            $data = file_get_contents($info->getpathName());
+            @unlink($info->getpathName());
+            if($data){
+                $list = explode(chr(10),$data);
+
+                $domain =[];
+
+                foreach($list as $k=>$v){
+                    if(!empty($v)) {
+                        $one = explode('$', $v);
+                        $domain[$one[0]] = [
+                            'site_url' => $one[0],
+                            'site_name' => $one[1],
+                            'site_keywords' => $one[2],
+                            'site_description' => $one[3],
+                            'template_dir' => $one[4],
+                            'html_dir' => $one[5],
+                            'ads_dir'=>$one[6],
+                        ];
+                    }
+                }
+
+                $res = mac_arr2file( APP_PATH .'extra/domain.php', $domain);
+                if($res===false){
+                    return $this->error('保存配置文件失败,请重试!');
+                }
+            }
+            return $this->success('导入失败,请检查文件格式');
+        }
+        else{
+            return $this->error($file->getError());
+        }
+    }
+}

+ 119 - 0
application/admin/controller/Gbook.php

@@ -0,0 +1,119 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Gbook extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function data()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+
+        $where=[];
+        if(in_array($param['status'],['0','1'],true)){
+            $where['gbook_status'] = ['eq',$param['status']];
+        }
+        if(in_array($param['type'],['1','2'])){
+            if($param['type'] == 1){
+                $where['gbook_rid'] = 0;
+            }
+            elseif($param['type'] ==2){
+                $where['gbook_rid'] = ['gt',0];
+            }
+        }
+        if(!empty($param['reply'])){
+            $where['gbook_reply_time'] = ['gt', 0];
+        }
+        if(!empty($param['uid'])){
+            $where['user_id'] = ['eq',$param['uid'] ];
+        }
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['gboook_name|gbook_content'] = ['like','%'.$param['wd'].'%'];
+        }
+
+
+        $order='gbook_id desc';
+        $res = model('Gbook')->listData($where,$order,$param['page'],$param['limit']);
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+        $this->assign('title','留言本管理');
+        return $this->fetch('admin@gbook/index');
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input();
+            $res = model('Gbook')->saveData($param);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+        $where=[];
+        $where['gbook_id'] = ['eq',$id];
+        $res = model('Gbook')->infoData($where);
+
+        $this->assign('info',$res['info']);
+        $this->assign('title','留言本信息');
+        return $this->fetch('admin@gbook/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $all = $param['all'];
+
+        if(!empty($ids) || !empty($all)){
+            $where=[];
+            $where['gbook_id'] = ['in',$ids];
+            if($all==1){
+                $where['gbook_id'] = ['gt',0];
+            }
+            $res = model('Gbook')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+
+        if(!empty($ids) && in_array($col,['gbook_status']) ){
+            $where=[];
+            $where['gbook_id'] = ['in',$ids];
+
+            $res = model('Gbook')->fieldData($where,$col,$val);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+}

+ 109 - 0
application/admin/controller/Group.php

@@ -0,0 +1,109 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Group extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $param = input();
+        $where=[];
+
+        if(in_array($param['status'],['0','1'],true)){
+            $where['group_status'] = ['eq',$param['status']];
+        }
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['group_name'] = ['like','%'.$param['wd'].'%'];
+        }
+
+        $order='group_id asc';
+        $res = model('Group')->listData($where,$order);
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+
+        $this->assign('param',$param);
+        $this->assign('title','会员组管理');
+        return $this->fetch('admin@group/index');
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input('post.');
+
+            if($GLOBALS['config']['user']['reg_group'] == $param['group_id']){
+                $param['group_status'] = 1;
+            }
+            $res = model('Group')->saveData($param);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+        $where=[];
+        $where['group_id'] = ['eq',$id];
+        $res = model('Group')->infoData($where);
+
+        $this->assign('info',$res['info']);
+
+
+        $type_tree = model('Type')->getCache('type_tree');
+        $this->assign('type_tree',$type_tree);
+
+        $this->assign('title','会员组信息');
+        return $this->fetch('admin@group/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+
+        if(!empty($ids)){
+
+            if(strpos(','.$ids.',', ','.$GLOBALS['config']['user']['reg_group'].',')!==false){
+                return $this->error('注册默认会员组无法删除');
+            }
+
+            $where=[];
+            $where['group_id'] = ['in',$ids];
+            $res = model('Group')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+
+        if(!empty($ids) && in_array($col,['group_status']) && in_array($val,['0','1'])){
+            $where=[];
+            $where['group_id'] = ['in',$ids];
+
+            $res = model('Group')->fieldData($where,$col,$val);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+
+}

+ 310 - 0
application/admin/controller/Images.php

@@ -0,0 +1,310 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Images extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $path = input('path');
+        $path = str_replace('\\','',$path);
+        $path = str_replace('/','',$path);
+
+        if(empty($path)){
+            $path = '@upload';
+        }
+
+        if(substr($path,0,7) != "@upload") { $path = "@upload"; }
+        if(count( explode("..@",$path) ) > 1) {
+            $this->error('非法目录请求');
+            return;
+        }
+
+
+        $uppath = substr($path,0,strrpos($path,"@"));
+
+        $ischild = 0;
+        if ($path !="@upload"){
+            $ischild = 1;
+        }
+        $this->assign('uppath',$uppath);
+        $this->assign('ischild',$ischild);
+
+
+        $num_path = 0;
+        $num_file = 0;
+        $sum_size = 0;
+        $filters = ",,cache,break,artcollect,downdata,playdata,export,vodcollect,";
+        $files = [];
+
+        $pp = str_replace('@','/',$path);
+
+        if(is_dir('.'.$pp)){
+
+            $farr = glob('.'.$pp.'/*');
+            if($farr){
+                foreach($farr as $f){
+
+                    if ( is_dir($f) ){
+
+                        if(strpos($filters,",".$f.",")<=0){
+                            $num_path++;
+                            $tmp_path = str_replace('./upload/','@upload/',$f);
+                            $tmp_path = str_replace('/','@',$tmp_path);
+
+                            $tmp_name = str_replace($path.'@','',$tmp_path);
+
+
+                            $files[] = ['isfile'=>0,'name'=>$tmp_name,'path'=>$tmp_path];
+                        }
+                    }
+                    elseif(is_file($f)){
+                        if (strpos($f,".html") <=0 && strpos($f,".htm") <=0){
+                            $num_file++;
+                            $fsize = filesize($f);
+                            $sum_size += $fsize;
+                            $fsize = mac_format_size($fsize);
+                            $ftime = filemtime($f);
+                            $tmp_path = mac_convert_encoding($f,"UTF-8","GB2312");
+
+                            $tmp_path = str_replace('./upload/','@upload/',$f);
+                            $tmp_path = str_replace('/','@',$tmp_path);
+
+                            $tmp_name = str_replace($path.'@',"",$tmp_path);
+                            $tmp_path = str_replace('@','/',$tmp_path);
+
+                            $files[] = ['isfile'=>1,'name'=>$tmp_name,'path'=>$tmp_path, 'size'=>$fsize, 'time'=>$ftime];
+                        }
+                    }
+
+                }
+            }
+        }
+        $this->assign('sum_size',mac_format_size($sum_size));
+        $this->assign('num_file',$num_file);
+        $this->assign('num_path',$num_path);
+
+        $this->assign('files',$files);
+
+        $this->assign('title','图片管理');
+        return $this->fetch('admin@images/index');
+    }
+
+    public function opt()
+    {
+        $param = input();
+        $this->assign('tab',$param['tab']);
+        return $this->fetch('admin@images/opt');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $fname = $param['ids'];
+        if(!empty($fname)){
+            foreach($fname as $a){
+                $a = str_replace('\\','/',$a);
+
+                if( (substr($a,0,8) != "./upload") || count( explode("./",$a) ) > 2) {
+
+                }
+                else{
+                    $a = mac_convert_encoding($a,"UTF-8","GB2312");
+                    if(file_exists($a)){ @unlink($a); }
+                }
+            }
+        }
+        return $this->success('删除成功');
+    }
+
+    public function sync()
+    {
+        $param = input();
+
+        $param['page'] = intval($param['page']) < 1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) < 10 ? 10 : $param['limit'];
+        $flag = "#err". date('Y-m-d',time());
+
+        if($param['tab']=='vod'){
+            $tab='vod';
+            $col_id ='vod_id';
+            $col_name ='vod_name';
+            $col_pic= $param['col']==2 ? 'vod_content' : 'vod_pic';
+            $col_time='vod_time';
+
+        }
+        elseif($param['tab']=='art'){
+            $tab='art';
+            $col_id ='art_id';
+            $col_name ='art_name';
+            $col_pic= $param['col']==2 ? 'art_content' :'art_pic';
+            $col_time='art_time';
+        }
+        elseif($param['tab']=='topic'){
+            $tab='topic';
+            $col_id ='topic_id';
+            $col_name ='topic_name';
+            $col_pic=$param['col']==2 ? 'topic_content' :'topic_pic';
+            $col_time='topic_time';
+        }
+        elseif($param['tab']=='actor'){
+            $tab='actor';
+            $col_id ='actor_id';
+            $col_name ='actor_name';
+            $col_pic=$param['col']==2 ? 'actor_content' :'actor_pic';
+            $col_time='actor_time';
+        }
+        elseif($param['tab']=='role'){
+            $tab='role';
+            $col_id ='role_id';
+            $col_name ='role_name';
+            $col_pic=$param['col']==2 ? 'role_content' :'role_pic';
+            $col_time='role_time';
+        }
+        elseif($param['tab']=='website'){
+            $tab='website';
+            $col_id ='website_id';
+            $col_name ='website_name';
+            $col_pic=$param['col']==2 ? 'website_content' :'website_pic';
+            $col_time='website_time';
+        }
+        else{
+            return $this->error('参数错误');
+        }
+
+        $where = ' 1=1 ';
+        if ($param['range'] =="2" && $param['date']!=""){
+            $pic_fwdate = str_replace('|','-',$param['date']);
+            $todayunix1 = strtotime($pic_fwdate);
+            $todayunix2 = $todayunix1 +  86400;
+            $where .= ' AND ('.$col_time.'>= '. $todayunix1 . ' AND '.$col_time.'<='. $todayunix2 .') ';
+        }
+        if($param['col'] == 2){
+            $where .= ' and '. $col_pic . " like '%<img%src=\"http%' ";
+        }
+        else {
+            if ($param['opt'] == 1) {
+                $where .= " AND instr(" . $col_pic . ",'#err')=0 ";
+            } elseif ($param['opt'] == 2) {
+                $where .= " AND instr(" . $col_pic . ",'" . $flag . "')=0 ";
+            } elseif ($param['opt'] == 3) {
+                $where .= " AND instr(" . $col_pic . ",'#err')>0 ";
+            }
+            $where .= " AND instr(" . $col_pic . ",'http')>0  ";
+        }
+
+        $total = Db::name($tab)->where($where)->count();
+        $page_count = ceil($total / $param['limit']);
+
+        if($total==0){
+            mac_echo('同步操作完毕');
+            exit;
+        }
+
+        mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+        mac_echo('<span>共'.$total.'条数据需要处理,每页'.$param['limit'].'条,共'.$page_count.'页,正在处理第'.$param['page'].'页数据</span>');
+
+        $list = Db::name($tab)->where($where)->page($page_count-1,$param['limit'])->select();
+        $config = config('maccms.upload');
+
+        if ($config['mode'] == '2') {
+            $config['mode'] = 'upyun';
+        }
+        elseif ($config['mode'] == '3'){
+            $config['mode'] = 'qiniu';
+        }
+        elseif ($config['mode'] == '4') {
+            $config['mode'] = 'ftp';
+        }
+        elseif ($config['mode'] == '5') {
+            $config['mode'] = 'weibo';
+        }
+
+
+        foreach($list as $k=>$v){
+
+            mac_echo($v[$col_id].'、'.$v[$col_name]);
+
+            if($param['col'] == 2){
+                $content = $v[$col_pic];
+                $rule = mac_buildregx("<img[^>]*src\s*=\s*['".chr(34)."]?([\w/\-\:.]*)['".chr(34)."]?[^>]*>","is");
+                preg_match_all($rule,$content,$matches);
+
+                $matchfieldarr=$matches[1];
+                $matchfieldstrarr=$matches[0];
+                $matchfieldvalue="";
+                foreach($matchfieldarr as $f=>$matchfieldstr)
+                {
+                    $matchfieldvalue=$matchfieldstrarr[$f];
+                    $img_old = trim(preg_replace("/[ \r\n\t\f]{1,}/"," ",$matchfieldstr));
+
+                    $img_url = model('Image')->down_load($img_old, $config, $param['tab']);
+                    $des = '';
+                    if(in_array($config['mode'],['local'])){
+                        $img_url = MAC_PATH . $img_url;
+                        $link = $img_url;
+                    }
+                    else{
+                        $link = str_replace('mac:', $config['protocol'].':', $img_url);
+                    }
+                    if ($img_url == $img_old) {
+                        $des = '<a href="' . $link . '" target="_blank">' . $link . '</a><font color=red>下载失败!</font>';
+                        $img_url .= $flag;
+                        $content = str_replace($img_old,"",$content);
+                    } else {
+                        $des = '<a href="' . $link . '" target="_blank">' . $link . '</a><font color=green>下载成功!</font>';
+                        $content = str_replace($img_old, $img_url, $content );
+                    }
+                    mac_echo($des);
+                }
+
+                $where = [];
+                $where[$col_id] = $v[$col_id];
+                $update = [];
+                $update[$col_pic] = $content;
+                $st = Db::name($tab)->where($where)->update($update);
+            }
+            else {
+                $img_old = $v[$col_pic];
+                if (strpos($img_old, "#err")) {
+                    $picarr = explode("#err", $img_old);
+                    $img_old = $picarr[0];
+                }
+
+                $img_url = model('Image')->down_load($img_old, $config, $param['tab']);
+                $des = '';
+                
+                if(in_array($config['mode'],['local'])){
+
+                }
+                else{
+                    $link = str_replace('mac:', $config['protocol'].':', $img_url);
+                }
+
+                if ($img_url == $img_old) {
+                    $des = '<a href="' . $link . '" target="_blank">' . $link . '</a><font color=red>下载失败!</font>';
+                    $img_url .= $flag;
+                } else {
+                    $des = '<a href="' . $link . '" target="_blank">' . $link . '</a><font color=green>下载成功!</font>';
+                }
+                mac_echo($des);
+
+                $where = [];
+                $where[$col_id] = $v[$col_id];
+                $update = [];
+                $update[$col_pic] = $img_url;
+                $st = Db::name($tab)->where($where)->update($update);
+            }
+        }
+
+        $url = url('images/sync') .'?'. http_build_query($param);
+        mac_jump( $url ,3);
+    }
+
+
+}

+ 221 - 0
application/admin/controller/Index.php

@@ -0,0 +1,221 @@
+<?php
+namespace app\admin\controller;
+use think\Hook;
+
+class Index extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function login()
+    {
+        if(Request()->isPost()) {
+            $data = input('post.');
+            $res = model('Admin')->login($data);
+            if ($res['code'] > 1) {
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        Hook::listen("admin_login_init", $this->request);
+        return $this->fetch('admin@index/login');
+    }
+
+    public function logout()
+    {
+        $res = model('Admin')->logout();
+        $this->redirect('index/login');
+    }
+
+    public function index()
+    {
+        $menus = @include MAC_ADMIN_COMM . 'auth.php';
+
+        foreach($menus as $k1=>$v1){
+            foreach($v1['sub'] as $k2=>$v2){
+                if($v2['show'] == 1) {
+                    if(strpos($v2['action'],'javascript')!==false){
+                        $url = $v2['action'];
+                    }
+                    else {
+                        $url = url('admin/' . $v2['controller'] . '/' . $v2['action']);
+                    }
+                    if (!empty($v2['param'])) {
+                        $url .= '?' . $v2['param'];
+                    }
+                    if ($this->check_auth($v2['controller'], $v2['action'])) {
+                        $menus[$k1]['sub'][$k2]['url'] = $url;
+                    } else {
+                        unset($menus[$k1]['sub'][$k2]);
+                    }
+                }
+                else{
+                    unset($menus[$k1]['sub'][$k2]);
+                }
+            }
+
+            if(empty($menus[$k1]['sub'])){
+                unset($menus[$k1]);
+            }
+        }
+
+        $quickmenu = mac_read_file( APP_PATH.'data/config/quickmenu.txt');
+        if(!empty($quickmenu)){
+            $menus[1]['sub'][13] = ['name'=>'↓↓↓自定义菜单区域↓↓↓', 'url'=>'javascript:void(0);return false;','controller'=>'', 'action'=>'' ];
+            $arr = explode(chr(13),$quickmenu);
+            foreach($arr as $k=>$v){
+                if(empty($v)){
+                    continue;
+                }
+                $one = explode(',',trim($v));
+                if(substr($one[1],0,4)=='http' || substr($one[1],0,2)=='//'){
+
+                }
+                elseif(substr($one[1],0,1) =='/'){
+
+                }
+                elseif(strpos($one[1],'###')!==false || strpos($one[1],'javascript:')!==false){
+
+                }
+                else{
+                    $one[1] = url($one[1]);
+                }
+                $menus[1]['sub'][14 + $k] = ['name'=>$one[0], 'url'=>$one[1],'controller'=>'', 'action'=>'' ];
+            }
+        }
+        $this->assign('menus',$menus);
+
+        $this->assign('title','后台管理中心');
+        return $this->fetch('admin@index/index');
+    }
+
+    public function welcome()
+    {
+        $version = config('version');
+        $update_sql = file_exists('./application/data/update/database.php');
+
+        $this->assign('version',$version);
+        $this->assign('update_sql',$update_sql);
+
+
+        $this->assign('info',$this->_admin);
+        $this->assign('title','欢迎页面');
+        return $this->fetch('admin@index/welcome');
+    }
+
+    public function quickmenu()
+    {
+        if(Request()->isPost()){
+            $quickmenu = input('post.quickmenu');
+            @fwrite(fopen(APP_PATH.'data/config/quickmenu.txt','wb'),$quickmenu);
+            $this->success('保存成功,跳转中!');
+        }
+        else{
+            $quickmenu = mac_read_file(APP_PATH.'data/config/quickmenu.txt');
+            $this->assign('quickmenu',$quickmenu);
+            $this->assign('title','快捷菜单配置');
+            return $this->fetch('admin@index/quickmenu');
+        }
+    }
+
+    public function clear()
+    {
+        $res = $this->_cache_clear();
+        //运行缓存
+        if(!$res) {
+            $this->error('缓存清理失败!');
+        }
+        return $this->success('缓存清理成功!');
+    }
+
+    public function iframe()
+    {
+        $val = input('post.val', 0);
+        if ($val != 0 && $val != 1) {
+            return $this->error('缓存清理成功!');
+        }
+        if ($val == 1) {
+            cookie('hisi_iframe', 'yes');
+        } else {
+            cookie('hisi_iframe', null);
+        }
+        return $this->success('布局切换成功,跳转中!');
+    }
+
+    public function unlocked()
+    {
+        $param = input();
+        $password = $param['password'];
+
+        if($this->_admin['admin_pwd'] != md5($password)){
+            return $this->error('密码错误');
+        }
+
+        return $this->success('解锁成功');
+    }
+
+    public function check_back_link()
+    {
+        $param = input();
+        $res = mac_check_back_link($param['url']);
+        return json($res);
+    }
+
+    public function select()
+    {
+        $param = input();
+        $tpl = $param['tpl'];
+        $tab = $param['tab'];
+        $col = $param['col'];
+        $ids = $param['ids'];
+        $url = $param['url'];
+        $val = $param['val'];
+
+        $refresh = $param['refresh'];
+
+        if(empty($tpl) || empty($tab) || empty($col) || empty($ids) || empty($url)){
+            return $this->error('参数错误');
+        }
+
+        if(is_array($ids)){
+            $ids = join(',',$ids);
+        }
+
+        if(empty($refresh)){
+            $refresh = 'yes';
+        }
+
+        $url = url($url);
+        $mid = 1;
+        if($tab=='art'){
+            $mid = 2;
+        }
+        elseif($tab=='actor'){
+            $mid=8;
+        }
+        elseif($tab=='website'){
+            $mid=11;
+        }
+        $this->assign('mid',$mid);
+
+        if($tpl=='select_type'){
+            $type_tree = model('Type')->getCache('type_tree');
+            $this->assign('type_tree',$type_tree);
+        }
+        elseif($tpl =='select_level'){
+            $level_list = [1,2,3,4,5,6,7,8,9];
+            $this->assign('level_list',$level_list);
+        }
+
+        $this->assign('refresh',$refresh);
+        $this->assign('url',$url);
+        $this->assign('tab',$tab);
+        $this->assign('col',$col);
+        $this->assign('ids',$ids);
+        $this->assign('val',$val);
+        return $this->fetch( 'admin@public/'.$tpl);
+    }
+
+}

+ 101 - 0
application/admin/controller/Link.php

@@ -0,0 +1,101 @@
+<?php
+namespace app\admin\controller;
+
+class Link extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+        $where=[];
+
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['link_name'] = ['like','%'.$param['wd'].'%'];
+        }
+
+        $order='link_id desc';
+        $res = model('Link')->listData($where,$order,$param['page'],$param['limit']);
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+        $this->assign('title','友情链接管理');
+        return $this->fetch('admin@link/index');
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input();
+            $res = model('Link')->saveData($param);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+        $where=[];
+        $where['link_id'] = ['eq',$id];
+        $res = model('Link')->infoData($where);
+
+
+        $this->assign('info',$res['info']);
+        $this->assign('title','友情链接信息');
+        return $this->fetch('admin@link/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['link_id'] = ['in',$ids];
+            $res = model('Link')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function batch()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        foreach ($ids as $k=>$id) {
+            $data = [];
+            $data['link_id'] = intval($id);
+            $data['link_name'] = $param['link_name'][$k];
+            $data['link_sort'] = $param['link_sort'][$k];
+            $data['link_url'] = $param['link_url'][$k];
+            $data['link_type'] = intval($param['link_type'][$k]);
+            $data['link_logo'] = $param['link_logo'][$k];
+
+            if (empty($data['link_name'])) {
+                $data['link_name'] = '未知';
+            }
+            $res = model('Link')->saveData($data);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+        }
+        $this->success($res['msg']);
+    }
+
+}

+ 910 - 0
application/admin/controller/Make.php

@@ -0,0 +1,910 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+use think\View;
+
+class Make extends Base
+{
+    var $_param;
+
+    public function __construct()
+    {
+        parent::__construct();
+        $this->_param = input();
+        $GLOBALS['ismake'] = '1';
+    }
+
+    protected function buildHtml($htmlfile='',$htmlpath='',$templateFile='') {
+        if(empty($htmlfile) || empty($htmlpath) || empty($templateFile)){
+            return false;
+        }
+        $content    =   $this->label_fetch($templateFile);
+        $htmlfile = reset_html_filename($htmlfile);
+        $dir   =  dirname($htmlfile);
+        if(!is_dir($dir)){
+            mkdir($dir,0777,true);
+        }
+        if(file_put_contents($htmlfile,$content) === false) {
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    protected function echoLink($des,$url='',$color='',$wrap=1)
+    {
+        if(empty($url)){
+            echo  "<font color=$color>" .$des .'</font>'. ($wrap==1? '<br>':'&nbsp;');
+        }
+        else{
+            echo  '<a target="_blank" href="'. $url .'">'. "<font color=$color>" . $des .'</font></a>'. ($wrap==1? '<br>':'&nbsp;');
+        }
+        ob_flush();flush();
+    }
+
+    public function opt()
+    {
+        //分类列表
+        $type_list = model('Type')->getCache('type_list');
+        $this->assign('type_list',$type_list);
+
+        $vod_type_list = [];
+        $vod_type_ids = [];
+        $art_type_list = [];
+        $art_type_ids = [];
+        foreach($type_list as $k=>$v){
+            if($v['type_mid'] == 1){
+                $vod_type_list[$k] = $v;
+            }
+            if($v['type_mid'] == 2){
+                $art_type_list[$k] = $v;
+            }
+        }
+        $vod_type_ids = array_keys($vod_type_list);
+        $art_type_ids = array_keys($art_type_list);
+
+        $this->assign('vod_type_list',$vod_type_list);
+        $this->assign('art_type_list',$art_type_list);
+
+        $this->assign('vod_type_ids',join(',',$vod_type_ids));
+        $this->assign('art_type_ids',join(',',$art_type_ids));
+
+
+
+        //当日视频分类ids
+        $res = model('Vod')->updateToday('type');
+        $this->assign('vod_type_ids_today',$res['data']);
+
+        //当日文章分类ids
+        $res = model('Art')->updateToday('type');
+        $this->assign('art_type_ids_today',$res['data']);
+
+
+        //专题列表
+        $where = [];
+        $where['topic_status'] = ['eq',1];
+        $order = 'topic_id desc';
+        $topic_list = model('Topic')->listData($where,$order,1,999);
+        $this->assign('topic_list',$topic_list['list']);
+        $topic_ids = join(',',array_keys($topic_list['list']));
+        $this->assign('topic_ids',$topic_ids);
+
+        //自定义页面
+        $label_list = [];
+        $path = MAC_ROOT_TEMPLATE .'label';
+        if(is_dir($path)){
+            $farr = glob($path.'/*');
+            foreach($farr as $f){
+                if(is_file($f)){
+                    $f = str_replace($path."/","",$f);
+                    $label_list[] = $f;
+                }
+            }
+            unset($farr);
+        }
+        $this->assign('label_list',$label_list);
+        $this->assign('label_ids',join(',',$label_list));
+
+
+        $this->assign('title','生成静态管理');
+        return $this->fetch('admin@make/opt');
+
+    }
+
+    public function make($pp=[])
+    {
+        mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+
+        if(!empty($pp)){
+            $this->_param = $pp;
+        }
+
+        if($this->_param['ac'] == 'index'){
+            $this->index();
+        }
+        elseif($this->_param['ac'] == 'map'){
+            $this->map();
+        }
+        elseif($this->_param['ac'] == 'rss'){
+            $this->rss();
+        }
+        elseif($this->_param['ac'] == 'type'){
+            $this->type();
+        }
+        elseif($this->_param['ac'] == 'topic_index'){
+            $this->topic_index();
+        }
+        elseif($this->_param['ac'] == 'topic_info'){
+            $this->topic_info();
+        }
+        elseif($this->_param['ac'] == 'rss'){
+            $this->rss();
+        }
+        elseif($this->_param['ac'] == 'info'){
+            $this->info();
+        }
+        elseif($this->_param['ac'] == 'label'){
+            $this->label();
+        }
+    }
+
+    public function index()
+    {
+        mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+
+        $GLOBALS['aid'] = mac_get_aid('index');
+        $this->label_maccms();
+        $link = 'index.html';
+        $this->buildHtml($link,'./', 'index/index');
+        $this->echoLink($link,'/'.$link);
+        if(ENTRANCE=='admin'){
+            mac_jump( url('make/opt'),3 );
+        }
+        exit;
+    }
+
+    public function map()
+    {
+        mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+        $GLOBALS['aid'] = mac_get_aid('map');
+        $this->label_maccms();
+        $link = 'map.html';
+        $this->buildHtml($link,'./','map/index');
+        $this->echoLink($link,'/'.$link);
+        if(ENTRANCE=='admin') {
+            mac_jump(url('make/opt'), 3);
+        }
+        exit;
+    }
+
+    public function rss()
+    {
+        mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+
+        if(!in_array($this->_param['ac2'], ['index','baidu','google','so','sogou','bing','sm'])){
+            return $this->error('参数错误');
+        }
+        if(empty(intval($this->_param['ps']))){
+            $this->_param['ps'] = 1;
+        }
+
+        $GLOBALS['aid'] = mac_get_aid('rss');
+        $this->label_maccms();
+
+        for($i=1;$i<=$this->_param['ps'];$i++){
+            $par =[];
+            if($i>1){
+                $par['page'] = $i;
+                $_REQUEST['page'] = $i;
+            }
+            $link = mac_url('rss/'.$this->_param['ac2'],$par);
+
+            $this->buildHtml($link,'./','rss/'.$this->_param['ac2']);
+            $this->echoLink($link,$link);
+        }
+        if(ENTRANCE=='admin') {
+            mac_jump(url('make/opt'), 3);
+        }
+        exit;
+    }
+
+    public function type()
+    {
+        if($this->_param['tab'] =='art'){
+            $ids = $this->_param['arttype'];
+            if(empty($ids) && $this->_param['ac2']=='day'){
+                $res = model('Art')->updateToday('type');
+                $ids = $res['data'];
+            }
+            $GLOBALS['mid'] = 2;
+            $GLOBALS['aid'] = mac_get_aid('art','type');
+        }
+        else{
+            $ids = $this->_param['vodtype'];
+            if(empty($ids) && $this->_param['ac2']=='day'){
+                $res = model('Vod')->updateToday('type');
+                $ids = $res['data'];
+            }
+            $GLOBALS['mid'] = 1;
+            $GLOBALS['aid'] = mac_get_aid('vod','type');
+        }
+
+        if($GLOBALS['config']['view'][$this->_param['tab'].'_type'] <2){
+            mac_echo('浏览模式非静态,无法生成');
+            exit;
+        }
+
+        $num = intval($this->_param['num']);
+        $start = intval($this->_param['start']);
+        $page_count = intval($this->_param['page_count']);
+        $page_size = intval($this->_param['page_size']);
+        $data_count = intval($this->_param['data_count']);
+
+        if(empty($ids)){
+            return $this->error('参数错误');
+        }
+        if(!is_array($ids)){
+            $ids = explode(',',$ids);
+        }
+        if ($num>=count($ids)){
+            if(empty($this->_param['jump'])){
+                $this->echoLink('分类页生成完毕');
+                if(ENTRANCE=='admin') {
+                    mac_jump(url('make/opt'), 3);
+                }
+                exit;
+            }
+            else{
+                $this->echoLink('分类页生成完毕,稍后继续生成首页');
+                if(ENTRANCE=='admin') {
+                    mac_jump(url('make/index', ['jump' => 1]), 3);
+                }
+                exit;
+            }
+        }
+        if($start<1){
+            $start=1;
+        }
+
+        $id = $ids[$num];
+        $type_list = model('Type')->getCache('type_list');
+        $type_info = $type_list[$id];
+
+        if(empty($data_count)){
+            $where = [];
+            $where['type_id|type_id_1'] = ['eq',$id];
+
+            if($this->_param['tab'] =='art') {
+                $where['art_status'] = ['eq', 1];
+                $data_count = model('Art')->countData($where);
+                $html = mac_read_file(MAC_ROOT_TEMPLATE . 'art/'.$type_info['type_tpl']);
+                $labelRule = '{maccms:art(.*?)num="(.*?)"(.*?)paging="yes"([\s\S]*?)}([\s\S]*?){/maccms:art}';
+            }
+            else{
+                $where['vod_status'] = ['eq', 1];
+                $data_count = model('Vod')->countData($where);
+                $html = mac_read_file(MAC_ROOT_TEMPLATE . 'vod/'.$type_info['type_tpl']);
+                $labelRule = '{maccms:vod(.*?)num="(.*?)"(.*?)paging="yes"([\s\S]*?)}([\s\S]*?){/maccms:vod}';
+            }
+
+            $labelRule = mac_buildregx($labelRule,"");
+            preg_match_all($labelRule,$html,$arr);
+
+            for($i=0;$i<count($arr[2]);$i++) {
+                $page_size = $arr[2][$i];
+                break;
+            }
+            if(empty($page_size)){
+                $page_size = 20;
+                $page_count=1;
+            }
+            else{
+                $page_count = ceil($data_count / $page_size);
+            }
+            if($page_count<1){ $page_count=1; }
+
+            $this->_param['data_count'] = $data_count;
+            $this->_param['page_count'] = $page_count;
+            $this->_param['page_size'] = $page_size;
+
+            if($type_info['type_pid'] == 0){
+                //$this->_param['page_count'] = 1;
+            }
+        }
+
+        if($start > $page_count){
+            $this->_param['start'] = 1;
+            $this->_param['num']++;
+            $this->_param['data_count'] = 0;
+            $this->_param['page_count'] = 0;
+            $this->_param['page_size'] = 0;
+            $url = url('make/make') .'?'. http_build_query($this->_param);
+
+            $this->echoLink('【'.$type_info['type_name'].'】列表页生成完毕,稍后继续');
+            if(ENTRANCE=='admin') {
+                mac_jump($url, 3);
+            }
+            exit;
+        }
+
+        $sec_count = ceil($page_count / $GLOBALS['config']['app']['makesize']);
+        $sec = ceil($start / $GLOBALS['config']['app']['makesize']);
+        $this->echoLink('正在生成【'.$type_info['type_name'].'】列表页,共'.$this->_param['page_count'].'页,分'.$sec_count.'次生成,当前'.$sec.'次');
+        $this->label_maccms();
+
+
+        $n=1;
+        for($i=$start;$i<=$page_count;$i++){
+            $this->_param['start'] = $i;
+
+            $_REQUEST['id'] = $id;
+            $_REQUEST['page'] = $i;
+            $this->label_type( $type_info['type_mid']==2 ? $GLOBALS['config']['view']['art_type'] : $GLOBALS['config']['view']['vod_type'] );
+            $link = mac_url_type($type_info,['id'=>$id,'page'=>$i]);
+
+            $this->buildHtml($link,'./', mac_tpl_fetch($this->_param['tab'],$type_info['type_tpl'],'type') );
+            $this->echoLink('第'.$i.'页',$link);
+
+            if($GLOBALS['config']['app']['makesize'] == $n){
+                break;
+            }
+            $n++;
+        }
+
+        if(ENTRANCE=='api'){
+            if ($num+1>=count($ids)) {
+                mac_echo('定时任务完毕,本次每个分类生成' . $GLOBALS['config']['app']['makesize'] . '个列表页面,避免网站卡死!');
+                die;
+            }
+            else{
+                $this->_param['start'] = 1;
+                $this->_param['num']++;
+                $this->_param['data_count'] = 0;
+                $this->_param['page_count'] = 0;
+                $this->_param['page_size'] = 0;
+                $this->type();
+            }
+        }
+
+        if($this->_param['start'] >= $this->_param['page_count']){
+            $this->_param['start'] = 1;
+            $this->_param['num']++;
+            $this->_param['data_count'] = 0;
+            $this->_param['page_count'] = 0;
+            $this->_param['page_size'] = 0;
+            $this->echoLink('【'.$type_info['type_name'].'】列表页生成完毕,稍后继续');
+        }
+        elseif($this->_param['start'] < $this->_param['page_count']){
+            $this->_param['start']++;
+
+            $this->echoLink('让服务器休息一会,稍后继续');
+        }
+        $url = url('make/make') .'?'. http_build_query($this->_param);
+        if(ENTRANCE=='admin') {
+            mac_jump($url, 3);
+        }
+    }
+
+    public function topic_index()
+    {
+        $num = intval($this->_param['num']);
+        $start = intval($this->_param['start']);
+        $page_count = intval($this->_param['page_count']);
+        $data_count = intval($this->_param['data_count']);
+        $ids = $this->_param['topic'];
+
+        $GLOBALS['mid'] = 3;
+        $GLOBALS['aid'] = mac_get_aid('topic');
+
+        if($start<1){
+            $start=1;
+        }
+        $GLOBALS['config']['app']['makesize'] = 1;
+
+        if($GLOBALS['config']['view']['topic_index'] <2){
+            mac_echo('浏览模式非静态,无法生成');
+            exit;
+        }
+
+        if(empty($data_count)){
+            $where = [];
+            $where['topic_status'] = ['eq', 1];
+            $data_count = model('Topic')->countData($where);
+            $html = mac_read_file(MAC_ROOT_TEMPLATE . 'topic/index.html');
+            $labelRule = '{maccms:topic(.*?)num="(.*?)"(.*?)paging="yes"([\s\S]*?)}([\s\S]*?){/maccms:topic}';
+
+            $labelRule = mac_buildregx($labelRule,"");
+            preg_match_all($labelRule,$html,$arr);
+
+            for($i=0;$i<count($arr[2]);$i++) {
+                $page_size = $arr[2][$i];
+                break;
+            }
+            if(empty($page_size)){
+                $page_size = 20;
+            }
+            $page_count = ceil($data_count / $page_size);
+            if($page_count<1){ $page_count=1; }
+
+            $this->_param['start'] = $start;
+            $this->_param['data_count'] = $data_count;
+            $this->_param['page_count'] = $page_count;
+            $this->_param['page_size'] = $page_size;
+        }
+
+        if($start > $page_count){
+            $this->echoLink('专题列表生成完毕');
+            if(ENTRANCE=='admin') {
+                mac_jump(url('make/opt'), 3);
+            }
+            exit;
+        }
+
+        $sec_count = ceil($page_count / $GLOBALS['config']['app']['makesize']);
+        $sec = ceil($start / $GLOBALS['config']['app']['makesize']);
+        $this->echoLink('正在生成专题列表页,共'.$this->_param['page_count'].'页,分'.$sec_count.'次生成,当前'.$sec.'次');
+
+        $this->label_maccms();
+
+        $n=1;
+        for($i=$start;$i<=$page_count;$i++){
+            $this->_param['start'] = $i;
+            $_REQUEST['page'] = $i;
+
+            $this->label_topic_index($data_count);
+            $link = mac_url_topic_index(['page'=>$i]);
+            $this->buildHtml($link,'./','topic/index');
+            $this->echoLink('第'.$i.'页',$link);
+
+            if($GLOBALS['config']['app']['makesize'] == $n){
+                break;
+            }
+            $n++;
+        }
+
+        if($this->_param['start'] >= $page_count){
+            $this->echoLink('专题列表生成完毕');
+            if(ENTRANCE=='admin') {
+                mac_jump(url('make/opt'), 3);
+            }
+            exit;
+        }
+        else{
+            $this->_param['start']++;
+            $this->echoLink('让服务器休息一会,稍后继续');
+        }
+        $url = url('make/make') .'?'. http_build_query($this->_param);
+        if(ENTRANCE=='admin') {
+            mac_jump($url, 3);
+        }
+    }
+
+    public function topic_info()
+    {
+        $ids = $this->_param['topic'];
+
+        $GLOBALS['mid'] = 3;
+        $GLOBALS['aid'] = mac_get_aid('topic','detail');
+
+        if(empty($ids)){
+            return $this->error('参数错误');
+        }
+        if(!is_array($ids)){
+            $ids = explode(',',$ids);
+        }
+
+        if($GLOBALS['config']['view']['topic_detail'] <2){
+            mac_echo('浏览模式非静态,无法生成');
+            exit;
+        }
+
+
+        $data_count = count($ids);
+        $this->echoLink('正在生成专题内容页,共'.$data_count.'条');
+        $this->label_maccms();
+
+        $n=1;
+        foreach($ids as $a){
+            $_REQUEST['id'] = $a;
+
+            $where = [];
+            $where['topic_id'] = ['eq',$a];
+            $where['topic_status'] = ['eq',1];
+            $res = model('Topic')->infoData($where);
+            if($res['code'] == 1) {
+                $topic_info = $res['info'];
+
+                $this->label_topic_detail($topic_info);
+                $link = mac_url_topic_detail($topic_info);
+                $this->buildHtml($link,'./', mac_tpl_fetch('topic',$topic_info['topic_tpl'],'detail') );
+                $this->echoLink($topic_info['topic_name'],$link);
+                $n++;
+            }
+        }
+
+        if(!empty($ids)){
+            Db::name('topic')->where(['topic_id'=>['in',$ids]])->update(['topic_time_make'=>time()]);
+        }
+        if($this->_param['ref'] ==1 && !empty($_SERVER["HTTP_REFERER"])){
+            if(ENTRANCE=='admin'){
+                mac_jump($_SERVER["HTTP_REFERER"],2);
+            }
+            die;
+        }
+
+        $this->echoLink('专题内容页生成完毕');
+        if(ENTRANCE=='admin'){
+            mac_jump( url('make/opt') ,3);
+        }
+    }
+
+
+    public function info()
+    {
+        $where = [];
+
+        $ids = $this->_param['ids'];
+        if($this->_param['tab'] =='art'){
+            $type_ids = $this->_param['arttype'];
+            $order='art_time desc';
+            $where['art_status'] = ['eq',1];
+
+            if($GLOBALS['config']['view']['art_detail'] <2){
+                mac_echo('浏览模式非静态,无法生成');
+                exit;
+            }
+
+        }
+        else{
+            $type_ids = $this->_param['vodtype'];
+            $order='vod_time desc';
+            $where['vod_status'] = ['eq',1];
+
+            if($GLOBALS['config']['view']['vod_detail'] <2 && $GLOBALS['config']['view']['vod_play'] <2 && $GLOBALS['config']['view']['vod_down'] <2){
+                mac_echo('浏览模式非静态,无法生成');
+                exit;
+            }
+
+        }
+
+        $num = intval($this->_param['num']);
+        $start = intval($this->_param['start']);
+        $page_count = intval($this->_param['page_count']);
+        $data_count = intval($this->_param['data_count']);
+        if($start<1){
+            $start=1;
+        }
+        if($page_count<1){
+            $page_count=1;
+        }
+
+        $where = [];
+        if(empty($ids) && empty($type_ids) && empty($this->_param['ac2'])){
+            return $this->error('参数错误');
+        }
+        $type_name ='';
+
+
+        if(!empty($type_ids)){
+            if(!is_array($type_ids)){
+                $type_ids = explode(',',$type_ids);
+            }
+
+            if ($num>=count($type_ids)){
+
+                if(empty($this->_param['jump'])){
+                    $this->echoLink('内容页生成完毕1');
+                    if(ENTRANCE=='admin'){
+                        mac_jump( url('make/opt') ,3);
+                    }
+                    exit;
+                }
+                else{
+                    $this->echoLink('内容页生成完毕,稍后继续生成分类页');
+                    if(ENTRANCE=='admin'){
+                        mac_jump( url('make/make',['jump'=>1,'ac'=>'type','tab'=>$this->_param['tab'], $this->_param['tab'].'type'=> join(',',$type_ids) ,'ac2'=>'day']) ,3);
+                    }
+                    exit;
+                }
+            }
+
+            $type_id = $type_ids[$num];
+            $type_list = model('Type')->getCache('type_list');
+            $type_info = $type_list[$type_id];
+
+            $type_name = $type_info['type_name'];
+            $where['type_id'] = ['eq',$type_id];
+        }
+        elseif(!empty($ids)){
+            $type_name ='选择数据';
+            if($start > $page_count){
+                mac_echo('内容页生成完毕2');
+                exit;
+            }
+            $where[$this->_param['tab'].'_id'] = ['in',$ids];
+        }
+
+
+        if($this->_param['ac2'] =='day'){
+            $type_name .='今日数据';
+            $where[$this->_param['tab'].'_time'] = ['gt', strtotime(date('Y-m-d'))];
+
+
+            if ($num>=count($type_ids)){
+
+            }
+            if($start > $page_count){
+                //$this->echoLink('内容页生成完毕3');
+                //mac_jump( url('make/opt') ,3);
+                //exit;
+            }
+        }
+        elseif($this->_param['ac2'] =='nomake'){
+            $type_name ='未生成数据';
+            $start=1;
+            $data_count=0;
+            $where[$this->_param['tab'].'_time_make'] = ['exp',  Db::raw(' < '. $this->_param['tab'].'_time')];
+            if($start > $page_count){
+                $this->echoLink('内容页生成完毕4');
+                if(ENTRANCE=='admin'){
+                    mac_jump( url('make/opt') ,3);
+                }
+                exit;
+            }
+        }
+
+        if(ENTRANCE=='api'){
+            $GLOBALS['config']['app']['makesize'] = 999;
+        }
+
+        if(empty($data_count)){
+            if($this->_param['tab'] =='art'){
+                $data_count = model('Art')->countData($where);
+            }
+            else{
+                $data_count = model('Vod')->countData($where);
+            }
+
+
+            $page_count = ceil($data_count / $GLOBALS['config']['app']['makesize']);
+            $page_size = $GLOBALS['config']['app']['makesize'];
+
+            $this->_param['data_count'] = $data_count;
+            $this->_param['page_count'] = $page_count;
+            $this->_param['page_size'] = $page_size;
+        }
+
+        if($start > $page_count){
+
+            $this->echoLink('【'.$type_name.'】内容页生成完毕,稍后继续');
+
+            if($this->_param['ac2'] =='nomake' ){
+                if(ENTRANCE=='admin'){
+                    mac_jump( url('make/opt') ,3);
+                }
+                die;
+            }
+            else{
+
+            }
+
+            $this->_param['start'] = 1;
+            $this->_param['num']++;
+            $this->_param['data_count'] = 0;
+            $this->_param['page_count'] = 0;
+            $this->_param['page_size'] = 0;
+            $url = url('make/make') .'?'. http_build_query($this->_param);
+
+
+            if(ENTRANCE=='admin'){
+                mac_jump( $url ,3);
+            }
+            exit;
+        }
+
+
+        $this->echoLink('正在生成【'.$type_name.'】内容页,共'.$this->_param['data_count'].'条,分'.$this->_param['page_count'].'次生成,每次'.$this->_param['page_size'].'条,当前第'.$start.'次');
+
+        if($this->_param['tab'] =='art') {
+            $res = model('Art')->listData($where, $order, $start, $GLOBALS['config']['app']['makesize']);
+        }
+        else{
+            $res = model('Vod')->listData($where, $order, $start, $GLOBALS['config']['app']['makesize']);
+        }
+
+
+        $update_ids=[];
+        foreach($res['list'] as $k=>$v){
+
+            if(!empty($v['art_id'])) {
+
+                $GLOBALS['type_id'] =$v['type_id'];
+                $GLOBALS['type_pid'] = $v['type']['type_pid'];
+
+                $GLOBALS['mid'] = 2;
+                $GLOBALS['aid'] = mac_get_aid('art','detail');
+
+                $this->label_maccms();
+                $_REQUEST['id'] = $v['art_id'];
+                echo mac_substring($v['art_name'],100) .'&nbsp;';
+
+                if(!empty($v['art_content'])) {
+                    $art_page_list = mac_art_list($v['art_title'], $v['art_note'], $v['art_content']);
+                    $art_page_total = count($art_page_list);
+                }
+
+                for($i=1;$i<=$art_page_total;$i++){
+                    $v['art_page_list'] = mac_art_list($v['art_title'], $v['art_note'], $v['art_content']);
+                    $v['art_page_total'] = count($v['art_page_list']);
+                    $_REQUEST['page'] = $i;
+
+                    $info = $this->label_art_detail($v,$GLOBALS['config']['view']['art_detail']);
+                    $link = mac_url_art_detail($v, ['page' => $i]);
+
+                    $this->buildHtml($link,'./', mac_tpl_fetch('art',$info['art_tpl'],'detail') );
+                    if($i==1) {
+                        $this->echoLink('detail', $link);
+                    }
+                }
+                $update_ids[] = $v['art_id'];
+            }
+            else{
+
+                $GLOBALS['type_id'] =$v['type_id'];
+                $GLOBALS['type_pid'] = $v['type']['type_pid'];
+
+                $GLOBALS['mid'] = 1;
+                $GLOBALS['aid'] = mac_get_aid('vod','detail');
+
+                $_REQUEST['id'] = $v['vod_id'];
+                echo $v['vod_name'].'&nbsp;';;
+                if(!empty($v['vod_play_from'])) {
+                    $v['vod_play_list'] = mac_play_list($v['vod_play_from'], $v['vod_play_url'], $v['vod_play_server'], $v['vod_play_note'],'play');
+                    $v['vod_play_total'] =  count($v['vod_play_list']);
+                }
+                if(!empty($v['vod_down_from'])) {
+                    $v['vod_down_list'] = mac_play_list($v['vod_down_from'], $v['vod_down_url'], $v['vod_down_server'], $v['vod_down_note'],'down');
+                    $v['vod_down_total'] =  count($v['vod_down_list']);
+                }
+                if(!empty($v['vod_plot_name'])) {
+                    $v['vod_plot_list'] = mac_plot_list($v['vod_plot_name'], $v['vod_plot_detail']);
+                    $v['vod_plot_total'] =  count($v['vod_plot_list']);
+                }
+
+                if($GLOBALS['config']['view']['vod_detail'] == 2){
+                    $this->label_maccms();
+                    $info = $this->label_vod_detail($v, $GLOBALS['config']['view']['vod_detail']);
+                    $link = mac_url_vod_detail($v);
+                    $this->buildHtml($link, './', mac_tpl_fetch('vod', $info['vod_tpl'], 'detail'));
+                    $this->echoLink('detail', $link, '', 0);
+                }
+                $_REQUEST['id'] = $v['vod_id'];
+                
+                $update_ids[] = $v['vod_id'];
+                $flag = ['play','down'];
+                foreach($flag as $f) {
+                    $GLOBALS['aid'] = mac_get_aid('vod',$f);
+
+                    $this->label_maccms();
+                    //播放页 和 下载页
+                    if ($GLOBALS['config']['view']['vod_'.$f] < 2) {
+
+                    }
+                    else{
+                        if ($GLOBALS['config']['view']['vod_'.$f] == 2) {
+                        	$_REQUEST['sid'] = 1;
+                        	$_REQUEST['nid'] = 1;
+                            $info = $this->label_vod_play($f,$v,$GLOBALS['config']['view']['vod_'.$f]);
+                            $link =  ($f=='play' ?mac_url_vod_play($v,['sid'=>1,'nid'=>1]) : mac_url_vod_down($v,['sid'=>1,'nid'=>1]) );
+                            $this->buildHtml($link, './', mac_tpl_fetch('vod', $info['vod_tpl_'.$f], $f) );
+                            $this->echoLink($f, $link, '', 0);
+                        }
+                        elseif ($GLOBALS['config']['view']['vod_'.$f] == 3) {
+                            for ($i = 1; $i <= $v['vod_'.$f.'_total']; $i++) {
+                                for ($j = 1; $j <= $v['vod_'.$f.'_list'][$i]['url_count']; $j++) {
+                                	$_REQUEST['sid'] = $i;
+                                	$_REQUEST['nid'] = $j;
+                                    $info = $this->label_vod_play($f,$v,$GLOBALS['config']['view']['vod_'.$f]);
+
+                                    $link = ($f=='play' ? mac_url_vod_play($v, ['sid' => $i, 'nid' => $j]) : mac_url_vod_down($v, ['sid' => $i, 'nid' => $j]) );
+                                    $link_sp = explode('?',$link);
+                                    $this->buildHtml($link_sp[0], './', mac_tpl_fetch('vod', $info['vod_tpl_'.$f], $f) );
+                                    if($i==1 && $j==1) {
+                                        $this->echoLink('' . $f . '-' . $i . '-' . $j, $link, '', 0);
+                                    }
+                                }
+                            }
+                        }
+                        elseif ($GLOBALS['config']['view']['vod_'.$f] == 4) {
+                            $tmp_play_list = $v['vod_'.$f.'_list'];
+                            for ($i = 1; $i <= $v['vod_'.$f.'_total']; $i++) {
+                                $v['vod_'.$f.'_list'] = [];
+                                $v['vod_'.$f.'_list'][$i] = $tmp_play_list[$i];
+                                $info = $this->label_vod_play($f,$v,$GLOBALS['config']['view']['vod_'.$f]);
+                                $link = ($f=='play' ? mac_url_vod_play($v, ['sid' => $i]) : mac_url_vod_down($v, ['sid' => $i]) );
+                                $link_sp = explode('?',$link);
+                                $this->buildHtml($link_sp[0], './', mac_tpl_fetch('vod', $info['vod_tpl_'.$f], $f) );
+                                if($i==1) {
+                                    $this->echoLink('' . $f . '-' . $i, $link, '', 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                echo '<br>';
+            }
+        }
+
+        if(!empty($update_ids)){
+            Db::name($this->_param['tab'])->where([$this->_param['tab'].'_id'=>['in',$update_ids]])->update([$this->_param['tab'].'_time_make'=>time()]);
+        }
+        if($this->_param['ref'] ==1 && !empty($_SERVER["HTTP_REFERER"])){
+            if(ENTRANCE=='admin'){
+                mac_jump($_SERVER["HTTP_REFERER"],2);
+            }
+            die;
+        }
+
+        if($start > $page_count){
+            $this->_param['start'] = 1;
+            $this->_param['num']++;
+            $this->_param['data_count'] = 0;
+            $this->_param['page_count'] = 0;
+            $this->_param['page_size'] = 0;
+            $this->echoLink('【'.$type_name.'】内容页生成完毕,稍后继续');
+
+
+            if($this->_param['ac2'] !=''){
+                //mac_jump( url('make/opt') ,3);
+                //die;
+            }
+            else{
+
+            }
+        }
+        else{
+            $this->_param['start'] = ++$start;
+            $this->echoLink('让服务器休息一会,稍后继续');
+        }
+        $url = url('make/make') .'?'. http_build_query($this->_param);
+
+        if(ENTRANCE=='admin'){
+            mac_jump( $url ,3);
+        }
+    }
+
+
+    public function label()
+    {
+        $ids = $this->_param['label'];
+        $GLOBALS['aid'] = mac_get_aid('label');
+        if(empty($ids)){
+            return $this->error('参数错误');
+        }
+        if(!is_array($ids)){
+            $ids = explode(',',$ids);
+        }
+        $data_count = count($ids);
+        $this->echoLink('正在生成自定义页,共'.$data_count.'个页');
+        $this->label_maccms();
+
+        $n=1;
+        foreach($ids as $a){
+            $fullname = explode('.',$a)[0];
+            $file = 'label/'.$a;
+            $tpl = 'label/'.$fullname;
+
+            $this->buildHtml($file ,'./', $tpl );
+            $this->echoLink($file,'/'. $file);
+
+            $n++;
+        }
+
+        $this->echoLink('自定义页生成完毕');
+        if(ENTRANCE=='admin'){
+            mac_jump( url('make/opt') ,3);
+        }
+    }
+
+
+}

+ 71 - 0
application/admin/controller/Order.php

@@ -0,0 +1,71 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Order extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+        $where=[];
+        if($param['status']!=''){
+            $where['order_status'] = ['eq',$param['status']];
+        }
+        if(!empty($param['uid'])){
+            $where['o.user_id'] = ['eq',$param['uid'] ];
+        }
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['order_code'] = ['like','%'.$param['wd'].'%'];
+        }
+
+        $order='order_id desc';
+        $res = model('Order')->listData($where,$order,$param['page'],$param['limit']);
+
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+
+
+        $this->assign('title','订单管理');
+        return $this->fetch('admin@order/index');
+    }
+
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $all = $param['all'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['order_id'] = ['in',$ids];
+            if($all==1){
+                $where['order_id'] = ['gt',0];
+            }
+            $res = model('Order')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+
+
+}

+ 61 - 0
application/admin/controller/Plog.php

@@ -0,0 +1,61 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Plog extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+        $where=[];
+        if(!empty($param['type'])){
+            $where['plog_type'] = ['eq',$param['type']];
+        }
+        if(!empty($param['uid'])){
+            $where['user_id'] = ['eq',$param['uid'] ];
+        }
+
+        $order='plog_id desc';
+        $res = model('Plog')->listData($where,$order,$param['page'],$param['limit']);
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+
+        $this->assign('title','积分日志管理');
+        return $this->fetch('admin@plog/index');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $all = $param['all'];
+        if(!empty($ids)){
+            $where=[];
+            $where['plog_id'] = ['in',$ids];
+            if($all==1){
+                $where['plog_id'] = ['gt',0];
+            }
+            $res = model('Plog')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+}

+ 146 - 0
application/admin/controller/Role.php

@@ -0,0 +1,146 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+use app\common\util\Pinyin;
+
+class Role extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function data()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) < 1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) < 1 ? $this->_pagesize : $param['limit'];
+
+        $where = [];
+        if (!empty($param['level'])) {
+            $where['role_level'] = ['eq', $param['level']];
+        }
+        if (in_array($param['status'], ['0', '1'])) {
+            $where['role_status'] = ['eq', $param['status']];
+        }
+        if (!empty($param['rid'])) {
+            $where['role_rid'] = ['eq', $param['rid']];
+        }
+        if(!empty($param['pic'])){
+            if($param['pic'] == '1'){
+                $where['role_pic'] = ['eq',''];
+            }
+            elseif($param['pic'] == '2'){
+                $where['role_pic'] = ['like','http%'];
+            }
+            elseif($param['pic'] == '3'){
+                $where['role_pic'] = ['like','%#err%'];
+            }
+        }
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['role_name'] = ['like','%'.$param['wd'].'%'];
+        }
+
+
+        $order='role_time desc';
+        $res = model('Role')->listData($where,$order,$param['page'],$param['limit']);
+
+        $this->assign('list', $res['list']);
+        $this->assign('total', $res['total']);
+        $this->assign('page', $res['page']);
+        $this->assign('limit', $res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param', $param);
+
+        $this->assign('title', '角色管理');
+        return $this->fetch('admin@role/index');
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input('post.');
+            $res = model('Role')->saveData($param);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+        $tab = input('tab');
+        $rid = input('rid');
+
+        $where=[];
+        $where['role_id'] = ['eq',$id];
+        $res = model('Role')->infoData($where);
+        $info = $res['info'];
+        if(empty($info)){
+            $info['role_rid'] =  $rid;
+        }
+        $this->assign('info',$info);
+
+        $where=[];
+        $where['vod_id'] = ['eq', $info['role_rid'] ];
+        $res = model('Vod')->infoData($where);
+        $data = $res['info'];
+        $this->assign('data',$data);
+
+        $this->assign('title','角色信息');
+        return $this->fetch('admin@role/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['role_id'] = ['in',$ids];
+            $res = model('Role')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+        $start = $param['start'];
+        $end = $param['end'];
+
+
+        if(!empty($ids) && in_array($col,['role_status','role_lock','role_level','role_hits'])){
+            $where=[];
+            $where['role_id'] = ['in',$ids];
+            if(empty($start)) {
+                $res = model('Role')->fieldData($where, $col, $val);
+            }
+            else{
+                if(empty($end)){$end = 9999;}
+                $ids = explode(',',$ids);
+                foreach($ids as $k=>$v){
+                    $val = rand($start,$end);
+                    $where['role_id'] = ['eq',$v];
+                    $res = model('Role')->fieldData($where, $col, $val);
+                }
+            }
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+}

+ 645 - 0
application/admin/controller/System.php

@@ -0,0 +1,645 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+use think\Config;
+use think\Cache;
+use think\Exception;
+
+class System extends Base
+{
+
+    public function test_email()
+    {
+        $post = input();
+        $conf = [
+            'host' => $post['host'],
+            'username' => $post['username'],
+            'password' => $post['password'],
+            'port' => $post['port'],
+            'nick' => $post['nick'],
+            'test' => $post['test'],
+        ];
+        $res = mac_send_mail($conf['test'], '苹果CMS发送邮件测试', '当您看到这封邮件说明邮件配置正确了!感谢使用苹果CMS相关产品!', $conf);
+        if ($res==true) {
+            return json(['code' => 1, 'msg' => '测试成功']);
+        }
+        return json(['code' => 1001, 'msg' => '测试失败:'.$res]);
+    }
+
+    public function test_cache()
+    {
+        $param = input();
+
+        if (!isset($param['type']) || empty($param['host']) || empty($param['port'])) {
+            return $this->error('参数错误!');
+        }
+
+        $options = [
+            'type' => $param['type'],
+            'port' => $param['port'],
+            'username' => $param['username'],
+            'password' => $param['password']
+        ];
+
+        $hd = Cache::connect($options);
+        $hd->set('test', 'test');
+
+        return json(['code' => 1, 'msg' => '测试成功']);
+    }
+
+    public function config()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+
+            $validate = \think\Loader::validate('System');
+            if(!$validate->check($config)){
+                return $this->error($validate->getError());
+            }
+            unset($config['__token__']);
+
+
+            $ads_dir='ads';
+            $mob_ads_dir='ads';
+            $path = ROOT_PATH .'template/'.$config['site']['template_dir'].'/info.ini';
+            $cc = Config::load($path,'ini');
+            if(!empty($cc['adsdir'])){
+                $ads_dir = $cc['adsdir'];
+            }
+
+            $path = ROOT_PATH .'template/'.$config['site']['mob_template_dir'].'/info.ini';
+            $cc = Config::load($path,'ini');
+            if(!empty($cc['adsdir'])){
+                $mob_ads_dir = $cc['adsdir'];
+            }
+            $config['site']['ads_dir'] = $ads_dir;
+            $config['site']['mob_ads_dir'] = $mob_ads_dir;
+
+            if(empty($config['app']['cache_flag'])){
+                $config['app']['cache_flag'] = substr(md5(time()),0,10);
+            }
+
+            $config['app']['search_vod_rule'] = join('|', $config['app']['search_vod_rule']);
+            $config['app']['search_art_rule'] = join('|', $config['app']['search_art_rule']);
+
+            $config['extra'] = [];
+            if(!empty($config['app']['extra_var'])){
+                $extra_var = str_replace(array(chr(10),chr(13)), array('','#'),$config['app']['extra_var']);
+                $tmp = explode('#',$extra_var);
+                foreach($tmp as $a){
+                    if(strpos($a,'$$$')!==false){
+                        $tmp2 = explode('$$$',$a);
+                        $config['extra'][$tmp2[0]] = $tmp2[1];
+                    }
+                }
+                unset($tmp,$tmp2);
+            }
+
+            $config_new['site'] = $config['site'];
+            $config_new['app'] = $config['app'];
+            $config_new['extra'] = $config['extra'];
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+
+            $tj = $config_new['site']['site_tj'];
+            if(strpos($tj,'document.w') ===false){
+                $tj = 'document.write(\'' . str_replace("'","\'",$tj) . '\')';
+            }
+            $res = @fwrite(fopen('./static/js/tj.js', 'wb'), $tj);
+
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+
+        $templates = glob('./template' . '/*', GLOB_ONLYDIR);
+        foreach ($templates as $k => &$v) {
+            $v = str_replace('./template/', '', $v);
+        }
+        $this->assign('templates', $templates);
+
+        $usergroup = Db::name('group')->select();
+        $this->assign('usergroup', $usergroup);
+
+        $config = config('maccms');
+        $this->assign('config', $config);
+        $this->assign('title', '网站参数配置');
+        return $this->fetch('admin@system/config');
+    }
+
+
+
+    public function configurl()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+            $config_new['view'] = $config['view'];
+            $config_new['path'] = $config['path'];
+            $config_new['rewrite'] = $config['rewrite'];
+
+            //写路由规则文件
+            $route = [];
+            $route['__pattern__'] = [
+
+                'id'=>'[\s\S]*?',
+                'ids'=>'[\s\S]*?',
+                'wd' => '[\s\S]*',
+                'en'=>'[\s\S]*?',
+                'state' => '[\s\S]*?',
+                'area' => '[\s\S]*',
+                'year'=>'[\s\S]*?',
+                'lang' => '[\s\S]*?',
+                'letter'=>'[\s\S]*?',
+                'actor' => '[\s\S]*?',
+                'director' => '[\s\S]*?',
+                'tag' => '[\s\S]*?',
+                'class' => '[\s\S]*?',
+                'order'=>'[\s\S]*?',
+                'by'=>'[\s\S]*?',
+                'file'=>'[\s\S]*?',
+                'name'=>'[\s\S]*?',
+                'url'=>'[\s\S]*?',
+                'type'=>'[\s\S]*?',
+                'sex' => '[\s\S]*?',
+                'version' => '[\s\S]*?',
+                'blood' => '[\s\S]*?',
+                'starsign' => '[\s\S]*?',
+                'page'=>'\d+',
+                'ajax'=>'\d+',
+                'tid'=>'\d+',
+                'mid'=>'\d+',
+                'rid'=>'\d+',
+                'pid'=>'\d+',
+                'sid'=>'\d+',
+                'nid'=>'\d+',
+                'uid'=>'\d+',
+                'level'=>'\d+',
+                'score'=>'\d+',
+                'limit'=>'\d+',
+            ];
+            $rows = explode(chr(13), str_replace(chr(10), '', $config['rewrite']['route']));
+            foreach ($rows as $r) {
+                if (strpos($r, '=>') !== false) {
+                    $a = explode('=>', $r);
+                    $rule = [];
+                    if (strpos($a, ':id') !== false) {
+                        //$rule['id'] = '\w+';
+                    }
+                    $route[trim($a[0])] = [trim($a[1]), [], $rule];
+                }
+            }
+
+            $res = mac_arr2file(APP_PATH . 'route.php', $route);
+            if ($res === false) {
+                return $this->error('保存路由配置失败,请重试!');
+            }
+
+            //写扩展配置
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存配置文件失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $this->assign('config', config('maccms'));
+        $this->assign('title', 'url参数配置');
+        return $this->fetch('admin@system/configurl');
+    }
+
+    public function configuser()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+            $config_new['user'] = $config['user'];
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $this->assign('config', config('maccms'));
+        $this->assign('title', '会员参数配置');
+        return $this->fetch('admin@system/configuser');
+    }
+
+    public function configupload()
+    {
+        if (Request()->isPost()){
+            $config = input();
+            $config_new['upload'] = $config['upload'];
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $this->assign('config', config('maccms'));
+
+        $path = './application/common/extend/upload';
+        $file_list = glob($path . '/*.php',GLOB_NOSORT );
+        $ext_list = [];
+        $ext_html = '';
+        foreach($file_list as $k=>$v) {
+            $cl = str_replace([$path . '/', '.php'], '', $v);
+            $cp = 'app\\common\\extend\\upload\\' . $cl;
+
+            if (class_exists($cp)) {
+                $c = new $cp;
+                $ext_list[$cl] = $c->name;
+
+                if(file_exists( './application/admin/view/extend/upload/'.strtolower($cl) .'.html')) {
+                    $ext_html .= $this->fetch('admin@extend/upload/' . strtolower($cl));
+                }
+            }
+        }
+        $this->assign('ext_list',$ext_list);
+        $this->assign('ext_html',$ext_html);
+
+        $this->assign('title', '附件参数配置');
+        return $this->fetch('admin@system/configupload');
+    }
+
+    public function configcomment()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+
+            $config_new['gbook'] = $config['gbook'];
+            $config_new['comment'] = $config['comment'];
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $this->assign('config', config('maccms'));
+        $this->assign('title', '评论留言配置');
+        return $this->fetch('admin@system/configcomment');
+    }
+
+
+    public function configweixin()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+            $config_new['weixin'] = $config['weixin'];
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $this->assign('config', config('maccms'));
+        $this->assign('title', '微信对接配置');
+        return $this->fetch('admin@system/configweixin');
+    }
+
+    public function configpay()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+            $config_new['pay'] = $config['pay'];
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $this->assign('http_type',$GLOBALS['http_type']);
+        $this->assign('config', config('maccms'));
+
+        $path = './application/common/extend/pay';
+        $file_list = glob($path . '/*.php',GLOB_NOSORT );
+        $ext_list = [];
+        $ext_html = '';
+        foreach($file_list as $k=>$v) {
+            $cl = str_replace([$path . '/', '.php'], '', $v);
+            $cp = 'app\\common\\extend\\pay\\' . $cl;
+
+            if (class_exists($cp)) {
+                $c = new $cp;
+                $ext_list[$cl] = $c->name;
+
+                if(file_exists( './application/admin/view/extend/pay/'.strtolower($cl) .'.html')) {
+                    $ext_html .= $this->fetch('admin@extend/pay/' . strtolower($cl));
+                }
+            }
+        }
+        $this->assign('ext_list',$ext_list);
+        $this->assign('ext_html',$ext_html);
+
+
+        $this->assign('title', '在线支付配置');
+        return $this->fetch('admin@system/configpay');
+    }
+
+    public function configconnect()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+            $config_new['connect'] = $config['connect'];
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $this->assign('config', config('maccms'));
+        $this->assign('title', '整合登录配置');
+        return $this->fetch('admin@system/configconnect');
+    }
+
+    public function configemail()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+            $config_new['email'] = $config['email'];
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $this->assign('config', config('maccms'));
+        $this->assign('title', '邮件发送配置');
+        return $this->fetch('admin@system/configemail');
+    }
+
+    public function configsms()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+            $config_new['sms'] = $config['sms'];
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $path = './application/common/extend/sms';
+        $file_list = glob($path . '/*.php',GLOB_NOSORT );
+        $ext_list = [];
+        foreach($file_list as $k=>$v) {
+            $cl = str_replace([$path . '/', '.php'], '', $v);
+            $cp = 'app\\common\\extend\\sms\\' . $cl;
+
+            if (class_exists($cp)) {
+                $c = new $cp;
+                $ext_list[$cl] = $c->name;
+            }
+        }
+        $this->assign('ext_list',$ext_list);
+
+        $this->assign('config', config('maccms'));
+        $this->assign('title', '短信发送配置');
+        return $this->fetch('admin@system/configsms');
+    }
+
+    public function configapi()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+            $config_new['api'] = $config['api'];
+
+            $config_new['api']['vod']['auth'] = mac_replace_text($config_new['api']['vod']['auth'], 2);
+            $config_new['api']['art']['auth'] = mac_replace_text($config_new['api']['art']['auth'], 2);
+            $config_new['api']['actor']['auth'] = mac_replace_text($config_new['api']['actor']['auth'], 2);
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $this->assign('config', config('maccms'));
+        $this->assign('title', '采集接口API配置');
+        return $this->fetch('admin@system/configapi');
+    }
+
+
+    public function configinterface()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+
+            if($config['interface']['status']==1 && strlen($config['interface']['pass']) < 16){
+                return $this->error('保存失败,安全起见入库密码必须大于等于16位!');
+            }
+
+            $config_new['interface'] = $config['interface'];
+            $config_new['interface']['vodtype'] = mac_replace_text($config_new['interface']['vodtype'], 2);
+            $config_new['interface']['arttype'] = mac_replace_text($config_new['interface']['arttype'], 2);
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+
+            //保存缓存
+            mac_interface_type();
+
+            return $this->success('保存成功!');
+        }
+
+        $this->assign('config', config('maccms'));
+        $this->assign('title', '站外入库配置');
+        return $this->fetch('admin@system/configinterface');
+    }
+
+    public function configcollect()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+            $config_new['collect'] = $config['collect'];
+            if (empty($config_new['collect']['vod']['inrule'])) {
+                $config_new['collect']['vod']['inrule'] = ['a'];
+            }
+            if (empty($config_new['collect']['vod']['uprule'])) {
+                $config_new['collect']['vod']['uprule'] = [];
+            }
+            if (empty($config_new['collect']['art']['inrule'])) {
+                $config_new['collect']['art']['inrule'] = ['a'];
+            }
+            if (empty($config_new['collect']['art']['uprule'])) {
+                $config_new['collect']['art']['uprule'] = [];
+            }
+            if (empty($config_new['collect']['actor']['inrule'])) {
+                $config_new['collect']['actor']['inrule'] = ['a'];
+            }
+            if (empty($config_new['collect']['actor']['uprule'])) {
+                $config_new['collect']['actor']['uprule'] = [];
+            }
+            if (empty($config_new['collect']['role']['inrule'])) {
+                $config_new['collect']['role']['inrule'] = ['a'];
+            }
+            if (empty($config_new['collect']['role']['uprule'])) {
+                $config_new['collect']['role']['uprule'] = [];
+            }
+            if (empty($config_new['collect']['website']['inrule'])) {
+                $config_new['collect']['website']['inrule'] = ['a'];
+            }
+            if (empty($config_new['collect']['website']['uprule'])) {
+                $config_new['collect']['website']['uprule'] = [];
+            }
+
+            $config_new['collect']['vod']['inrule'] = ',' . join(',', $config_new['collect']['vod']['inrule']);
+            $config_new['collect']['vod']['uprule'] = ',' . join(',', $config_new['collect']['vod']['uprule']);
+            $config_new['collect']['art']['inrule'] = ',' . join(',', $config_new['collect']['art']['inrule']);
+            $config_new['collect']['art']['uprule'] = ',' . join(',', $config_new['collect']['art']['uprule']);
+            $config_new['collect']['actor']['inrule'] = ',' . join(',', $config_new['collect']['actor']['inrule']);
+            $config_new['collect']['actor']['uprule'] = ',' . join(',', $config_new['collect']['actor']['uprule']);
+            $config_new['collect']['role']['inrule'] = ',' . join(',', $config_new['collect']['role']['inrule']);
+            $config_new['collect']['role']['uprule'] = ',' . join(',', $config_new['collect']['role']['uprule']);
+            $config_new['collect']['website']['inrule'] = ',' . join(',', $config_new['collect']['website']['inrule']);
+            $config_new['collect']['website']['uprule'] = ',' . join(',', $config_new['collect']['website']['uprule']);
+
+            $config_new['collect']['vod']['namewords'] = mac_replace_text($config_new['collect']['vod']['namewords'], 2);
+            $config_new['collect']['vod']['thesaurus'] = mac_replace_text($config_new['collect']['vod']['thesaurus'], 2);
+            $config_new['collect']['vod']['words'] = mac_replace_text($config_new['collect']['vod']['words'], 2);
+            $config_new['collect']['art']['thesaurus'] = mac_replace_text($config_new['collect']['art']['thesaurus'], 2);
+            $config_new['collect']['art']['words'] = mac_replace_text($config_new['collect']['art']['words'], 2);
+            $config_new['collect']['actor']['thesaurus'] = mac_replace_text($config_new['collect']['actor']['thesaurus'], 2);
+            $config_new['collect']['actor']['words'] = mac_replace_text($config_new['collect']['actor']['words'], 2);
+            $config_new['collect']['role']['thesaurus'] = mac_replace_text($config_new['collect']['role']['thesaurus'], 2);
+            $config_new['collect']['role']['words'] = mac_replace_text($config_new['collect']['role']['words'], 2);
+            $config_new['collect']['website']['thesaurus'] = mac_replace_text($config_new['collect']['website']['thesaurus'], 2);
+            $config_new['collect']['website']['words'] = mac_replace_text($config_new['collect']['website']['words'], 2);
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+
+        $this->assign('config', config('maccms'));
+        $this->assign('title', '采集参数配置');
+        return $this->fetch('admin@system/configcollect');
+    }
+
+
+    public function configplay()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+            $config_new['play'] = $config['play'];
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+
+            $path = './static/js/playerconfig.js';
+            if (!file_exists($path)) {
+                $path .= '.bak';
+            }
+            $fc = @file_get_contents($path);
+            $jsb = mac_get_body($fc, '//参数开始', '//参数结束');
+            $content = 'MacPlayerConfig=' . json_encode($config['play']) . ';';
+            $fc = str_replace($jsb, "\r\n" . $content . "\r\n", $fc);
+            $res = @fwrite(fopen('./static/js/playerconfig.js', 'wb'), $fc);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $fp = './static/js/playerconfig.js';
+        if (!file_exists($fp)) {
+            $fp .= '.bak';
+        }
+        $fc = file_get_contents($fp);
+        $jsb = trim(mac_get_body($fc, '//参数开始', '//参数结束'));
+        $jsb = substr($jsb, 16, strlen($jsb) - 17);
+
+        $play = json_decode($jsb, true);
+        $this->assign('play', $play);
+        $this->assign('title', '播放器参数配置');
+        return $this->fetch('admin@system/configplay');
+    }
+
+    public function configseo()
+    {
+        if (Request()->isPost()) {
+            $config = input();
+            $config_new['seo'] = $config['seo'];
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $this->assign('config', config('maccms'));
+        $this->assign('title', 'SEO参数配置');
+        return $this->fetch('admin@system/configseo');
+    }
+
+
+}

+ 229 - 0
application/admin/controller/Template.php

@@ -0,0 +1,229 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Template extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $param = input();
+        $path = $param['path'];
+        $path = str_replace('\\','',$path);
+        $path = str_replace('/','',$path);
+
+        if(empty($path)){
+            $path = '.@template';
+        }
+
+        if(substr($path,0,10) != ".@template") { $path = ".@template"; }
+        if(count( explode(".@",$path) ) > 2) {
+            $this->error('非法目录请求');
+            return;
+        }
+
+        $uppath = substr($path,0,strrpos($path,"@"));
+        $ischild = 0;
+        if ($path !=".@template"){
+            $ischild = 1;
+        }
+
+        $config = config('maccms.site');
+        if($param['current']==1){
+            $path = '.@template@' . $config['template_dir'] .'@' . $config['html_dir'] ;
+            $ischild = 0;
+            $pp = str_replace('@','/',$path);
+            $filters = $pp.'/*';
+        }
+        elseif($param['label']==1){
+            $path = '.@template@' . $config['template_dir'] .'@' . $config['html_dir'] ;
+            $ischild = 0;
+            $pp = str_replace('@','/',$path);
+            $filters = $pp.'/label/*';
+        }
+        elseif($param['ads']==1){
+            $path = '.@template@' . $config['template_dir'] .'@' . $config['html_dir'] ;
+            $ischild = 0;
+            $pp = str_replace('@','/',$path);
+            $filters = $pp.'/ads/*';
+        }
+        else{
+            $pp = str_replace('@','/',$path);
+            $filters = $pp.'/*';
+        }
+
+        $this->assign('curpath',$path);
+        $this->assign('uppath',$uppath);
+        $this->assign('ischild',$ischild);
+
+        $num_path = 0;
+        $num_file = 0;
+        $sum_size = 0;
+        $files = [];
+
+        if(is_dir($pp)) {
+            $farr = glob($filters);
+            if ($farr) {
+                foreach ($farr as $f) {
+
+                    if(is_dir($f)) {
+                            $num_path++;
+                            $tmp_path = str_replace('./template/', '.@template/', $f);
+                            $tmp_path = str_replace('/', '@', $tmp_path);
+                            $tmp_name = str_replace($path . '@', '', $tmp_path);
+                            $ftime = filemtime($f);
+
+                            $files[] = ['isfile' => 0, 'name' => $tmp_name, 'path' => $tmp_path, 'note'=>'文件夹', 'time' => $ftime];
+                    }
+                    elseif(is_file($f)) {
+                        $num_file++;
+                        $fsize = filesize($f);
+                        $sum_size += $fsize;
+                        $fsize = mac_format_size($fsize);
+                        $ftime = filemtime($f);
+                        $tmp_path = mac_convert_encoding($f, "UTF-8", "GB2312");
+
+                        $path_info = @pathinfo($f);
+                        $tmp_path = $path_info['dirname'];
+                        $tmp_name = $path_info['basename'];
+
+                        $files[] = ['isfile' => 1, 'name' => $tmp_name, 'path' => $tmp_path, 'fullname'=> $tmp_path.'/'.$tmp_name, 'size' => $fsize,'note'=>'文件', 'time' => $ftime];
+                    }
+                }
+            }
+        }
+        $this->assign('sum_size',mac_format_size($sum_size));
+        $this->assign('num_file',$num_file);
+        $this->assign('num_path',$num_path);
+        $this->assign('files',$files);
+
+        $this->assign('title','模板管理');
+        return $this->fetch('admin@template/index');
+    }
+
+    public function ads()
+    {
+        $adsdir = $GLOBALS['config']['site']['ads_dir'];
+        if(empty($adsdir)){
+            $adsdir='ads';
+        }
+        $path = './template/'.$GLOBALS['config']['site']['template_dir'].'/'.$adsdir ;
+        if(!file_exists($path)){
+            mac_mkdirss($path);
+        }
+
+        $filters = $path.'/*.js';
+        $num_file=0;
+        $sum_size=0;
+        $farr = glob($filters);
+        if ($farr) {
+            foreach ($farr as $f) {
+                if(is_file($f)) {
+                    $num_file++;
+                    $fsize = filesize($f);
+                    $sum_size += $fsize;
+                    $fsize = mac_format_size($fsize);
+                    $ftime = filemtime($f);
+                    $tmp_path = mac_convert_encoding($f, "UTF-8", "GB2312");
+
+                    $path_info = @pathinfo($f);
+                    $tmp_path = $path_info['dirname'];
+                    $tmp_name = $path_info['basename'];
+
+                    $files[] = ['isfile' => 1, 'name' => $tmp_name, 'path' => $tmp_path, 'fullname'=> $tmp_path.'/'.$tmp_name, 'size' => $fsize,'note'=>'文件', 'time' => $ftime];
+                }
+            }
+        }
+        $this->assign('curpath',$path);
+        $this->assign('sum_size',mac_format_size($sum_size));
+        $this->assign('num_file',$num_file);
+        $this->assign('files',$files);
+        $this->assign('title','广告位管理');
+        return $this->fetch('admin@template/ads');
+    }
+
+    public function info()
+    {
+        $param = input();
+
+        $fname = $param['fname'];
+        $fpath = $param['fpath'];
+
+        if( empty($fpath)){
+            $this->error('参数错误1');
+            return;
+        }
+        $fpath = str_replace('@','/',$fpath);
+        $fullname = $fpath .'/' .$fname;
+        $fullname = str_replace('\\','/',$fullname);
+
+        if( (substr($fullname,0,10) != "./template") || count( explode("./",$fullname) ) > 2) {
+            $this->error('参数错误2');
+            return;
+        }
+        $path = pathinfo($fullname);
+        if(!empty($fname)) {
+            $extarr = array('html', 'htm', 'js', 'xml');
+            if (!in_array($path['extension'], $extarr)) {
+                $this->error('参数错误,后缀名只允许htm,html,js,xml');
+                return;
+            }
+        }
+
+        if (Request()->isPost()) {
+            $fcontent = $param['fcontent'];
+            if(strpos($fcontent,'<?')!==false || strpos($fcontent,'{php}')!==false){
+                $this->error('安全提示,模板中包含php代码禁止在后台编辑');
+                return;
+            }
+            $res = @fwrite(fopen($fullname,'wb'),$fcontent);
+
+            if($res===false){
+                return $this->error('保存失败,请重试');
+            }
+            return $this->success('保存成功');
+        }
+
+        $fcontent = @file_get_contents($fullname);
+        $fcontent = str_replace('</textarea>','<&#47textarea>',$fcontent);
+        $this->assign('fname',$fname);
+        $this->assign('fpath',$fpath);
+        $this->assign('fcontent',$fcontent);
+
+        return $this->fetch('admin@template/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $fname = $param['fname'];
+        if(!empty($fname)){
+            if(!is_array($fname)){
+                $fname = [$fname];
+            }
+            foreach($fname as $a){
+                $a = str_replace('\\','/',$a);
+
+                if( (substr($a,0,10) != "./template") || count( explode("./",$a) ) > 2) {
+
+                }
+                else{
+                    $a = mac_convert_encoding($a,"UTF-8","GB2312");
+                    if(file_exists($a)){ @unlink($a); }
+                }
+            }
+        }
+        return $this->success('删除成功');
+    }
+
+    public function wizard()
+    {
+        $this->assign('title','标签向导管理');
+        return $this->fetch('admin@template/wizard');
+    }
+
+}

+ 79 - 0
application/admin/controller/Timming.php

@@ -0,0 +1,79 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Timming extends Base
+{
+    var $_pre;
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $list = config('timming');
+        $this->assign('list',$list);
+        $this->assign('title','定时任务管理');
+        return $this->fetch('admin@timming/index');
+    }
+
+    public function info()
+    {
+        $param = input();
+        $list = config('timming');
+        if (Request()->isPost()) {
+            $param['weeks'] = join(',',$param['weeks']);
+            $param['hours'] = join(',',$param['hours']);
+            $list[$param['name']] = $param;
+            $res = mac_arr2file( APP_PATH .'extra/timming.php', $list);
+            if($res===false){
+                return $this->error('保存配置文件失败,请重试!');
+            }
+
+            return $this->success('保存成功!');
+        }
+        $info = $list[$param['id']];
+
+        $this->assign('info',$info);
+        $this->assign('title','信息管理');
+        return $this->fetch('admin@timming/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $list = config('timming');
+        unset($list[$param['ids']]);
+        $res = mac_arr2file(APP_PATH. 'extra/timming.php', $list);
+        if($res===false){
+            return $this->error('删除失败,请重试!');
+        }
+
+        return $this->success('删除成功!');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+
+        if(!empty($ids) && in_array($col,['status'])){
+            $list = config('timming');
+            $ids = explode(',',$ids);
+            foreach($list as $k=>&$v){
+                if(in_array($k,$ids)){
+                    $v[$col] = $val;
+                }
+            }
+            $res = mac_arr2file(APP_PATH. 'extra/timming.php', $list);
+            if($res===false){
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+        return $this->error('参数错误');
+    }
+}

+ 112 - 0
application/admin/controller/Topic.php

@@ -0,0 +1,112 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Topic extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function data()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+
+        $where=[];
+        if(in_array($param['status'],['0','1'],true)){
+            $where['topic_status'] = ['eq',$param['status']];
+        }
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['topic_name'] = ['like','%'.$param['wd'].'%'];
+        }
+
+        $order='topic_time desc';
+        $res = model('Topic')->listData($where,$order,$param['page'],$param['limit']);
+
+        foreach($res['list'] as $k=>&$v){
+            $v['ismake'] = 1;
+            if($GLOBALS['config']['view']['topic_detail'] >0 && $v['topic_time_make'] < $v['topic_time']){
+                $v['ismake'] = 0;
+            }
+        }
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+        $this->assign('title','专题管理');
+        return $this->fetch('admin@topic/index');
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input('post.');
+            $res = model('Topic')->saveData($param);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+
+        $id = input('id');
+        $where=[];
+        $where['topic_id'] = ['eq',$id];
+        $res = model('Topic')->infoData($where);
+
+
+        $this->assign('info',$res['info']);
+
+        $config = config('maccms.site');
+        $this->assign('install_dir',$config['install_dir']);
+
+        return $this->fetch('admin@topic/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['topic_id'] = ['in',$ids];
+            $res = model('Topic')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+
+        if(!empty($ids) && in_array($col,['topic_status','topic_level']) ){
+            $where=[];
+            $where['topic_id'] = ['in',$ids];
+
+            $res = model('Topic')->fieldData($where,$col,$val);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+}

+ 261 - 0
application/admin/controller/Type.php

@@ -0,0 +1,261 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Type extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+        $this->assign('title','视频分类管理');
+    }
+
+    public function index()
+    {
+        $order='type_sort asc';
+        $where=[];
+        $res = model('Type')->listData($where,$order,'tree');
+
+        $list_count =[];
+        //视频数量
+        $tmp = model('Vod')->field('type_id_1,type_id,count(vod_id) as cc')->where($where)->group('type_id_1,type_id')->select();
+        foreach($tmp as $k=>$v){
+            $list_count[$v['type_id_1']] += $v['cc'];
+            $list_count[$v['type_id']] = $v['cc'];
+        }
+        //文章数量
+        $tmp = model('Art')->field('type_id_1,type_id,count(art_id) as cc')->where($where)->group('type_id_1,type_id')->select();
+        foreach($tmp as $k=>$v){
+            $list_count[$v['type_id_1']] += $v['cc'];
+            $list_count[$v['type_id']] = $v['cc'];
+        }
+
+        //演员数量
+        $tmp = model('Actor')->field('type_id_1,type_id,count(actor_id) as cc')->where($where)->group('type_id_1,type_id')->select();
+        foreach($tmp as $k=>$v){
+            $list_count[$v['type_id_1']] += $v['cc'];
+            $list_count[$v['type_id']] = $v['cc'];
+        }
+        //网址数量
+        $tmp = model('Website')->field('type_id_1,type_id,count(website_id) as cc')->where($where)->group('type_id_1,type_id')->select();
+        foreach($tmp as $k=>$v){
+            $list_count[$v['type_id_1']] += $v['cc'];
+            $list_count[$v['type_id']] = $v['cc'];
+        }
+
+        //重新整合
+        foreach($res['list'] as $k=>$v){
+            $res['list'][$k]['cc'] = intval($list_count[$v['type_id']]);
+            foreach($v['child'] as $k2=>$v2){
+                $res['list'][$k]['child'][$k2]['cc'] = intval($list_count[$v2['type_id']]);
+            }
+        }
+
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('title','分类管理');
+        return $this->fetch('admin@type/index');
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input('post.');
+            $res = model('Type')->saveData($param);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            model('Type')->setCache();
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+        $pid = input('pid');
+        $where=[];
+        $where['type_id'] = ['eq',$id];
+        $res = model('Type')->infoData($where);
+
+        $where=[];
+        $where['type_id'] = ['eq',$pid];
+        $resp = model('Type')->infoData($where);
+
+        $this->assign('info',$res['info']);
+        $this->assign('infop',$resp['info']);
+        $this->assign('pid',$pid);
+
+        $where=[];
+        $where['type_pid'] = ['eq','0'];
+        $order='type_sort asc';
+        $parent = model('Type')->listData($where,$order);
+        $this->assign('parent',$parent['list']);
+
+        return $this->fetch('admin@type/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['type_id'] = ['in',$ids];
+            $res = model('Type')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+
+        if(!empty($ids) && in_array($col,['type_status']) && in_array($val,['0','1'])){
+            $where=[];
+            $where['type_id'] = ['in',$ids];
+
+            $res = model('Type')->fieldData($where,$col,$val);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function batch()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        foreach ($ids as $k=>$id) {
+
+            $data = [];
+            $data['type_id'] = intval($id);
+            $data['type_name'] = $param['type_name_'.$id];
+            $data['type_sort'] = $param['type_sort_'.$id];
+            $data['type_en'] = $param['type_en_'.$id];
+            $data['type_tpl'] = $param['type_tpl_'.$id];
+            $data['type_tpl_list'] = $param['type_tpl_list_'.$id];
+            $data['type_tpl_detail'] = $param['type_tpl_detail_'.$id];
+
+            if (empty($data['type_name'])) {
+                $data['type_name'] = '未知';
+            }
+
+            $res = model('Type')->saveData($data);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+        }
+        $this->success($res['msg']);
+    }
+
+    public function extend()
+    {
+        $param = input();
+        if(!empty($param['id'])){
+            $type_list = model('Type')->getCache('type_list');
+            $type_info = $type_list[$param['id']];
+            if(!empty($type_info)){
+                $type_mid = $type_info['type_mid'];
+                $type_pid = $type_info['type_pid'];
+                $type_pinfo = $type_list[$type_pid];
+                $type_extend = $type_info['type_extend'];
+                $type_pextend = $type_pinfo['type_extend'];
+
+                $config = config('maccms.app');
+
+                if($type_mid==2) {
+                    if(empty($type_extend['class']) && !empty($type_pextend['class'])){
+                        $type_extend['class'] = $type_pextend['class'];
+                    }
+                    elseif(empty($type_extend['class']) && !empty($config['art_extend_class'])){
+                        $type_extend['class'] = $config['art_extend_class'];
+                    }
+                }
+                else{
+                    if(empty($type_extend['class']) && !empty($type_pextend['class'])){
+                        $type_extend['class'] = $type_pextend['class'];
+                    }
+                    elseif(empty($type_extend['class']) && !empty($config['vod_extend_class'])){
+                        $type_extend['class'] = $config['vod_extend_class'];
+                    }
+
+                    if(empty($type_extend['state']) && !empty($type_pextend['state'])){
+                        $type_extend['state'] = $type_pextend['state'];
+                    }
+                    elseif(empty($type_extend['state']) && !empty($config['vod_extend_state'])){
+                        $type_extend['state'] = $config['vod_extend_state'];
+                    }
+
+                    if(empty($type_extend['version']) && !empty($type_pextend['version'])){
+                        $type_extend['version'] = $type_pextend['version'];
+                    }
+                    elseif(empty($type_extend['version']) && !empty($config['vod_extend_version'])){
+                        $type_extend['version'] = $config['vod_extend_version'];
+                    }
+
+                    if(empty($type_extend['area']) && !empty($type_pextend['area'])){
+                        $type_extend['area'] = $type_pextend['area'];
+                    }
+                    elseif(empty($type_extend['area']) && !empty($config['vod_extend_area'])){
+                        $type_extend['area'] = $config['vod_extend_area'];
+                    }
+
+                    if(empty($type_extend['lang']) && !empty($type_pextend['lang'])){
+                        $type_extend['lang'] = $type_pextend['lang'];
+                    }
+                    elseif(empty($type_extend['lang']) && !empty($config['vod_extend_lang'])){
+                        $type_extend['lang'] = $config['vod_extend_lang'];
+                    }
+
+                    if(empty($type_extend['year']) && !empty($type_pextend['year'])){
+                        $type_extend['year'] = $type_pextend['year'];
+                    }
+                    elseif(empty($type_extend['year']) && !empty($config['vod_extend_year'])){
+                        $type_extend['year'] = $config['vod_extend_year'];
+                    }
+                }
+
+
+                if(!empty($type_extend)){
+                    foreach($type_extend as $key=>$value){
+                        $options = '';
+                        foreach(explode(',',$value) as $option){
+                            $extend[$key][] = $option;
+                        }
+                    }
+                }
+
+                return $this->success('ok',null,$extend);
+            }
+            return $this->error('获取信息失败');
+
+        }
+    }
+
+    public function move()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $val = $param['val'];
+        if(!empty($ids) && !empty($val)){
+            $where=[];
+            $where['type_id'] = ['in',$ids];
+            $res = model('Type')->moveData($where,$val);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+}

+ 64 - 0
application/admin/controller/Ulog.php

@@ -0,0 +1,64 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Ulog extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+        $where=[];
+        if(!empty($param['mid'])){
+            $where['ulog_mid'] = ['eq',$param['mid']];
+        }
+        if(!empty($param['type'])){
+            $where['ulog_type'] = ['eq',$param['type']];
+        }
+        if(!empty($param['uid'])){
+            $where['user_id'] = ['eq',$param['uid'] ];
+        }
+
+        $order='ulog_id desc';
+        $res = model('Ulog')->listData($where,$order,$param['page'],$param['limit']);
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+
+        $this->assign('title','日志管理');
+        return $this->fetch('admin@ulog/index');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $all = $param['all'];
+        if(!empty($ids)){
+            $where=[];
+            $where['ulog_id'] = ['in',$ids];
+            if($all==1){
+                $where['ulog_id'] = ['gt',0];
+            }
+            $res = model('Ulog')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+}

+ 165 - 0
application/admin/controller/Update.php

@@ -0,0 +1,165 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+use app\common\util\PclZip;
+
+class Update extends Base
+{
+    var $_url;
+    var $_save_path;
+
+    public function __construct()
+    {
+        parent::__construct();
+        $this->_url = base64_decode("aHR0cDovL3VwZGF0ZS5tYWNjbXMubGEv")."v10/";
+        $this->_save_path = './application/data/update/';
+    }
+
+    public function index()
+    {
+        $this->assign('title','test管理');
+        return $this->fetch('admin@test/index');
+    }
+
+    public function step1($file='')
+    {
+        if(empty($file)){
+            return $this->error('参数错误');
+        }
+        $version = config('version.code');
+        $url = $this->_url .$file . '.zip?t='.time();
+
+        echo $this->fetch('admin@public/head');
+        echo "<div class='update'><h1>在线升级进行中第一步【文件升级】,请稍后......</h1><textarea rows=\"25\" class='layui-textarea' readonly>正在下载升级文件包...\n";
+        ob_flush();flush();
+        sleep(1);
+
+        $save_file = $version.'.zip';
+		
+        $html = mac_curl_get($url);
+        @fwrite(@fopen($this->_save_path.$save_file,'wb'),$html);
+        if(!is_file($this->_save_path.$save_file)){
+            echo "下载升级包失败,请重试...\n";
+            exit;
+        }
+
+        if(filesize($this->_save_path.$save_file) <1){
+            @unlink($this->_save_path.$save_file);
+            echo "下载升级包失败,请重试...\n";
+            exit;
+        }
+
+        echo "下载升级包完毕...\n";
+        echo "正在处理升级包的文件...\n";
+        ob_flush();flush();
+        sleep(1);
+
+        $archive = new PclZip();
+        $archive->PclZip($this->_save_path.$save_file);
+        if(!$archive->extract(PCLZIP_OPT_PATH, '', PCLZIP_OPT_REPLACE_NEWER)) {
+            echo $archive->error_string."\n";
+            echo '升级失败,请检查系统目录及文件权限!' ."\n";;
+            exit;
+        }
+        else{
+
+        }
+        @unlink($this->_save_path.$save_file);
+        echo '</textarea></div>';
+        mac_jump( url('update/step2',['jump'=>1]) ,3);
+    }
+
+    public function step2()
+    {
+        $version = config('version.code');
+
+        $save_file = 'database.php';
+
+        echo $this->fetch('admin@public/head');
+        echo "<div class='update'><h1>在线升级进行中第二步【数据升级】,请稍后......</h1><textarea rows=\"25\" class='layui-textarea' readonly>\n";
+        ob_flush();flush();
+        sleep(1);
+
+        $res=true;
+        // 导入SQL
+        $sql_file = $this->_save_path .$save_file;
+
+        if (is_file($sql_file)) {
+            echo "发现数据库升级脚本文件,正在处理...\n";
+            ob_flush();flush();
+            $pre = config('database.prefix');
+            $schema = Db::query('select * from information_schema.columns where table_schema = ?',[ config('database.database') ]);
+            $col_list = [];
+            $sql='';
+            foreach($schema as $k=>$v){
+                $col_list[$v['TABLE_NAME']][$v['COLUMN_NAME']] = $v;
+            }
+            @include $sql_file;
+            //dump($sql);die;
+
+            /*
+            //$html =  @file_get_contents($sql_file);
+            //$sql = mac_get_body($html,'--'.$version.'-start--','--'.$version.'-end--');
+            $sql = @file_get_contents($sql_file);
+            */
+            if(!empty($sql)) {
+                $sql_list = mac_parse_sql($sql, 0, ['mac_' => $pre]);
+
+                if ($sql_list) {
+                    $sql_list = array_filter($sql_list);
+                    foreach ($sql_list as $v) {
+                        echo $v;
+                        try {
+                            Db::execute($v);
+                            echo "    ---成功"."\n\n";
+                        } catch (\Exception $e) {
+                            echo "    ---失败"."\n\n";
+                        }
+                        ob_flush();flush();
+                    }
+                }
+            }
+            else{
+
+            }
+            @unlink($sql_file);
+        }
+        else{
+            echo "未发现数据库升级脚本,稍后进入更新数据缓存部分...\n";
+        }
+        echo '</textarea></div>';
+        mac_jump(url('update/step3', ['jump' => 1]), 3);
+    }
+
+    public function step3()
+    {
+        echo $this->fetch('admin@public/head');
+        echo "<div class='update'><h1>在线升级进行中第三步【更新缓存】,请稍后......</h1><textarea rows=\"25\" class='layui-textarea' readonly>\n";
+        ob_flush();flush();
+        sleep(1);
+
+        $this->_cache_clear();
+
+        echo "更新数据缓存文件...\n";
+        echo "恭喜您,系统升级完毕...";
+        ob_flush();flush();
+        echo '</textarea></div>';
+    }
+
+    public function one()
+    {
+        $param = input();
+        $a = $param['a'];
+        $b = $param['b'];
+        $c = $param['c'];
+        $d = $param['d'];
+        $e = mac_curl_get( base64_decode("aHR0cDovL3VwZGF0ZS5tYWNjbXMubGEv") . $a."/".$b);
+        if ($e!=""){
+            if (($d!="") && strpos(",".$e,$d) <=0){ return; }
+            if($b=='admin.php'){$b=IN_FILE;}
+            $f=filesize($b);
+            if (intval($c)<>intval($f)) { @fwrite(@fopen( $b,"wb"),$e);  }
+        }
+        die;
+    }
+}

+ 305 - 0
application/admin/controller/Upload.php

@@ -0,0 +1,305 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+
+
+class Upload extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $param = input();
+        $this->assign('path',$param['path']);
+        $this->assign('id',$param['id']);
+
+        $this->assign('title','上传图片');
+        return $this->fetch('admin@upload/index');
+    }
+
+    public function test()
+    {
+        $temp_file = tempnam(sys_get_temp_dir(), 'Tux');
+        if($temp_file){
+            echo '测试写入成功:' . $temp_file;
+        }
+        else{
+            echo '写入失败,请检查临时文件目录权限:' . sys_get_temp_dir() ;
+        }
+    }
+
+    public function upload()
+    {
+        
+		$param = input();
+        $param['from'] = empty($param['from']) ? 'input' : $param['from'];
+        $param['input'] = empty($param['input']) ? 'file' : $param['input'];
+        $param['flag'] = empty($param['flag']) ? 'vod' : $param['flag'];
+        $param['thumb'] = empty($param['thumb']) ? '0' : $param['thumb'];
+        $param['thumb_class'] = empty($param['thumb_class']) ? '' : $param['thumb_class'];
+        $param['user_id'] = empty($param['user_id']) ? '0' : $param['user_id'];
+
+        $config = config('maccms.site');
+        $pre= $config['install_dir'];
+
+        switch ($param['from']) {
+            case 'kindeditor':
+                $param['input'] = 'imgFile';
+                break;
+            case 'umeditor':
+                $param['input'] = 'upfile';
+                break;
+            case 'ckeditor':
+                $param['input'] = 'upload';
+                break;
+            case 'ueditor':
+                $param['input'] = 'upfile';
+                if (isset($_GET['action']) && $_GET['action'] == 'config') {
+                    $UE_CONFIG = json_decode(preg_replace("/\/\*[\s\S]+?\*\//", "", file_get_contents('./static/ueditor/config.json')), true);
+                    echo json_encode($UE_CONFIG);
+                    exit;
+                }
+                break;
+            default:// 默认使用layui.upload上传控件
+                $pre='';
+                break;
+        }
+
+        // 获取表单上传文件 例如上传了001.jpg
+        $file = request()->file($param['input']);
+
+        $data = [];
+        if (empty($file)) {
+            return self::upload_return('未找到上传的文件(原因:表单名可能错误,默认表单名“file”)!', $param['from']);
+        }
+        if ($file->getMime() == 'text/x-php') {
+            return self::upload_return('禁止上传php,html文件!', $param['from']);
+        }
+
+        $upload_image_ext = 'jpg,jpeg,png,gif';
+        $upload_file_ext = 'doc,docx,xls,xlsx,ppt,pptx,pdf,wps,txt,rar,zip,torrent';
+        $upload_media_ext = 'rm,rmvb,avi,mkv,mp4,mp3';
+        $sys_max_filesize = ini_get('upload_max_filesize');
+        $config = config('maccms.upload');
+
+        // 格式、大小校验
+        if ($file->checkExt($upload_image_ext)) {
+            $type = 'image';
+        }
+        elseif ($file->checkExt($upload_file_ext)) {
+            $type = 'file';
+        }
+        elseif ($file->checkExt($upload_media_ext)) {
+            $type = 'media';
+        }
+        else {
+            return self::upload_return('非系统允许的上传格式!', $param['from']);
+        }
+
+        if($param['flag']=='user'){
+            $uniq = $param['user_id'] % 10;
+            // 上传附件路径
+            $_upload_path = ROOT_PATH . 'upload' . '/user/'  . $uniq .'/';
+            // 附件访问路径
+            $_save_path = 'upload'. '/user/' . $uniq .'/';
+            $_save_name = $param['user_id'] . '.jpg';
+
+            if(!file_exists($_save_path)){
+                mac_mkdirss($_save_path);
+            }
+
+            $upfile = $file->move($_upload_path,$_save_name);
+
+            if (!is_file($_upload_path.$_save_name)) {
+                return self::upload_return('文件上传失败!', $param['from']);
+            }
+            $file = $_save_path.str_replace('\\', '/', $_save_name);
+            $config= [
+                'thumb_type'=>6,
+                'thumb_size'=> $GLOBALS['config']['user']['portrait_size'],
+            ];
+
+            $new_thumb = $param['user_id'] .'.jpg';
+            $new_file = $_save_path . $new_thumb;
+            try {
+                $image = \think\Image::open('./' . $file);
+                $t_size = explode('x', strtolower($GLOBALS['config']['user']['portrait_size']));
+                if (!isset($t_size[1])) {
+                    $t_size[1] = $t_size[0];
+                }
+                $res = $image->thumb($t_size[0], $t_size[1], 6)->save('./' . $new_file);
+
+                $file_count = 1;
+                $file_size = round($upfile->getInfo('size')/1024, 2);
+                $data = [
+                    'file'  => $new_file,
+                    'type'  => $type,
+                    'size'  => $file_size,
+                    'flag' => $param['flag'],
+                    'ctime' => request()->time(),
+                    'thumb_class'=>$param['thumb_class'],
+                ];
+
+
+                return self::upload_return('文件上传成功', $param['from'], 1, $data);
+            }
+            catch(\Exception $e){
+                return self::upload_return('生成缩放头像图片文件失败!', $param['from']);
+            }
+            exit;
+        }
+        // 上传附件路径
+        $_upload_path = ROOT_PATH . 'upload' . '/' . $param['flag'] . '/' ;
+        // 附件访问路径
+        $_save_path = 'upload'. '/' . $param['flag'] . '/';
+        $ymd = date('Ymd');
+
+        $n_dir = $ymd;
+        for($i=1;$i<=100;$i++){
+            $n_dir = $ymd .'-'.$i;
+            $path1 = $_upload_path . $n_dir. '/';
+            if(file_exists($path1)){
+                $farr = glob($path1.'*.*');
+                if($farr){
+                    $fcount = count($farr);
+                    if($fcount>999){
+                        continue;
+                    }
+                    else{
+                        break;
+                    }
+                }
+                else{
+                    break;
+                }
+            }
+            else{
+                break;
+            }
+        }
+
+        $savename = $n_dir . '/' . md5(microtime(true));
+        $upfile = $file->move($_upload_path,$savename);
+
+        if (!is_file($_upload_path.$upfile->getSaveName())) {
+            return self::upload_return('文件上传失败!', $param['from']);
+        }
+
+        //附件访问地址
+        //$_file_path = $_save_path.$upfile->getSaveName();
+
+        $file_count = 1;
+        $file_size = round($upfile->getInfo('size')/1024, 2);
+        $data = [
+            'file'  => $_save_path.str_replace('\\', '/', $upfile->getSaveName()),
+            'type'  => $type,
+            'size'  => $file_size,
+            'flag' => $param['flag'],
+            'ctime' => request()->time(),
+            'thumb_class'=>$param['thumb_class'],
+        ];
+
+        $data['thumb'] = [];
+        if ($type == 'image') {
+            //水印
+            if ($config['watermark'] == 1) {
+                model('Image')->watermark($data['file'],$config,$param['flag']);
+            }
+            // 缩略图
+            if ($param['thumb']==1 &&  $config['thumb'] == 1) {
+                $dd = model('Image')->makethumb($data['file'],$config,$param['flag']);
+                if(is_array($dd)){
+                    $data = array_merge($data,$dd);
+                }
+            }
+        }
+		unset($upfile);
+
+        if ($config['mode'] == 2) {
+            $config['mode'] = 'upyun';
+        }
+        elseif ($config['mode'] == 3){
+            $config['mode'] = 'qiniu';
+        }
+        elseif ($config['mode'] == 4) {
+            $config['mode'] = 'ftp';
+        }
+        elseif ($config['mode'] == 5) {
+            $config['mode'] = 'weibo';
+        }
+
+        $config['mode'] = strtolower($config['mode']);
+
+        if(!in_array($config['mode'],['local','remote'])){
+            $data['file'] = model('Upload')->api($data['file'],$config);
+            if(!empty($data['thumb'])){
+                $data['thumb'][0]['file'] = model('Upload')->api($data['thumb'][0]['file'],$config);
+            }
+        }
+
+        if ( in_array($param['from'],['ueditor','umeditor','kindeditor','ckeditor'])){
+            if(substr($data['file'],0,4)!='http' && substr($data['file'],0,4)!='mac:'){
+                $data['file']  =  $pre. $data['file'];
+            }
+            else{
+                $data['file']  = mac_url_content_img($data['file']);
+            }
+        }
+        return self::upload_return('文件上传成功', $param['from'], 1, $data);
+    }
+
+
+    private function upload_return($info = '', $from = 'input', $status = 0, $data = [])
+    {
+        $arr = [];
+        switch ($from) {
+            case 'kindeditor':
+                if ($status == 0) {
+                    $arr['error'] = 1;
+                    $arr['message'] = $info;
+                } else {
+                    $arr['error'] = 0;
+                    $arr['url'] = $data['file'];
+                }
+                echo json_encode($arr, 1);exit;
+                break;
+            case 'ckeditor':
+                if ($status == 1) {
+                    $arr['uploaded'] = 1;
+                    $arr['fileName'] = '';
+                    $arr['url'] = $data['file'];
+                    //echo '<script type="text/javascript">window.parent.CKEDITOR.tools.callFunction(1, "'.$data['file'].'", "");</script>';
+                } else {
+                    $arr['uploaded'] = 0;
+                    $arr['error']['msg'] = $info;
+                    //echo '<script type="text/javascript">window.parent.CKEDITOR.tools.callFunction(1, "", "'.$info.'");</script>';
+                }
+                echo json_encode($arr, 1);exit;
+                break;
+            case 'umeditor':
+            case 'ueditor':
+                if ($status == 0) {
+                    $arr['message'] = $info;
+                    $arr['state'] = 'ERROR';
+                } else {
+                    $arr['message'] = $info;
+                    $arr['url'] = $data['file'];
+                    $arr['state'] = 'SUCCESS';
+                }
+                echo json_encode($arr, 1);exit;
+                break;
+
+            default:
+                $arr['msg'] = $info;
+                $arr['code'] = $status;
+                $arr['data'] = $data;
+                break;
+        }
+        return $arr;
+    }
+
+}

+ 340 - 0
application/admin/controller/Urlsend.php

@@ -0,0 +1,340 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+use think\Cache;
+
+class Urlsend extends Base
+{
+    var $_lastid='';
+    var $_cache_name ='';
+
+    public function __construct()
+    {
+        parent::__construct();
+
+        $this->_param = input();
+    }
+
+    public function index()
+    {
+
+        if (Request()->isPost()) {
+            $config = input();
+            $config_new['urlsend'] = $config['urlsend'];
+
+            $config_old = config('maccms');
+            $config_new = array_merge($config_old, $config_new);
+
+            $res = mac_arr2file(APP_PATH . 'extra/maccms.php', $config_new);
+            if ($res === false) {
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $urlsend_config = $GLOBALS['config']['urlsend'];
+        $this->assign('config',$urlsend_config);
+
+        $key = $GLOBALS['config']['app']['cache_flag']. '_'.'urlsend_break_baidu_push';
+        $urlsend_break_baidu_push = Cache::get($key);
+        $key = $GLOBALS['config']['app']['cache_flag']. '_'.'urlsend_break_baidu_bear';
+        $urlsend_break_baidu_bear = Cache::get($key);
+
+        $this->assign('urlsend_break_baidu_push',$urlsend_break_baidu_push);
+        $this->assign('urlsend_break_baidu_bear',$urlsend_break_baidu_bear);
+
+        $this->assign('title','URL推送管理');
+        return $this->fetch('admin@urlsend/index');
+    }
+
+
+
+    public function push($pp=[])
+    {
+        if(!empty($pp)){
+            $this->_param = $pp;
+        }
+
+        if($this->_param['ac']=='baidu_push'){
+            $this->baidu_push();
+        }
+        elseif($this->_param['ac']=='baidu_bear'){
+            $this->baidu_bear();
+        }
+        else{
+            $this->error('参数错误');
+        }
+    }
+
+    public function data()
+    {
+        mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+
+        $list = [];
+        $mid = $this->_param['mid'];
+        $this->_param['page'] = intval($this->_param['page']) <1 ? 1 : $this->_param['page'];
+        $this->_param['limit'] = intval($this->_param['limit']) <1 ? 500 : $this->_param['limit'];
+        $ids = $this->_param['ids'];
+        $ac2 = $this->_param['ac2'];
+
+        $today = strtotime(date('Y-m-d'));
+        $where = [];
+        $this->_cache_name = $GLOBALS['config']['app']['cache_flag']. '_'.'urlsend_cach_'.$mid.'_'.$ac2;
+        $data = Cache::get($this->_cache_name);
+        $col = '';
+        switch($mid)
+        {
+            case 1:
+                $where['vod_status'] = ['eq',1];
+
+                if($ac2=='today'){
+                    $where['vod_time_add'] = ['gt',$today];
+                }
+                if(!empty($ids)){
+                    $where['vod_id'] = ['in',$ids];
+                }
+                elseif(!empty($data)){
+                    $where['vod_id'] = ['gt', $data];
+                }
+
+                $col = 'vod';
+                $order = 'vod_id asc';
+                $fun = 'mac_url_vod_detail';
+                $res = model('Vod')->listData($where,$order,$this->_param['page'],$this->_param['limit']);
+                break;
+            case 2:
+                $where['art_status'] = ['eq',1];
+
+                if($ac2=='today'){
+                    $where['art_time_add'] = ['gt',$today];
+
+                }
+                if(!empty($ids)){
+                    $where['art_id'] = ['in',$ids];
+                }
+                elseif(!empty($data)){
+                    $where['art_id'] = ['gt', $data];
+                }
+
+                $col = 'art';
+                $order = 'art_id asc';
+                $fun = 'mac_url_art_detail';
+                $res = model('Art')->listData($where,$order,$this->_param['page'],$this->_param['limit']);
+                break;
+            case 3:
+                $where['topic_status'] = ['eq',1];
+
+                if($ac2=='today'){
+                    $where['topic_time_add'] = ['gt',$today];
+
+                }
+                if(!empty($ids)){
+                    $where['topic_id'] = ['in',$ids];
+                }
+                elseif(!empty($data)){
+                    $where['topic_id'] = ['gt', $data];
+                }
+
+                $col = 'topic';
+                $order = 'topic_id asc';
+                $fun = 'mac_url_topic_detail';
+                $res = model('Topic')->listData($where,$order,$this->_param['page'],$this->_param['limit']);
+                break;
+            case 8:
+                $where['actor_status'] = ['eq',1];
+
+                if($ac2=='today'){
+                    $where['actor_time_add'] = ['gt',$today];
+
+                }
+                if(!empty($ids)){
+                    $where['actor_id'] = ['in',$ids];
+                }
+                elseif(!empty($data)){
+                    $where['actor_id'] = ['gt', $data];
+                }
+                $col = 'actor';
+                $order = 'actor_id asc';
+                $fun = 'mac_url_actor_detail';
+                $res = model('Actor')->listData($where,$order,$this->_param['page'],$this->_param['limit']);
+                break;
+            case 9:
+                $where['role_status'] = ['eq',1];
+
+                if($ac2=='today'){
+                    $where['role_time_add'] = ['gt',$today];
+
+                }
+                if(!empty($ids)){
+                    $where['role_id'] = ['in',$ids];
+                }
+                elseif(!empty($data)){
+                    $where['role_id'] = ['gt', $data];
+                }
+                $col = 'role';
+                $order = 'role_id asc';
+                $fun = 'mac_url_role_detail';
+                $res = model('Role')->listData($where,$order,$this->_param['page'],$this->_param['limit']);
+                break;
+            case 11:
+                $where['website_status'] = ['eq',1];
+
+                if($ac2=='today'){
+                    $where['website_time_add'] = ['gt',$today];
+
+                }
+                if(!empty($ids)){
+                    $where['website_id'] = ['in',$ids];
+                }
+                elseif(!empty($data)){
+                    $where['website_id'] = ['gt', $data];
+                }
+                $col = 'website';
+                $order = 'website_id asc';
+                $fun = 'mac_url_website_detail';
+                $res = model('Website')->listData($where,$order,$this->_param['page'],$this->_param['limit']);
+                break;
+        }
+
+        if(empty($res['list'])){
+            mac_echo('没有获取到数据');
+            return;
+        }
+
+        mac_echo('共'.$res['total'].'条数据等待推送,分'.$res['pagecount'].'页推送,当前第'.$res['page'].'页');
+
+        $urls = [];
+        foreach($res['list'] as $k=>$v){
+            $urls[$v[$col.'_id']] =  $GLOBALS['http_type'] . $GLOBALS['config']['site']['site_url'] . $fun($v);
+            $this->_lastid = $v[$col.'_id'];
+
+            mac_echo($v[$col.'_id'] . '、'. $v[$col . '_name'] . '&nbsp;<a href="'.$urls[$v[$col.'_id']].'">'.$urls[$v[$col.'_id']].'</a>');
+        }
+
+        $res['urls'] = $urls;
+        return $res;
+    }
+
+    public function baidu_push()
+    {
+        $res = $this->data();
+        $key = $GLOBALS['config']['app']['cache_flag']. '_'.'urlsend_break_baidu_push';
+        Cache::set($key, url('urlsend/push').'?'. http_build_query($this->_param) );
+
+
+        if (!empty($res['urls'])) {
+            $type = $this->_param['type']; //urls: 添加, update: 更新, del: 删除
+            $token = $GLOBALS['config']['urlsend']['baidu_push_token'];
+            $site = $GLOBALS['http_type'] . $GLOBALS['config']['site']['site_url'];
+            if (empty($type)) {
+                $type = 'urls';
+            }
+            $api = 'http://data.zz.baidu.com/' . $type . '?site=' . $site . '&token=' . $token;
+            $head = ['Content-Type: text/plain'];
+            $data = implode("\n", $res['urls']);
+
+            $r = mac_curl_post($api, $data, $head);
+            $json = json_decode($r,true);
+            if(!$json){
+                mac_echo('请求失败,请重试');
+                return;
+            }
+            elseif($json['error']){
+                mac_echo('发生错误:'. $json['message'] );
+                return;
+            }
+            Cache::set($this->_cache_name, $this->_lastid);
+            mac_echo('推送成功'.$json['success'].'条;当天剩余可推'.$json['remain'].'条。');
+        }
+
+        if ($res['page'] >= $res['pagecount']) {
+            Cache::rm('urlsend_break_baidu_push');
+
+            mac_echo('数据推送完毕');
+            if(ENTRANCE=='admin') {
+                mac_jump(url('urlsend/index'), 3);
+            }
+        }
+        else {
+            $url = url('urlsend/baidu_push') . '?' . http_build_query($this->_param);
+            if(ENTRANCE=='admin') {
+                mac_jump($url, 3);
+            }
+        }
+
+    }
+
+    public function baidu_bear()
+    {
+        $res = $this->data();
+        $key = $GLOBALS['config']['app']['cache_flag']. '_'.'urlsend_break_baidu_bear';
+        Cache::set($key, url('urlsend/push').'?'. http_build_query($this->_param) );
+
+        if(!empty($res['urls'])){
+            $type = $this->_param['type']; //realtime实时, batch历史
+            $appid = $GLOBALS['config']['urlsend']['baidu_bear_appid'];
+            $token = $GLOBALS['config']['urlsend']['baidu_bear_token'];
+            if(empty($type)){
+                $type = 'realtime';
+            }
+            $api = 'http://data.zz.baidu.com/urls?appid='.$appid.'&token='.$token.'&type='.$type;
+
+            $head = ['Content-Type: text/plain'];
+            $data = implode("\n", $res['urls']);
+
+
+
+            $r = mac_curl_post($api, $data, $head);
+            $json = json_decode($r,true);
+
+            if(!$json){
+                mac_echo('请求失败,请重试');
+                return;
+            }
+            elseif($json['error']){
+                mac_echo('发生错误:'. $json['message'] );
+                return;
+            }
+            elseif($json['success_realtime'] ==0 && $json['remain_realtime']>0){
+                $data = array_slice($res['urls'], 0, $json['remain_realtime'],true );
+                $keys = array_keys($data);
+                $this->_lastid = end($keys);
+                
+                $data = implode("\n", $data);
+                $r = mac_curl_post($api, $data, $head);
+                $json = json_decode($r,true);
+                if(!$json){
+                    mac_echo('请求失败,请重试2');
+                    return;
+                }
+                elseif($json['error']){
+                    mac_echo('发生错误2:'. $json['message'] );
+                    return;
+                }
+            }
+
+            Cache::set($this->_cache_name, $this->_lastid);
+            if($type=='realtime'){
+                mac_echo('熊掌号实时推送'.$json['success_realtime'].'条;熊掌号实时剩余可推送'.$json['remain_realtime'].'条.');
+            }
+            else{
+                mac_echo('熊掌号历史推送'.$json['success_batch'].'条;熊掌号历史剩余可推送'.$json['remain_batch'].'条;');
+            }
+        }
+
+        if ($res['page'] >= $res['pagecount']) {
+            Cache::rm('urlsend_break_baidu_bear');
+            mac_echo('数据推送完毕');
+            if(ENTRANCE=='admin') {
+                mac_jump(url('urlsend/index'), 3);
+            }
+        }
+        else {
+            $url = url('urlsend/baidu_bear') . '?' . http_build_query($this->_param);
+            if(ENTRANCE=='admin') {
+                mac_jump($url, 3);
+            }
+        }
+    }
+
+}

+ 204 - 0
application/admin/controller/User.php

@@ -0,0 +1,204 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class User extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function data()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+
+        $where=[];
+        if(in_array($param['status'],['0','1'],true)){
+            $where['user_status'] = $param['status'];
+        }
+        if(!empty($param['group'])){
+            $where['group_id'] = $param['group'];
+        }
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['user_name'] = ['like','%'.$param['wd'].'%'];
+        }
+
+        $order='user_id desc';
+        $res = model('User')->listData($where,$order,$param['page'],$param['limit']);
+
+        $group_list = model('Group')->getCache('group_list');
+        foreach($res['list'] as $k=>$v){
+            $res['list'][$k]['group_name'] = $group_list[$v['group_id']]['group_name'];
+        }
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+
+        $this->assign('group_list',$group_list);
+
+        $this->assign('title','会员管理');
+        return $this->fetch('admin@user/index');
+    }
+
+    public function reward()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+
+        $param['uid'] = intval($param['uid']);
+
+        $where=[];
+
+        if(!empty($param['level'])){
+            if($param['level']=='1'){
+                $where['user_pid'] = ['eq', $param['uid']];
+            }
+            elseif($param['level']=='2'){
+                $where['user_pid_2'] = ['eq', $param['uid']];
+            }
+            elseif($param['level']=='3'){
+                $where['user_pid_3'] = ['eq', $param['uid']];
+            }
+        }
+        else{
+            $where['user_pid|user_pid_2|user_pid_3'] = ['eq', intval($param['uid']) ];
+        }
+
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['user_name'] = ['like','%'.$param['wd'].'%'];
+        }
+
+        $order='user_id desc';
+        $res = model('User')->listData($where,$order,$param['page'],$param['limit']);
+
+        $list=[];
+
+        $where2=[];
+        $where2['user_pid'] = ['eq', $param['uid']];
+        $user_ids_1 = Db::name('User')->where($where2)->column('user_id');
+        $level_cc_1 = count($user_ids_1);
+        $where3=[];
+        $where3['user_id_1'] = ['in',$user_ids_1];
+        $points_cc_1 = Db::name('Plog')->where($where3)->sum('plog_points');
+
+
+        $where2=[];
+        $where2['user_pid_2'] = ['eq', $param['uid']];
+        $user_ids_2 = Db::name('User')->where($where2)->column('user_id');
+        $level_cc_2 = count($user_ids_2);
+        $where3=[];
+        $where3['user_id_1'] = ['in',$user_ids_2];
+        $points_cc_2 = Db::name('Plog')->where($where3)->sum('plog_points');
+
+        $where2=[];
+        $where2['user_pid_3'] = ['eq', $param['uid']];
+        $user_ids_3 = Db::name('User')->where($where2)->column('user_id');
+        $level_cc_3 = count($user_ids_3);
+        $where3=[];
+        $where3['user_id_1'] = ['in',$user_ids_3];
+        $points_cc_3 = Db::name('Plog')->where($where3)->sum('plog_points');
+
+
+        $data=[];
+        $data['level_cc_1'] = intval($level_cc_1);
+        $data['level_cc_2'] = intval($level_cc_2);
+        $data['level_cc_3'] = intval($level_cc_3);
+        $data['points_cc_1'] = intval($points_cc_1);
+        $data['points_cc_2'] = intval($points_cc_2);
+        $data['points_cc_3'] = intval($points_cc_3);
+
+        $this->assign('data',$data);
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+
+        $this->assign('title','会员管理');
+        return $this->fetch('admin@user/reward');
+    }
+
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input('post.');
+            $res = model('User')->saveData($param);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+        $where=[];
+        $where['user_id'] = ['eq',$id];
+        $res = model('User')->infoData($where);
+
+        $this->assign('info',$res['info']);
+
+        $order='group_id asc';
+        $where=[];
+        $res = model('Group')->listData($where,$order);
+        $this->assign('group_list',$res['list']);
+
+        $this->assign('title','会员信息');
+        return $this->fetch('admin@user/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['user_id'] = ['in',$ids];
+            $res = model('User')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+
+        if(!empty($ids) && in_array($col,['user_status']) && in_array($val,['0','1'])){
+            $where=[];
+            $where['user_id'] = ['in',$ids];
+
+            $res = model('User')->fieldData($where,$col,$val);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+
+
+
+}

+ 76 - 0
application/admin/controller/Visit.php

@@ -0,0 +1,76 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Visit extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function index()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+        $where=[];
+        if(!empty($param['uid'])){
+            $where['user_id'] = ['eq',$param['uid'] ];
+        }
+        if(isset($param['time'])){
+            $t = strtotime(date('Y-m-d',strtotime('-'.$param['time'] .' day')));
+            $where['visit_time'] = ['egt', intval($t) ];
+        }
+        if(!empty($param['wd'])){
+            $a = $param['wd'];
+            if(substr($a,5)==='http:'){
+                $b = str_replace('http:','https:',$a);
+            }
+            elseif(substr($a,5)==='https'){
+                $b = str_replace('https:','http:',$a);
+            }
+            else{
+                $a = 'http://'.$param['wd'];
+                $b  = 'https://'.$param['wd'];
+            }
+            $where['visit_ly'] = ['like', [$a.'%',$b.'%'],'OR'];
+        }
+
+        $order='visit_id desc';
+        $res = model('Visit')->listData($where,$order,$param['page'],$param['limit']);
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+
+        $this->assign('title','访问记录管理');
+        return $this->fetch('admin@visit/index');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $all = $param['all'];
+        if(!empty($ids)){
+            $where=[];
+            $where['visit_id'] = ['in',$ids];
+            if($all==1){
+                $where['visit_id'] = ['gt',0];
+            }
+            $res = model('Visit')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+}

+ 521 - 0
application/admin/controller/Vod.php

@@ -0,0 +1,521 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class Vod extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function data()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) <1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) <1 ? $this->_pagesize : $param['limit'];
+
+        $where = [];
+        if(!empty($param['type'])){
+            $where['type_id'] = ['eq',$param['type']];
+        }
+        if(!empty($param['level'])){
+            $where['vod_level'] = ['eq',$param['level']];
+        }
+        if(in_array($param['status'],['0','1'])){
+            $where['vod_status'] = ['eq',$param['status']];
+        }
+        if(in_array($param['copyright'],['0','1'])){
+            $where['vod_copyright'] = ['eq',$param['copyright']];
+        }
+        if(in_array($param['isend'],['0','1'])){
+            $where['vod_isend'] = ['eq',$param['isend']];
+        }
+        if(!empty($param['lock'])){
+            $where['vod_lock'] = ['eq',$param['lock']];
+        }
+        if(!empty($param['state'])){
+            $where['vod_state'] = ['eq',$param['state']];
+        }
+        if(!empty($param['area'])){
+            $where['vod_area'] = ['eq',$param['area']];
+        }
+        if(!empty($param['lang'])){
+            $where['vod_lang'] = ['eq',$param['lang']];
+        }
+        if(in_array($param['plot'],['0','1'])){
+            $where['vod_plot'] = ['eq',$param['plot']];
+        }
+
+        if(!empty($param['url'])){
+            if($param['url']==1){
+                $where['vod_play_url'] = '';
+            }
+        }
+        if(!empty($param['points'])){
+            $where['vod_points_play|vod_points_down'] = ['gt', 0];
+        }
+        if(!empty($param['pic'])){
+            if($param['pic'] == '1'){
+                $where['vod_pic'] = ['eq',''];
+            }
+            elseif($param['pic'] == '2'){
+                $where['vod_pic'] = ['like','http%'];
+            }
+            elseif($param['pic'] == '3'){
+                $where['vod_pic'] = ['like','%#err%'];
+            }
+        }
+        if(!empty($param['weekday'])){
+            $where['vod_weekday'] = ['like','%'.$param['weekday'].'%'];
+        }
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['vod_name|vod_actor'] = ['like','%'.$param['wd'].'%'];
+        }
+        if(!empty($param['player'])){
+            if($param['player']=='no'){
+                $where['vod_play_from'] = ['eq',''];
+            }
+            else {
+                $where['vod_play_from'] = ['like', '%' . $param['player'] . '%'];
+            }
+        }
+        if(!empty($param['downer'])){
+            if($param['downer']=='no'){
+                $where['vod_down_from'] = ['eq',''];
+            }
+            else {
+                $where['vod_down_from'] = ['like', '%' . $param['downer'] . '%'];
+            }
+        }
+        if(!empty($param['server'])){
+            $where['vod_play_server|vod_down_server'] = ['like','%'.$param['server'].'%'];
+        }
+        $order='vod_time desc';
+        if(in_array($param['order'],['vod_id','vod_hits','vod_hits_month','vod_hits_week','vod_hits_day'])){
+            $order = $param['order'] .' desc';
+        }
+
+        if(!empty($param['repeat'])){
+            if($param['page'] ==1){
+                Db::execute('DROP TABLE IF EXISTS '.config('database.prefix').'tmpvod');
+                Db::execute('CREATE TABLE IF NOT EXISTS `'.config('database.prefix').'tmpvod` as (SELECT min(vod_id) as id1,vod_name as name1 FROM '.config('database.prefix').'vod GROUP BY name1 HAVING COUNT(name1)>1)');
+            }
+            $order='vod_name asc';
+            $res = model('Vod')->listRepeatData($where,$order,$param['page'],$param['limit']);
+        }
+        else{
+            $res = model('Vod')->listData($where,$order,$param['page'],$param['limit']);
+        }
+
+
+        foreach($res['list'] as $k=>&$v){
+            $v['ismake'] = 1;
+            if($GLOBALS['config']['view']['vod_detail'] >0 && $v['vod_time_make'] < $v['vod_time']){
+                $v['ismake'] = 0;
+            }
+        }
+
+        $this->assign('list',$res['list']);
+        $this->assign('total',$res['total']);
+        $this->assign('page',$res['page']);
+        $this->assign('limit',$res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param',$param);
+
+        //分类
+        $type_tree = model('Type')->getCache('type_tree');
+        $this->assign('type_tree',$type_tree);
+
+        //播放器
+        $player_list = config('vodplayer');
+        $downer_list = config('voddowner');
+        $server_list = config('vodserver');
+
+        $player_list = mac_multisort($player_list,'sort',SORT_DESC,'status','1');
+        $downer_list = mac_multisort($downer_list,'sort',SORT_DESC,'status','1');
+        $server_list = mac_multisort($server_list,'sort',SORT_DESC,'status','1');
+
+
+        $this->assign('player_list',$player_list);
+        $this->assign('downer_list',$downer_list);
+        $this->assign('server_list',$server_list);
+
+
+        $this->assign('title','视频管理');
+        return $this->fetch('admin@vod/index');
+    }
+
+    public function batch()
+    {
+        $param = input();
+        if (!empty($param)) {
+
+            mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+
+            if(empty($param['ck_del']) && empty($param['ck_level']) && empty($param['ck_status']) && empty($param['ck_lock']) && empty($param['ck_hits'])
+                && empty($param['ck_points'])
+            ){
+                return $this->error('没有选择任何参数');
+            }
+
+
+            if($param['ck_del']==2 && empty($param['player'])){
+                return $this->error('删除播放组时,必须选择播放器参数');
+            }
+            if($param['ck_del']==3 && empty($param['downer'])){
+                return $this->error('删除下载组时,必须选择下载器参数');
+            }
+
+            $where = [];
+            if(!empty($param['type'])){
+                $where['type_id'] = ['eq',$param['type']];
+            }
+            if(!empty($param['level'])){
+                $where['vod_level'] = ['eq',$param['level']];
+            }
+            if(in_array($param['status'],['0','1'])){
+                $where['vod_status'] = ['eq',$param['status']];
+            }
+            if(in_array($param['copyright'],['0','1'])){
+                $where['vod_copyright'] = ['eq',$param['copyright']];
+            }
+            if(in_array($param['isend'],['0','1'])){
+                $where['vod_isend'] = ['eq',$param['isend']];
+            }
+
+            if(!empty($param['lock'])){
+                $where['vod_lock'] = ['eq',$param['lock']];
+            }
+            if(!empty($param['state'])){
+                $where['vod_state'] = ['eq',$param['state']];
+            }
+
+            if(!empty($param['area'])){
+                $where['vod_area'] = ['eq',$param['area']];
+            }
+            if(!empty($param['lang'])){
+                $where['vod_lang'] = ['eq',$param['lang']];
+            }
+
+            if(!empty($param['url'])){
+                if($param['url']==1){
+                    $where['vod_play_url'] = '';
+                }
+            }
+            if(!empty($param['pic'])){
+                if($param['pic'] == '1'){
+                    $where['vod_pic'] = ['eq',''];
+                }
+                elseif($param['pic'] == '2'){
+                    $where['vod_pic'] = ['like','http%'];
+                }
+                elseif($param['pic'] == '3'){
+                    $where['vod_pic'] = ['like','%#err%'];
+                }
+            }
+            if(!empty($param['wd'])){
+                $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+                $where['vod_name'] = ['like','%'.$param['wd'].'%'];
+            }
+
+            if(!empty($param['weekday'])){
+                $where['vod_weekday'] = ['like','%'.$param['weekday'].'%'];
+            }
+            
+            if(!empty($param['player'])){
+                if($param['player']=='no'){
+                    $where['vod_play_from'] = ['eq',''];
+                }
+                else {
+                    $where['vod_play_from'] = ['like', '%' . $param['player'] . '%'];
+                }
+            }
+            if(!empty($param['downer'])){
+                if($param['player']=='no'){
+                    $where['vod_down_from'] = ['eq',''];
+                }
+                else {
+                    $where['vod_down_from'] = ['like', '%' . $param['downer'] . '%'];
+                }
+            }
+
+            if($param['ck_del'] == 1){
+                $res = model('Vod')->delData($where);
+                mac_echo('批量删除完毕');
+                mac_jump( url('vod/batch') ,3);
+                exit;
+            }
+
+
+            if(empty($param['page'])){
+                $param['page'] = 1;
+            }
+            if(empty($param['limit'])){
+                $param['limit'] = 100;
+            }
+            if(empty($param['total'])) {
+                $param['total'] = model('Vod')->countData($where);
+                $param['page_count'] = ceil($param['total'] / $param['limit']);
+            }
+
+            if($param['page'] > $param['page_count']) {
+                mac_echo('批量操作完毕');
+                mac_jump( url('vod/batch') ,3);
+                exit;
+            }
+            mac_echo( "<font color=red>共".$param['total']."条数据需要处理,每页".$param['limit']."条,共".$param['page_count']."页,正在处理第".$param['page']."页数据</font>");
+
+            $order='vod_id desc';
+            $res = model('Vod')->listData($where,$order,$param['page'],$param['limit']);
+
+            foreach($res['list'] as  $k=>$v){
+                $where2 = [];
+                $where2['vod_id'] = $v['vod_id'];
+
+                $update = [];
+                $des = $v['vod_id'].','.$v['vod_name'];
+
+                if(!empty($param['ck_level']) && !empty($param['val_level'])){
+                    $update['vod_level'] = $param['val_level'];
+                    $des .= '&nbsp;推荐值:'.$param['val_level'].';';
+                }
+                if(!empty($param['ck_status']) && isset($param['val_status'])){
+                    $update['vod_status'] = $param['val_status'];
+                    $des .= '&nbsp;状态:'.($param['val_status'] ==1 ? '[已审核]':'[未审核]') .';';
+                }
+                if(!empty($param['ck_lock']) && isset($param['val_lock'])){
+                    $update['vod_lock'] = $param['val_lock'];
+                    $des .= '&nbsp;推荐值:'.($param['val_lock']==1 ? '[锁定]':'[解锁]').';';
+                }
+                if(!empty($param['ck_hits']) && $param['val_hits_min']!='' && $param['val_hits_max']!='' ){
+                    $update['vod_hits'] = rand($param['val_hits_min'],$param['val_hits_max']);
+                    $des .= '&nbsp;人气:'.$update['vod_hits'].';';
+                }
+                if(!empty($param['ck_points']) && $param['val_points_play']!=''  ){
+                    $update['vod_points_play'] = $param['val_points_play'];
+                    $des .= '&nbsp;播放积分:'.$param['val_points_play'].';';
+                }
+                if(!empty($param['ck_points']) && $param['val_points_down']!='' ){
+                    $update['vod_points_down'] = $param['val_points_down'];
+                    $des .= '&nbsp;下载积分:'.$param['val_points_down'].';';
+                }
+
+                if($param['ck_del'] == 2 || $param['ck_del'] ==3){
+                    if($param['ck_del']==2) {
+                        $pre = 'vod_play';
+                        $par = 'player';
+                        $des .= '&nbsp;播放组:';
+                    }
+                    elseif($param['ck_del']==3){
+                        $pre = 'vod_down';
+                        $par='downer';
+                        $des .= '&nbsp;下载组:';
+                    }
+
+
+                    if($param[$par] == $v[$pre.'_from']){
+                        $update[$pre.'_from'] = '';
+                        $update[$pre.'_server'] = '';
+                        $update[$pre.'_note'] = '';
+                        $update[$pre.'_url'] = '';
+                        $des .= '删除为空;';
+                    }
+                    else{
+                        $vod_from_arr = explode('$$$',$v[$pre.'_from']);
+                        $vod_server_arr = explode('$$$',$v[$pre.'_server']);
+                        $vod_note_arr = explode('$$$',$v[$pre.'_note']);
+                        $vod_url_arr = explode('$$$',$v[$pre.'_url']);
+
+                        $key = array_search($param[$par],$vod_from_arr);
+                        if($key!==false){
+                            unset($vod_from_arr[$key]);
+                            unset($vod_server_arr[$key]);
+                            unset($vod_note_arr[$key]);
+                            unset($vod_url_arr[$key]);
+
+                            $update[$pre.'_from'] = join('$$$',$vod_from_arr);
+                            $update[$pre.'_server'] = join('$$$',$vod_server_arr);
+                            $update[$pre.'_note'] = join('$$$',$vod_note_arr);
+                            $update[$pre.'_url'] = join('$$$',$vod_url_arr);
+                            $des .= '删除;';
+                        }
+                        else{
+                            $des .= '跳过;';
+                        }
+                    }
+                }
+
+                mac_echo($des);
+                $res2 = model('Vod')->where($where2)->update($update);
+
+            }
+            $param['page']++;
+            $url = url('vod/batch') .'?'. http_build_query($param);
+            mac_jump( $url ,3);
+            exit;
+        }
+
+        //分类
+        $type_tree = model('Type')->getCache('type_tree');
+        $this->assign('type_tree',$type_tree);
+
+        //播放器
+        $player_list = config('vodplayer');
+        $downer_list = config('voddowner');
+        $server_list = config('vodserver');
+
+        $player_list = mac_multisort($player_list,'sort',SORT_DESC,'status','1');
+        $downer_list = mac_multisort($downer_list,'sort',SORT_DESC,'status','1');
+        $server_list = mac_multisort($server_list,'sort',SORT_DESC,'status','1');
+
+
+        $this->assign('player_list',$player_list);
+        $this->assign('downer_list',$downer_list);
+        $this->assign('server_list',$server_list);
+
+
+        $this->assign('title','视频批量操作');
+        return $this->fetch('admin@vod/batch');
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input('post.');
+            $res = model('Vod')->saveData($param);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+        $where=[];
+        $where['vod_id'] = $id;
+        $res = model('Vod')->infoData($where);
+
+
+        $info = $res['info'];
+        $this->assign('info',$info);
+
+        //分类
+        $type_tree = model('Type')->getCache('type_tree');
+        $this->assign('type_tree',$type_tree);
+
+        //地区、语言
+        $config = config('maccms.app');
+        $area_list = explode(',',$config['vod_area']);
+        $lang_list = explode(',',$config['vod_lang']);
+        $this->assign('area_list',$area_list);
+        $this->assign('lang_list',$lang_list);
+
+        //用户组
+        $group_list = model('Group')->getCache('group_list');
+        $this->assign('group_list',$group_list);
+
+        //播放器
+        $player_list = config('vodplayer');
+        $downer_list = config('voddowner');
+        $server_list = config('vodserver');
+
+        $player_list = mac_multisort($player_list,'sort',SORT_DESC,'status','1');
+        $downer_list = mac_multisort($downer_list,'sort',SORT_DESC,'status','1');
+        $server_list = mac_multisort($server_list,'sort',SORT_DESC,'status','1');
+
+        $this->assign('player_list',$player_list);
+        $this->assign('downer_list',$downer_list);
+        $this->assign('server_list',$server_list);
+
+        //播放组、下载租
+        $this->assign('vod_play_list',$info['vod_play_list']);
+        $this->assign('vod_down_list',$info['vod_down_list']);
+        $this->assign('vod_plot_list',$info['vod_plot_list']);
+
+
+        $this->assign('title','视频信息');
+        return $this->fetch('admin@vod/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['vod_id'] = ['in',$ids];
+            $res = model('Vod')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        elseif(!empty($param['repeat'])){
+            $st = ' not in ';
+            if($param['retain']=='max'){
+                $st=' in ';
+            }
+            $sql = 'delete from '.config('database.prefix').'vod where vod_name in(select name1 from '.config('database.prefix').'tmpvod) and vod_id '.$st.'(select id1 from '.config('database.prefix').'tmpvod)';
+            $res = model('Vod')->execute($sql);
+            if($res===false){
+                return $this->success('删除失败');
+            }
+            return $this->success('删除成功');
+        }
+        return $this->error('参数错误');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+        $start = $param['start'];
+        $end = $param['end'];
+
+
+        if(!empty($ids) && in_array($col,['vod_status','vod_lock','vod_level','vod_hits','type_id'])){
+            $where=[];
+            $where['vod_id'] = ['in',$ids];
+            $update = [];
+            if(empty($start)) {
+                $update[$col] = $val;
+                if($col == 'type_id'){
+                    $type_list = model('Type')->getCache();
+                    $id1 = intval($type_list[$val]['type_pid']);
+                    $update['type_id_1'] = $id1;
+                }
+                $res = model('Vod')->fieldData($where, $update);
+            }
+            else{
+                if(empty($end)){$end = 9999;}
+                $ids = explode(',',$ids);
+                foreach($ids as $k=>$v){
+                    $val = rand($start,$end);
+                    $where['vod_id'] = ['eq',$v];
+                    $update[$col] = $val;
+                    $res = model('Vod')->fieldData($where, $update);
+                }
+            }
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function updateToday()
+    {
+        $param = input();
+        $flag = $param['flag'];
+        $res = model('Vod')->updateToday($flag);
+        return json($res);
+    }
+
+}

+ 86 - 0
application/admin/controller/Voddowner.php

@@ -0,0 +1,86 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class VodDowner extends Base
+{
+    var $_pre;
+    public function __construct()
+    {
+        parent::__construct();
+        $this->_pre = 'voddowner';
+    }
+
+    public function index()
+    {
+        $list = config($this->_pre);
+        $this->assign('list',$list);
+        $this->assign('title','下载器管理');
+        return $this->fetch('admin@voddowner/index');
+    }
+
+    public function info()
+    {
+        $param = input();
+        $list = config($this->_pre);
+        if (Request()->isPost()) {
+            unset($param['flag']);
+            if(is_numeric($param['from'])){
+                $param['from'] .='_';
+            }
+            $list[$param['from']] = $param;
+            $sort=[];
+            foreach ($list as $k=>&$v){
+                $sort[] = $v['sort'];
+            }
+            array_multisort($sort, SORT_DESC, SORT_FLAG_CASE , $list);
+            $res = mac_arr2file( APP_PATH .'extra/'.$this->_pre.'.php', $list);
+            if($res===false){
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $info = $list[$param['id']];
+        $this->assign('info',$info);
+        $this->assign('title','信息管理');
+        return $this->fetch('admin@voddowner/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $list = config($this->_pre);
+        unset($list[$param['ids']]);
+        $res = mac_arr2file(APP_PATH. 'extra/'.$this->_pre.'.php', $list);
+        if($res===false){
+            return $this->error('删除失败,请重试!');
+        }
+        return $this->success('删除成功!');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+
+        if(!empty($ids) && in_array($col,['ps','status'])){
+            $list = config($this->_pre);
+            $ids = explode(',',$ids);
+            foreach($list as $k=>&$v){
+                if(in_array($k,$ids)){
+                    $v[$col] = $val;
+                }
+            }
+            $res = mac_arr2file(APP_PATH. 'extra/'.$this->_pre.'.php', $list);
+            if($res===false){
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+        return $this->error('参数错误');
+    }
+
+}

+ 155 - 0
application/admin/controller/Vodplayer.php

@@ -0,0 +1,155 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class VodPlayer extends Base
+{
+    var $_pre;
+    public function __construct()
+    {
+        parent::__construct();
+        $this->_pre = 'vodplayer';
+    }
+
+    public function index()
+    {
+        $list = config($this->_pre);
+        $this->assign('list',$list);
+        $this->assign('title','播放器管理');
+        return $this->fetch('admin@vodplayer/index');
+    }
+
+    public function info()
+    {
+        $param = input();
+        $list = config($this->_pre);
+        if (Request()->isPost()) {
+            unset($param['flag']);
+            $code = $param['code'];
+            unset($param['code']);
+
+            if(is_numeric($param['from'])){
+                $param['from'] .='_';
+            }
+            $list[$param['from']] = $param;
+            $sort=[];
+            foreach ($list as $k=>&$v){
+                $sort[] = $v['sort'];
+            }
+            array_multisort($sort, SORT_DESC, SORT_FLAG_CASE , $list);
+
+            $res = mac_arr2file( APP_PATH .'extra/'.$this->_pre.'.php', $list);
+            if($res===false){
+                return $this->error('保存配置文件失败,请重试!');
+            }
+
+            $res = fwrite(fopen('./static/player/' . $param['from'].'.js','wb'),$code);
+            if($res===false){
+                return $this->error('保存代码文件失败,请重试!');
+            }
+
+            return $this->success('保存成功!');
+        }
+
+        $info = $list[$param['id']];
+        if(!empty($info)){
+            $code = file_get_contents('./static/player/' . $param['id'].'.js');
+            $info['code'] = $code;
+        }
+        $this->assign('info',$info);
+        $this->assign('title','信息管理');
+        return $this->fetch('admin@vodplayer/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $list = config($this->_pre);
+        unset($list[$param['ids']]);
+        $res = mac_arr2file(APP_PATH. 'extra/'.$this->_pre.'.php', $list);
+        if($res===false){
+            return $this->error('删除失败,请重试!');
+        }
+
+        return $this->success('删除成功!');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+
+        if(!empty($ids) && in_array($col,['ps','status'])){
+            $list = config($this->_pre);
+            $ids = explode(',',$ids);
+            foreach($list as $k=>&$v){
+                if(in_array($k,$ids)){
+                    $v[$col] = $val;
+                }
+            }
+            $res = mac_arr2file(APP_PATH. 'extra/'.$this->_pre.'.php', $list);
+            if($res===false){
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+        return $this->error('参数错误');
+    }
+
+    public function export()
+    {
+        $param = input();
+        $list = config($this->_pre);
+        $info = $list[$param['id']];
+        if(!empty($info)){
+            $code = file_get_contents('./static/player/' . $param['id'].'.js');
+            $info['code'] = $code;
+        }
+
+        header("Content-type: application/octet-stream");
+        if(strpos($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
+            header("Content-Disposition: attachment; filename=mac_" . urlencode($info['from']) . '.txt');
+        }
+        else{
+            header("Content-Disposition: attachment; filename=mac_" . $info['from'] . '.txt');
+        }
+        echo base64_encode(json_encode($info));
+    }
+
+    public function import()
+    {
+        $file = $this->request->file('file');
+        $info = $file->rule('uniqid')->validate(['size' => 10240000, 'ext' => 'txt']);
+        if ($info) {
+            $data = json_decode(base64_decode(file_get_contents($info->getpathName())), true);
+            @unlink($info->getpathName());
+            if($data){
+
+                if(empty($data['status']) || empty($data['from']) || empty($data['sort']) ){
+                    return $this->error('格式错误');
+                }
+                $code = $data['code'];
+                unset($data['code']);
+
+                $list = config($this->_pre);
+                $list[$data['from']] = $data;
+                $res = mac_arr2file( APP_PATH .'extra/'.$this->_pre.'.php', $list);
+                if($res===false){
+                    return $this->error('保存配置文件失败,请重试!');
+                }
+
+                $res = fwrite(fopen('./static/player/' . $data['from'].'.js','wb'),$code);
+                if($res===false){
+                    return $this->error('保存代码文件失败,请重试!');
+                }
+
+            }
+            return $this->success('导入失败,请检查文件格式');
+        }
+        else{
+            return $this->error($file->getError());
+        }
+    }
+}

+ 86 - 0
application/admin/controller/Vodserver.php

@@ -0,0 +1,86 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+
+class VodServer extends Base
+{
+    var $_pre;
+    public function __construct()
+    {
+        parent::__construct();
+        $this->_pre = 'vodserver';
+
+    }
+
+    public function index()
+    {
+        $list = config($this->_pre);
+        $this->assign('list',$list);
+        $this->assign('title','服务器组管理');
+        return $this->fetch('admin@vodserver/index');
+    }
+
+    public function info()
+    {
+        $param = input();
+        $list = config($this->_pre);
+        if (Request()->isPost()) {
+            unset($param['flag']);
+            if(is_numeric($param['from'])){
+                $param['from'] .='_';
+            }
+
+            $list[$param['from']] = $param;
+            $sort=[];
+            foreach ($list as $k=>&$v){
+                $sort[] = $v['sort'];
+            }
+            array_multisort($sort, SORT_DESC, SORT_FLAG_CASE , $list);
+            $res = mac_arr2file( APP_PATH .'extra/'.$this->_pre.'.php', $list);
+            if($res===false){
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+
+        $info = $list[$param['id']];
+        $this->assign('info',$info);
+        $this->assign('title','信息管理');
+        return $this->fetch('admin@vodserver/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $list = config($this->_pre);
+        unset($list[$param['ids']]);
+        $res = mac_arr2file(APP_PATH. 'extra/'.$this->_pre.'.php', $list);
+        if($res===false){
+            return $this->error('删除失败,请重试!');
+        }
+        return $this->success('删除成功!');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+
+        if(!empty($ids) && in_array($col,['parse_status','status'])){
+            $list = config($this->_pre);
+
+            foreach($list as $k=>&$v){
+                $v[$col] = $val;
+            }
+            $res = mac_arr2file(APP_PATH. 'extra/'.$this->_pre.'.php', $list);
+            if($res===false){
+                return $this->error('保存失败,请重试!');
+            }
+            return $this->success('保存成功!');
+        }
+        return $this->error('参数错误');
+    }
+
+}

+ 298 - 0
application/admin/controller/Website.php

@@ -0,0 +1,298 @@
+<?php
+namespace app\admin\controller;
+use think\Db;
+use app\common\util\Pinyin;
+
+class Website extends Base
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function data()
+    {
+        $param = input();
+        $param['page'] = intval($param['page']) < 1 ? 1 : $param['page'];
+        $param['limit'] = intval($param['limit']) < 1 ? $this->_pagesize : $param['limit'];
+
+        $where = [];
+        if (!empty($param['type'])) {
+            $where['type_id'] = ['eq', $param['type']];
+        }
+        if (!empty($param['level'])) {
+            $where['website_level'] = ['eq', $param['level']];
+        }
+        if (in_array($param['status'], ['0', '1'])) {
+            $where['website_status'] = ['eq', $param['status']];
+        }
+        if (!empty($param['lock'])) {
+            $where['website_lock'] = ['eq', $param['lock']];
+        }
+        if(!empty($param['pic'])){
+            if($param['pic'] == '1'){
+                $where['website_pic'] = ['eq',''];
+            }
+            elseif($param['pic'] == '2'){
+                $where['website_pic'] = ['like','http%'];
+            }
+            elseif($param['pic'] == '3'){
+                $where['website_pic'] = ['like','%#err%'];
+            }
+        }
+        if(!empty($param['wd'])){
+            $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+            $where['website_name'] = ['like','%'.$param['wd'].'%'];
+        }
+
+        if(!empty($param['repeat'])){
+            if($param['page'] ==1){
+                Db::execute('DROP TABLE IF EXISTS '.config('database.prefix').'tmpwebsite');
+                Db::execute('CREATE TABLE IF NOT EXISTS `'.config('database.prefix').'tmpwebsite` as (SELECT min(website_id)as id1,website_name as name1 FROM '.config('database.prefix').'website GROUP BY name1 HAVING COUNT(name1)>1)');
+            }
+            $order='website_name asc';
+            $res = model('Website')->listRepeatData($where,$order,$param['page'],$param['limit']);
+        }
+        else{
+            $order='website_time desc';
+            $res = model('Website')->listData($where,$order,$param['page'],$param['limit']);
+        }
+
+        foreach($res['list'] as $k=>&$v){
+            $v['ismake'] = 1;
+            if($GLOBALS['config']['view']['website_detail'] >0 && $v['website_time_make'] < $v['website_time']){
+                $v['ismake'] = 0;
+            }
+        }
+
+        $this->assign('list', $res['list']);
+        $this->assign('total', $res['total']);
+        $this->assign('page', $res['page']);
+        $this->assign('limit', $res['limit']);
+
+        $param['page'] = '{page}';
+        $param['limit'] = '{limit}';
+        $this->assign('param', $param);
+
+        $type_tree = model('Type')->getCache('type_tree');
+        $this->assign('type_tree', $type_tree);
+
+        $this->assign('title', '网址管理');
+        return $this->fetch('admin@website/index');
+    }
+
+    public function batch()
+    {
+        $param = input();
+        if (!empty($param)) {
+
+            mac_echo('<style type="text/css">body{font-size:12px;color: #333333;line-height:21px;}span{font-weight:bold;color:#FF0000}</style>');
+
+            if(empty($param['ck_del']) && empty($param['ck_level']) && empty($param['ck_status']) && empty($param['ck_lock']) && empty($param['ck_hits']) ){
+                return $this->error('没有选择任何参数');
+            }
+            $where = [];
+            if(!empty($param['type'])){
+                $where['type_id'] = ['eq',$param['type']];
+            }
+            if(!empty($param['level'])){
+                $where['website_level'] = ['eq',$param['level']];
+            }
+            if(in_array($param['status'],['0','1'])){
+                $where['website_status'] = ['eq',$param['status']];
+            }
+            if(!empty($param['lock'])){
+                $where['website_lock'] = ['eq',$param['lock']];
+            }
+            if(!empty($param['pic'])){
+                if($param['pic'] == '1'){
+                    $where['website_pic'] = ['eq',''];
+                }
+                elseif($param['pic'] == '2'){
+                    $where['website_pic'] = ['like','http%'];
+                }
+                elseif($param['pic'] == '3'){
+                    $where['website_pic'] = ['like','%#err%'];
+                }
+            }
+            if(!empty($param['wd'])){
+                $param['wd'] = htmlspecialchars(urldecode($param['wd']));
+                $where['website_name'] = ['like','%'.$param['wd'].'%'];
+            }
+
+
+            if($param['ck_del'] == 1){
+                $res = model('Website')->delData($where);
+                mac_echo('批量删除完毕');
+                mac_jump( url('website/batch') ,3);
+                exit;
+            }
+
+            if(empty($param['page'])){
+                $param['page'] = 1;
+            }
+            if(empty($param['limit'])){
+                $param['limit'] = 100;
+            }
+            if(empty($total)) {
+                $total = model('Website')->countData($where);
+                $page_count = ceil($total / $param['limit']);
+            }
+
+            if($param['page'] > $page_count) {
+                mac_echo('批量设置完毕');
+                mac_jump( url('website/batch') ,3);
+                exit;
+            }
+            mac_echo( "<font color=red>共".$total."条数据需要处理,每页".$param['limit']."条,共".$page_count."页,正在处理第".$param['page']."页数据</font>");
+
+            $order='website_id desc';
+            $res = model('Website')->listData($where,$order,$param['page'],$param['limit']);
+
+            foreach($res['list'] as  $k=>$v){
+                $where2 = [];
+                $where2['website_id'] = $v['website_id'];
+
+                $update = [];
+                $des = $v['website_id'].','.$v['website_name'];
+
+                if(!empty($param['ck_level']) && !empty($param['val_level'])){
+                    $update['website_level'] = $param['val_level'];
+                    $des .= '&nbsp;推荐值:'.$param['val_level'].';';
+                }
+                if(!empty($param['ck_status']) && isset($param['val_status'])){
+                    $update['website_status'] = $param['val_status'];
+                    $des .= '&nbsp;状态:'.($param['val_status'] ==1 ? '[已审核]':'[未审核]') .';';
+                }
+                if(!empty($param['ck_lock']) && isset($param['val_lock'])){
+                    $update['website_lock'] = $param['val_lock'];
+                    $des .= '&nbsp;推荐值:'.($param['val_lock']==1 ? '[锁定]':'[解锁]').';';
+                }
+                if(!empty($param['ck_hits']) && !empty($param['val_hits_min']) && !empty($param['val_hits_max']) ){
+                    $update['website_hits'] = rand($param['val_hits_min'],$param['val_hits_max']);
+                    $des .= '&nbsp;人气:'.$update['website_hits'].';';
+                }
+                mac_echo($des);
+                $res2 = model('Website')->where($where2)->update($update);
+
+            }
+            $param['page']++;
+            $url = url('website/batch') .'?'. http_build_query($param);
+            mac_jump( $url ,3);
+            exit;
+        }
+
+        $type_tree = model('Type')->getCache('type_tree');
+        $this->assign('type_tree',$type_tree);
+
+        $this->assign('title','网址批量操作');
+        return $this->fetch('admin@website/batch');
+    }
+
+    public function info()
+    {
+        if (Request()->isPost()) {
+            $param = input('post.');
+            $param['website_content'] = str_replace( $GLOBALS['config']['upload']['protocol'].':','mac:',$param['website_content']);
+            $res = model('Website')->saveData($param);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+
+        $id = input('id');
+        $where=[];
+        $where['website_id'] = ['eq',$id];
+        $res = model('Website')->infoData($where);
+
+        $info = $res['info'];
+        $this->assign('info',$info);
+        $this->assign('website_page_list',$info['website_page_list']);
+
+        $type_tree = model('Type')->getCache('type_tree');
+        $this->assign('type_tree',$type_tree);
+
+        $this->assign('title','网址信息');
+        return $this->fetch('admin@website/info');
+    }
+
+    public function del()
+    {
+        $param = input();
+        $ids = $param['ids'];
+
+        if(!empty($ids)){
+            $where=[];
+            $where['website_id'] = ['in',$ids];
+            $res = model('Website')->delData($where);
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        elseif(!empty($param['repeat'])){
+            $st = ' not in ';
+            if($param['retain']=='max'){
+                $st=' in ';
+            }
+            $sql = 'delete from '.config('database.prefix').'website where website_name in(select name1 from '.config('database.prefix').'tmpwebsite) and website_id '.$st.'(select id1 from '.config('database.prefix').'tmpwebsite)';
+            $res = model('Website')->execute($sql);
+            if($res===false){
+                return $this->success('删除失败');
+            }
+            return $this->success('删除成功');
+        }
+        return $this->error('参数错误');
+    }
+
+    public function field()
+    {
+        $param = input();
+        $ids = $param['ids'];
+        $col = $param['col'];
+        $val = $param['val'];
+        $start = $param['start'];
+        $end = $param['end'];
+
+
+        if(!empty($ids) && in_array($col,['website_status','website_lock','website_level','website_hits','type_id'])){
+            $where=[];
+            $where['website_id'] = ['in',$ids];
+            $update = [];
+            if(empty($start)) {
+                $update[$col] = $val;
+                if($col == 'type_id'){
+                    $type_list = model('Type')->getCache();
+                    $id1 = intval($type_list[$val]['type_pid']);
+                    $update['type_id_1'] = $id1;
+                }
+                $res = model('Website')->fieldData($where, $update);
+            }
+            else{
+                if(empty($end)){$end = 9999;}
+                $ids = explode(',',$ids);
+                foreach($ids as $k=>$v){
+                    $val = rand($start,$end);
+                    $where['website_id'] = ['eq',$v];
+                    $update[$col] = $val;
+                    $res = model('Website')->fieldData($where, $update);
+                }
+            }
+            if($res['code']>1){
+                return $this->error($res['msg']);
+            }
+            return $this->success($res['msg']);
+        }
+        return $this->error('参数错误');
+    }
+
+    public function updateToday()
+    {
+        $param = input();
+        $flag = $param['flag'];
+        $res = model('Website')->updateToday($flag);
+        return json($res);
+    }
+
+}

+ 154 - 0
application/admin/view/actor/index.html

@@ -0,0 +1,154 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box">
+        {if condition="$param.select neq 1"}
+        <div class="center mb10">
+            <form class="layui-form " method="post">
+                <input type="hidden" value="{$param.select}" name="select">
+                <input type="hidden" value="{$param.input}" name="input">
+                <div class="layui-input-inline w150">
+                    <select name="type">
+                        <option value="">选择分类</option>
+                        {volist name="type_tree" id="vo"}
+                        {if condition="$vo.type_mid eq 8"}
+                        <option value="{$vo.type_id}" {if condition="$param['type'] eq $vo.type_id"}selected {/if}>{$vo.type_name}</option>
+                        {volist name="vo.child" id="ch"}
+                        <option value="{$ch.type_id}" {if condition="$param['type'] eq $ch.type_id"}selected {/if}>&nbsp;&nbsp;&nbsp;&nbsp;├&nbsp;{$ch.type_name}</option>
+                        {/volist}
+                        {/if}
+                        {/volist}
+                    </select>
+                </div>
+                <div class="layui-input-inline w150">
+                    <select name="status">
+                        <option value="">选择状态</option>
+                        <option value="0" {if condition="$param['status'] eq '0'"}selected {/if}>未审核</option>
+                        <option value="1" {if condition="$param['status'] eq '1'"}selected {/if}>已审核</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline w150">
+                    <select name="level">
+                        <option value="">选择推荐</option>
+                        <option value="9" {if condition="$param['level'] eq '9'"}selected {/if}>推荐9-幻灯</option>
+                        <option value="1" {if condition="$param['level'] eq '1'"}selected {/if}>推荐1</option>
+                        <option value="2" {if condition="$param['level'] eq '2'"}selected {/if}>推荐2</option>
+                        <option value="3" {if condition="$param['level'] eq '3'"}selected {/if}>推荐3</option>
+                        <option value="4" {if condition="$param['level'] eq '4'"}selected {/if}>推荐4</option>
+                        <option value="5" {if condition="$param['level'] eq '5'"}selected {/if}>推荐5</option>
+                        <option value="6" {if condition="$param['level'] eq '6'"}selected {/if}>推荐6</option>
+                        <option value="7" {if condition="$param['level'] eq '7'"}selected {/if}>推荐7</option>
+                        <option value="8" {if condition="$param['level'] eq '8'"}selected {/if}>推荐8</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline w150">
+                    <select name="pic">
+                        <option value="">选择图片</option>
+                        <option value="1" {if condition="$param['pic'] eq '1'"}selected{/if}>无图片</option>
+                        <option value="2" {if condition="$param['pic'] eq '2'"}selected{/if}>远程图片</option>
+                        <option value="3" {if condition="$param['pic'] eq '3'"}selected{/if}>同步出错图</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline w150">
+                    <select name="order">
+                        <option value="">选择排序</option>
+                        <option value="actor_time" {if condition="$param['order'] eq 'actor_time'"}selected{/if}>更新时间</option>
+                        <option value="actor_id" {if condition="$param['order'] eq 'actor_id'"}selected{/if}>编号</option>
+                        <option value="actor_hits" {if condition="$param['order'] eq 'actor_hits'"}selected{/if}>总人气</option>
+                        <option value="actor_hits_month" {if condition="$param['order'] eq 'actor_hits_month'"}selected{/if}>月人气</option>
+                        <option value="actor_hits_week" {if condition="$param['order'] eq 'actor_hits_week'"}selected{/if}>周人气</option>
+                        <option value="actor_hits_day" {if condition="$param['order'] eq 'actor_hits_day'"}selected{/if}>日人气</option>
+                    </select>
+                </div>
+
+                <div class="layui-input-inline">
+                    <input type="text" autocomplete="off" placeholder="请输入搜索条件" class="layui-input" name="wd" value="{$param['wd']}">
+                </div>
+                <button class="layui-btn mgl-20 j-search" >查询</button>
+            </form>
+        </div>
+        {/if}
+
+        <div class="layui-btn-group">
+            <a data-href="{:url('info')}" data-full="1" class="layui-btn layui-btn-primary j-iframe"><i class="layui-icon">&#xe654;</i>添加</a>
+            <a data-href="{:url('del')}" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe640;</i>删除</a>
+            <a data-href="{:url('index/select')}?tab=actor&col=type_id&tpl=select_type&url=actor/field" data-width="270" data-height="100" data-checkbox="1" class="layui-btn layui-btn-primary j-select"><i class="layui-icon">&#xe620;</i>分类</a>
+            <a data-href="{:url('index/select')}?tab=actor&col=actor_level&tpl=select_level&url=actor/field" data-width="270" data-height="100" data-checkbox="1" class="layui-btn layui-btn-primary j-select"><i class="layui-icon">&#xe620;</i>推荐</a>
+            <a data-href="{:url('index/select')}?tab=actor&col=actor_hits&tpl=select_hits&url=actor/field" data-width="470" data-height="100" data-checkbox="1" class="layui-btn layui-btn-primary j-select"><i class="layui-icon">&#xe620;</i>点击</a>
+            <a data-href="{:url('index/select')}?tab=actor&col=actor_status&tpl=select_status&url=actor/field" data-width="470" data-height="100" data-checkbox="1" class="layui-btn layui-btn-primary j-select"><i class="layui-icon">&#xe620;</i>状态</a>
+            <a class="layui-btn layui-btn-primary j-iframe" data-href="{:url('images/opt?tab=actor')}" href="javascript:;" title="同步远程图片"><i class="layui-icon">&#xe620;</i>同步图片</a>
+        </div>
+
+    </div>
+
+
+    <form class="layui-form " method="post" id="pageListForm">
+        <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th width="50">编号</th>
+                <th >演员名称</th>
+                <th width="150">地区</th>
+                <th width="150">性别</th>
+                <th width="40">身高</th>
+                <th width="40">体重</th>
+                <th width="40">推荐</th>
+                <th width="120">更新时间</th>
+                <th width="80">操作</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" value="{$vo.actor_id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                <td>{$vo.actor_id}</td>
+                <td>[{$vo.type.type_name}] <a target="_blank" class="layui-badge-rim " href="{:mac_url_actor_detail($vo)}">{$vo.actor_name|htmlspecialchars}</a> {if condition="$vo.actor_status eq 0"} <span class="layui-badge">未审</span>{/if} {if condition="$vo.actor_lock eq 1"} <span class="layui-badge">锁定</span>{/if}</td>
+                <td>{$vo.actor_area|htmlspecialchars}</td>
+                <td>{$vo.actor_sex|htmlspecialchars}</td>
+                <td>{$vo.actor_height|htmlspecialchars}</td>
+                <td>{$vo.actor_weight|htmlspecialchars}</td>
+                <td><a data-href="{:url('index/select')}?tab=actor&col=actor_level&tpl=select_level&url=actor/field&ids={$vo.actor_id}" data-width="270" data-height="100" class=" j-select"><span class="layui-badge layui-bg-orange">{$vo.actor_level}</span></a></td>
+                <td>{$vo.actor_time|mac_day=color}</td>
+                <td>
+                    <a class="layui-badge-rim j-iframe" data-full="1" data-href="{:url('info?id='.$vo['actor_id'])}" href="javascript:;" title="编辑">编辑</a>
+                    <a class="layui-badge-rim j-tr-del" data-href="{:url('del?ids='.$vo['actor_id'])}" href="javascript:;" title="删除">删除</a>
+                </td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+        <div id="pages" class="center"></div>
+    </form>
+</div>
+
+
+
+
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    var curUrl="{:url('actor/data',$param)}";
+    layui.use(['laypage', 'layer','form'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer,
+                form = layui.form;
+
+        laypage.render({
+            elem: 'pages'
+            ,count: {$total}
+            ,limit: {$limit}
+            ,curr: {$page}
+            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
+            ,jump: function(obj,first){
+                if(!first){
+                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
+                }
+            }
+        });
+
+
+    });
+</script>
+</body>
+</html>

+ 386 - 0
application/admin/view/actor/info.html

@@ -0,0 +1,386 @@
+{include file="../../../application/admin/view/public/head" /}
+<script type="text/javascript" src="__STATIC__/js/jquery.jscolor.js"></script>
+{include file="../../../application/admin/view/public/editor" flag="actor_editor"/}
+<div class="page-container p10">
+    <div class="showpic" style="display:none;"><img class="showpic_img" width="120" height="160"></div>
+    
+    <form class="layui-form layui-form-pane" method="post" action="">
+        <input type="hidden" name="actor_id" value="{$info.actor_id}">
+
+        <div class="layui-tab">
+            <ul class="layui-tab-title ">
+                <li class="layui-this">基本信息</a></li>
+                <li>其他信息</li>
+            </ul>
+            <div class="layui-tab-content">
+
+                <div class="layui-tab-item layui-show">
+                    
+                <div class="layui-form-item">
+                    <label class="layui-form-label">参数:</label>
+                    <div class="layui-input-inline w150">
+                        <select name="type_id" lay-filter="type_id">
+                            <option value="">请选择分类</option>
+                            {volist name="type_tree" id="vo"}
+                            {if condition="$vo.type_mid eq 8"}
+                            <option value="{$vo.type_id}" {if condition="$info.type_id eq $vo.type_id"}selected{/if}>{$vo.type_name}</option>
+                            {volist name="$vo.child" id="ch"}
+                            <option value="{$ch.type_id}" {if condition="$info.type_id eq $ch.type_id"}selected{/if}>&nbsp;|&nbsp;&nbsp;&nbsp;|—{$ch.type_name}</option>
+                            {/volist}
+                            {/if}
+                            {/volist}
+                        </select>
+                    </div>
+                    <div class="layui-input-inline w150">
+                            <select name="actor_level">
+                                <option value="0">请选择推荐</option>
+                                <option value="9" {if condition="$info.actor_level eq 9"}selected{/if}>推荐9-幻灯</option>
+                                <option value="1" {if condition="$info.actor_level eq 1"}selected{/if}>推荐1</option>
+                                <option value="2" {if condition="$info.actor_level eq 2"}selected{/if}>推荐2</option>
+                                <option value="3" {if condition="$info.actor_level eq 3"}selected{/if}>推荐3</option>
+                                <option value="4" {if condition="$info.actor_level eq 4"}selected{/if}>推荐4</option>
+                                <option value="5" {if condition="$info.actor_level eq 5"}selected{/if}>推荐5</option>
+                                <option value="6" {if condition="$info.actor_level eq 6"}selected{/if}>推荐6</option>
+                                <option value="7" {if condition="$info.actor_level eq 7"}selected{/if}>推荐7</option>
+                                <option value="8" {if condition="$info.actor_level eq 8"}selected{/if}>推荐8</option>
+                            </select>
+                    </div>
+                    <div class="layui-input-inline w150">
+                            <select name="actor_status">
+                                <option value="1">已审核</option>
+                                <option value="0" {if condition="$info.actor_status eq '0'"}selected{/if}>未审核</option>
+                            </select>
+                    </div>
+                    <div class="layui-input-inline w150">
+                        <select name="actor_sex">
+                            <option value="男">男</option>
+                            <option value="女" {if condition="$info.actor_sex eq '女'"}selected{/if}>女</option>
+                        </select>
+                    </div>
+                    <div class="layui-input-inline w150">
+                        <select name="actor_lock">
+                            <option value="0">未锁</option>
+                            <option value="1" {if condition="$info.actor_lock eq 1"}selected{/if}>锁定</option>
+                        </select>
+                    </div>
+
+                    <div class="layui-input-inline">
+                        <input type="checkbox" name="uptime" title="更新时间" value="1" checked class="layui-checkbox checkbox-ids" lay-skin="primary">
+                    </div>
+                </div>
+
+                <div class="layui-form-item">
+                    <label class="layui-form-label">演员名:</label>
+                    <div class="layui-input-inline w200">
+                        <input type="text" class="layui-input" value="{$info.actor_name}" placeholder="请输入" name="actor_name">
+                    </div>
+                    <label class="layui-form-label">别名:</label>
+                    <div class="layui-input-inline w200">
+                        <input type="text" class="layui-input" value="{$info.actor_alias}" placeholder="请输入" name="actor_alias">
+                    </div>
+                </div>
+
+                <div class="layui-form-item">
+                    <label class="layui-form-label">拼音:</label>
+                    <div class="layui-input-inline w200">
+                        <input type="text" class="layui-input" value="{$info.actor_en}" placeholder="" name="actor_en">
+                    </div>
+                    <label class="layui-form-label">首字母:</label>
+                    <div class="layui-input-inline w200">
+                        <input type="text" class="layui-input" value="{$info.actor_letter}" placeholder="" name="actor_letter">
+                    </div>
+                    <label class="layui-form-label">高亮:</label>
+                    <div class="layui-input-inline w200">
+                        <input type="text" class="layui-input color" value="{$info.actor_color}" placeholder="" name="actor_color">
+                    </div>
+                </div>
+
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">血型:</label>
+                        <div class="layui-input-inline w200">
+                            <input type="text" class="layui-input" value="{$info.actor_blood}" placeholder="A,B,AB,O" name="actor_blood">
+                        </div>
+                        <label class="layui-form-label">地区:</label>
+                        <div class="layui-input-inline w200">
+                            <input type="text" class="layui-input" value="{$info.actor_area}" placeholder="" name="actor_area">
+                        </div>
+                        <label class="layui-form-label">出生地:</label>
+                        <div class="layui-input-inline w200">
+                            <input type="text" class="layui-input" value="{$info.actor_birtharea}" placeholder="" name="actor_birtharea">
+                        </div>
+                    </div>
+
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">身高:</label>
+                        <div class="layui-input-inline w200">
+                            <input type="text" class="layui-input" value="{$info.actor_height}" placeholder="单位cm" name="actor_height">
+                        </div>
+                        <label class="layui-form-label">体重:</label>
+                        <div class="layui-input-inline w200">
+                            <input type="text" class="layui-input" value="{$info.actor_weight}" placeholder="单位kg" name="actor_weight">
+                        </div>
+                        <label class="layui-form-label">生日:</label>
+                        <div class="layui-input-inline w200">
+                            <input type="text" class="layui-input" value="{$info.actor_birthday}" placeholder="例如:2000-01-01" name="actor_birthday">
+                        </div>
+                    </div>
+
+                    <div class="layui-form-item">
+
+                        <label class="layui-form-label">星座:</label>
+                        <div class="layui-input-inline w200">
+                            <input type="text" class="layui-input" value="{$info.actor_starsign}" placeholder="" name="actor_starsign">
+                        </div>
+                        <label class="layui-form-label">毕业学校:</label>
+                        <div class="layui-input-inline w200">
+                            <input type="text" class="layui-input" value="{$info.actor_school}" placeholder="" name="actor_school">
+                        </div>
+                        <label class="layui-form-label">备注:</label>
+                        <div class="layui-input-inline w200">
+                            <input type="text" class="layui-input" value="{$info.actor_remarks}" placeholder="" name="actor_remarks" id="actor_remarks">
+                        </div>
+                    </div>
+
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">代表作:</label>
+                        <div class="layui-input-inline w800">
+                            <input type="text" class="layui-input" value="{$info.actor_works}" placeholder="多个用,号连接" name="actor_works">
+                        </div>
+                    </div>
+
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">TAG:</label>
+                        <div class="layui-input-inline w500">
+                            <input type="text" class="layui-input" value="{$info.actor_tag}" placeholder="" name="actor_tag">
+                        </div>
+                        <div class="layui-input-inline w120">
+                            <input type="checkbox" name="uptag" title="自动生成" value="1" class="layui-checkbox checkbox-ids" lay-skin="primary">
+                        </div>
+                    </div>
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">扩展分类:</label>
+                        <div class="layui-input-inline w500">
+                            <input type="text" class="layui-input" value="{$info.actor_class}" placeholder="" id="actor_class" name="actor_class">
+                        </div>
+                        <div class="layui-input-inline w500 actor_class_label">
+
+                        </div>
+                    </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">图片:</label>
+                    <div class="layui-input-inline w400 upload">
+                        <input type="text" class="layui-input upload-input" style="max-width:100%;" value="{$info.actor_pic}" placeholder="" id="actor_pic" name="actor_pic">
+                    </div>
+                    <div class="layui-input-inline ">
+                        <button type="button" class="layui-btn layui-upload" lay-data="" id="upload1">上传图片</button>
+                    </div>
+                </div>
+
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">简介:</label>
+                        <div class="layui-input-block">
+                            <textarea name="actor_blurb" cols="" rows="3" class="layui-textarea"  placeholder="不填写将自动从第一页详情里获取前100个字" style="height:40px;">{$info.actor_blurb}</textarea>
+                        </div>
+                    </div>
+
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">介绍:</label>
+                        <div class="layui-input-block">
+                            <textarea id="actor_content" name="actor_content" type="text/plain" style="width:99%;height:300px">{$info.actor_content|mac_url_content_img}</textarea>
+                        </div>
+                    </div>
+                    
+        </div>
+
+                <div class="layui-tab-item">
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">顶数量:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.actor_up}" placeholder="" id="actor_up" name="actor_up">
+                            </div>
+                            <label class="layui-form-label">踩数量:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.actor_down}" placeholder="" id="actor_down" name="actor_down">
+                            </div>
+                            <button class="layui-btn" type="button" id="btn_rnd">随机生成</button>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">总人气:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.actor_hits}" placeholder="" id="actor_hits" name="actor_hits">
+                            </div>
+                            <label class="layui-form-label">月人气:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.actor_hits_month}" placeholder="" id="actor_hits_month" name="actor_hits_month" >
+                            </div>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">周人气:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.actor_hits_week}" placeholder="" id="actor_hits_week" name="actor_hits_week">
+                            </div>
+                            <label class="layui-form-label">日人气:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input " value="{$info.actor_hits_day}" placeholder="" id="actor_hits_day" name="actor_hits_day">
+                            </div>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">平均分:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.actor_score}" placeholder="" id="actor_score" name="actor_score">
+                            </div>
+                            <label class="layui-form-label">总评分:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.actor_score_all}" placeholder="" id="actor_score_all" name="actor_score_all">
+                            </div>
+                            <label class="layui-form-label">总评次:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.actor_score_num}" placeholder="" id="actor_score_num" name="actor_score_num">
+                            </div>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">独立模板:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.actor_tpl}" placeholder="" name="actor_tpl">
+                            </div>
+                            <label class="layui-form-label">跳转URL:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.actor_jumpurl}" placeholder="" name="actor_jumpurl">
+                            </div>
+                        </div>
+                    </div>
+            </div>
+        </div>
+
+                <div class="layui-form-item center">
+                    <div class="layui-input-block">
+                        <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit" data-child="">保 存</button>
+                        <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
+                    </div>
+                </div>
+    </form>
+
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+
+    layui.use(['form','upload', 'layer'], function () {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery
+                , upload = layui.upload;;
+
+        // 验证
+        form.verify({
+            actor_name: function (value) {
+                if (value == "") {
+                    return "请输入名称";
+                }
+            }
+        });
+
+        $(document).on("click", ".extend", function(){
+            $id = $(this).attr('data-id');
+            if($id == 'actor_class'||$id == 'actor_keywords'){
+                $val = $("input[id='"+$id+"']").val();
+                if($val!=''){
+                    $val = $val+',';
+                }
+                if($val.indexOf($(this).text())>-1){
+                    return;
+                }
+                $("input[id='"+$id+"']").val($val+$(this).text());
+            }else{
+                $("input[id='"+$id+"']").val($(this).text());
+            }
+        });
+
+        form.on('select(type_id)', function(data){
+            getExtend(data.value);
+        });
+
+        upload.render({
+            elem: '.layui-upload'
+            ,url: "{:url('upload/upload')}?flag=actor"
+            ,method: 'post'
+            ,before: function(input) {
+                layer.msg('文件上传中...', {time:3000000});
+            },done: function(res, index, upload) {
+                var obj = this.item;
+                if (res.code == 0) {
+                    layer.msg(res.msg);
+                    return false;
+                }
+                layer.closeAll();
+                var input = $(obj).parent().parent().find('.upload-input');
+                if ($(obj).attr('lay-type') == 'image') {
+                    input.siblings('img').attr('src', res.data.file).show();
+                }
+                input.val(res.data.file);
+
+                if(res.data.thumb_class !=''){
+                    $('.'+ res.data.thumb_class).val(res.data.thumb[0].file);
+                }
+            }
+        });
+
+        $('.upload-input').hover(function (e){
+            var e = window.event || e;
+            var imgsrc = $(this).val();
+            if(imgsrc.trim()==""){ return; }
+            var left = e.clientX+document.body.scrollLeft+20;
+            var top = e.clientY+document.body.scrollTop+20;
+            $(".showpic").css({left:left,top:top,display:""});
+            if(imgsrc.indexOf('://')<0){ imgsrc = ROOT_PATH + '/' + imgsrc;	} else{ imgsrc = imgsrc.replace('mac:','http:'); }
+            $(".showpic_img").attr("src", imgsrc);
+        },function (e){
+            $(".showpic").css("display","none");
+        });
+
+        $("#btn_rnd").click(function(){
+            $("#actor_hits").val( rndNum(5000,9999) );
+            $("#actor_hits_month").val( rndNum(1000,4999) );
+            $("#actor_hits_week").val( rndNum(300,999) );
+            $("#actor_hits_day").val( rndNum(1,299) );
+            $("#actor_up").val( rndNum(1,999) );
+            $("#actor_down").val( rndNum(1,999) );
+            $("#actor_score").val( rndNum(10) );
+            $("#actor_score_all").val( rndNum(1000) );
+            $("#actor_score_num").val( rndNum(100) );
+        });
+
+        var ue = editor_getEditor('actor_content');
+    });
+
+    function getExtend(id){
+        $.post("{:url('type/extend')}", {id:id}, function(res) {
+
+            if (res.code == 1) {
+                $.each(res.data, function(key, value){
+                    $('.actor_'+key+"_label").html('');
+                    if(value != ''){
+                        $.each(value, function(key2, value2){
+                            $(".actor_"+key+"_label").append('<a class="layui-btn layui-btn-xs extend" href="javascript:;" data-id="actor_'+key+'">'+value2+'</a>');
+                        });
+                    }
+                });
+            }
+        });
+    }
+
+    {if condition="$info.actor_id gt 0"}
+    setTimeout(function () {
+        getExtend('{$info.type_id}')
+    },1000);
+    {/if}
+
+</script>
+
+</body>
+</html>

+ 157 - 0
application/admin/view/addon/config.html

@@ -0,0 +1,157 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+    <div class="showpic" style="display:none;"><img class="showpic_img" width="120" height="160"></div>
+
+    <form class="layui-form layui-form-pane" method="post" action="">
+        <input id="admin_id" name="name" type="hidden" value="{$info.name}">
+
+        {foreach $config as $item}
+        <div class="layui-form-item">
+            <label class="layui-form-label">{$item.title}:</label>
+                {switch $item.type}
+                {case string}
+                <div class="layui-input-inline w600 ">
+                <input type="text" name="row[{$item.name}]" value="{$item.value}" class="layui-input" data-rule="{$item.rule}" data-tip="{$item.tip}" {$item.extend} />
+                </div>
+            {/case}
+                {case text}
+                <div class="layui-input-inline w600 ">
+                <textarea name="row[{$item.name}]" class="layui-input" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}" {$item.extend}>{$item.value}</textarea>
+                </div>
+                {/case}
+                {case array}
+                    {foreach name="item.value" item="vo" }
+
+            <div class="layui-input-inline w700 ">
+                {$key}:<input type="text" name="row[{$item.name}][{$key}]" value="{$vo}" class="layui-input w500"  />
+            </div>
+                {/foreach}
+
+                {/case}
+                {case datetime}
+            <div class="layui-input-inline w600 ">
+                <input type="text" name="row[{$item.name}]" value="{$item.value}" class="layui-input datetimepicker" data-tip="{$item.tip}" data-rule="{$item.rule}" {$item.extend} />
+                </div>
+                {/case}
+                {case number}
+            <div class="layui-input-inline w600 ">
+                <input type="number" name="row[{$item.name}]" value="{$item.value}" class="layui-input" data-tip="{$item.tip}" data-rule="{$item.rule}" {$item.extend} />
+                </div>
+                {/case}
+                {case checkbox}
+            <div class="layui-input-inline w600 ">
+                {foreach name="item.content" item="vo"}
+                <input id="row[{$item.name}][]-{$key}" name="row[{$item.name}][]" type="checkbox" value="{$key}" data-tip="{$item.tip}" title="{$vo}" {in name="key" value="$item.value"}checked{/in} />
+                {/foreach}
+                </div>
+                {/case}
+                {case radio}
+            <div class="layui-input-inline w700 ">
+                {foreach name="item.content" item="vo"}
+                <input id="row[{$item.name}]-{$key}" name="row[{$item.name}]" type="radio" value="{$key}" data-tip="{$item.tip}" title="{$vo}" {in name="key" value="$item.value"}checked{/in} />
+                {/foreach}
+                </div>
+                {/case}
+                {case value="select" break="0"}{/case}
+                {case value="selects"}
+            <div class="layui-input-inline w700 ">
+                <select name="row[{$item.name}]{$item.type=='selects'?'[]':''}" class="layui-input selectpicker" data-tip="{$item.tip}" {$item.type=='selects'?'multiple':''}>
+                    {foreach name="item.content" item="vo"}
+                    <option value="{$key}" {in name="key" value="$item.value"}selected{/in}>{$vo}</option>
+                    {/foreach}
+                </select>
+                </div>
+                {/case}
+                {case value="image" break="0"}{/case}
+                {case value="images"}
+            <div class="layui-input-inline w600 ">
+                <input id="c-{$item.name}" class="layui-input upload-input upload-img" size="37" name="row[{$item.name}]" type="text" value="{$item.value}" data-tip="{$item.tip}">
+                </div>
+            <div class="layui-input-inline w100">
+                <button type="button" class="layui-btn layui-upload" lay-data="{data:{thumb:0,thumb_class:''}}" >上传</button>
+                </div>
+
+                {/case}
+                {case value="file" break="0"}{/case}
+                {case value="files"}
+            <div class="layui-input-inline w600 ">
+                <input id="c-{$item.name}" class="layui-input upload-input" size="37" name="row[{$item.name}]" type="text" value="{$item.value}" data-tip="{$item.tip}">
+            </div>
+            <div class="layui-input-inline w100">
+                <button type="button" class="layui-btn layui-upload" lay-data="{data:{thumb:0,thumb_class:''}}" >上传</button>
+            </div>
+
+                {/case}
+                {case bool}
+                <div class="layui-input-inline">
+                <input id="row[{$item.name}]-yes" name="row[{$item.name}]" type="radio" value="1" {$item.value?'checked':''} data-tip="{$item.tip}" title="是"/>
+                <input id="row[{$item.name}]-no" name="row[{$item.name}]" type="radio" value="0" {$item.value?'':'checked'} data-tip="{$item.tip}" title="否"/>
+                </div>
+                {/case}
+                {/switch}
+            <div class="layui-form-mid layui-word-aux">{$item.tip}</div>
+            </div>
+
+
+        {/foreach}
+
+        <div class="layui-form-item center">
+            <div class="layui-input-block">
+                <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit" data-child="true">保 存</button>
+                <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
+            </div>
+        </div>
+    </form>
+
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    layui.use(['form','upload', 'layer'], function () {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery, upload = layui.upload;;
+
+        upload.render({
+            elem: '.layui-upload'
+            ,url: "{:url('upload/upload')}?flag=addon"
+            ,method: 'post'
+            ,before: function(input) {
+                layer.msg('文件上传中...', {time:3000000});
+            },done: function(res, index, upload) {
+                var obj = this.item;
+                if (res.code == 0) {
+                    layer.msg(res.msg);
+                    return false;
+                }
+                layer.closeAll();
+                var input = $(obj).parent().parent().find('.upload-input');
+                if ($(obj).attr('lay-type') == 'image') {
+                    input.siblings('img').attr('src', res.data.file).show();
+                }
+                input.val(res.data.file);
+
+            }
+        });
+
+
+        $('.upload-img').hover(function (e){
+            var e = window.event || e;
+            var imgsrc = $(this).val();
+            if(imgsrc.trim()==""){ return; }
+            var left = e.clientX+document.body.scrollLeft+20;
+            var top = e.clientY+document.body.scrollTop+20;
+            $(".showpic").css({left:left,top:top,display:""});
+            if(imgsrc.indexOf('://')<0){ imgsrc = ROOT_PATH + '/' + imgsrc;	} else{ imgsrc = imgsrc.replace('mac:','http:'); }
+            $(".showpic_img").attr("src", imgsrc);
+        },function (e){
+            $(".showpic").css("display","none");
+        });
+
+    });
+
+</script>
+
+</body>
+</html>

+ 156 - 0
application/admin/view/addon/index.html

@@ -0,0 +1,156 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="layui-tab layui-tab-brief" lay-filter="tabs">
+        <ul class="layui-tab-title">
+            <li class="layui-this btn-local" data-href="{:url('downloaded')}">本地应用</li>
+            <li class="btn-online" data-href="http://api.maccms.com/addon/index">在线商店</li>
+            <li class="layui-upload" data-href="{:url('add')}">离线安装</li>
+            <li class="">绑定账号</li>
+        </ul>
+        <div class="layui-tab-content">
+            <div class="layui-tab-item layui-show">
+
+    <div class="my-toolbar-box" >
+        <div class="center mb10">
+        <form class="layui-form " method="post">
+            <div class="layui-input-inline w300">
+                <input type="text" autocomplete="off" placeholder="请输入搜索条件" class="layui-input" name="wd" value="{$param['wd']}">
+            </div>
+            <button class="layui-btn mgl-20 j-search" >查询</button>
+        </form>
+        </div>
+    </div>
+
+    <form class="layui-form p10 " method="post" id="pageListForm">
+        <div class="layui-row layui-col-space15" id="addon_list">
+
+        </div>
+        <div id="pages" class="center"></div>
+    </form>
+</div>
+            </div>
+        </div>
+    </div>
+
+{include file="../../../application/admin/view/public/foot" /}
+
+
+<script type="text/javascript">
+    var url='';
+    layui.use(['form','laypage', 'layer','upload','element'], function() {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , upload = layui.upload
+                ,element = layui.element;
+
+        //监听Tab切换
+        element.on('tab(tabs)', function(data){
+            if(data.index <2){
+                url = $(this).attr('data-href');
+                load_list();
+            }
+        });
+
+        upload.render({
+            elem: '.layui-upload'
+            ,url: "{:url('addon/local')}"
+            ,method: 'post'
+            ,exts:'zip'
+            ,before: function(input) {
+                layer.msg('文件上传中...', {time:3000000});
+            },done: function(res, index, upload) {
+                var obj = this.item;
+                if (res.code == 0) {
+                    layer.msg(res.msg);
+                    return false;
+                }
+                layer.closeAll();
+            }
+        });
+
+
+        $(document).on('click', '.btn-disable,.btn-enable', function() {
+            $.ajax({
+                type: 'get',
+                dataType:'json',
+                url: "{:url('addon/state')}",
+                data:{name:$(this).attr('data-name'),action:$(this).attr('data-action'),force:0},
+                success:function($r){
+                    if($r.code ==1){
+                        load_list();
+                    }
+                    layer.msg($r.msg);
+                },
+                complete:function(){
+
+                }
+            });
+        });
+        $(document).on('click', '.btn-install', function() {
+
+        });
+        $(document).on('click', '.btn-uninstall', function() {
+            $.ajax({
+                type: 'get',
+                dataType:'json',
+                url: "{:url('addon/uninstall')}",
+                data:{name:$(this).attr('data-name'),force:0},
+                success:function($r){
+                    if($r.code ==1){
+                        load_list();
+                    }
+                    layer.msg($r.msg);
+                },
+                complete:function(){
+
+                }
+            });
+        });
+        $(document).on('click', '.btn-info', function() {
+
+        });
+
+        $('.btn-local').click();
+    });
+
+    function load_list(){
+        var h='';
+        $('#addon_list').html('');
+        layer.msg('数据请求中...',{time:500000});
+
+        $.ajax({
+            type: 'get',
+            dataType:'jsonp',
+            url: url,
+            success:function($r){
+                $.each($r.rows,function(i,row){
+                    h ='<div class="layui-col-md3"><div class="addon"> <a href="#" target="_blank"> <img src="'+row.image+'" class="add-logo"> </a> <div class="addon-caption"> <h4>'+row.title+'<span class="layui-badge layui-bg-green">推荐</span></h4> <p><b>¥'+row.price+'</b></p> <p>作者: '+row.author+'</p> <p>介绍: '+row.intro+'</p> <p>版本: '+row.version+'</p> <p>添加时间: '+ getDataTime(row.createtime)+'</p>';
+                    h+='<div class="operate"><span class="btn-group">';
+                    if(row.install =='1'){
+                        h+='<a href="javascript:;" class="layui-btn layui-btn-normal layui-btn-sm j-iframe" data-name="'+row.name+'" data-href="{:url('config')}?name='+row.name+'" ><i class="layui-icon">&#xe614;</i>配置</a>';
+                        if(row.state=='1'){
+                            h+='<a href="javascript:;" class="layui-btn layui-btn-warm layui-btn-sm btn-disable" data-name="'+row.name+'" data-action="disable"><i class="layui-icon">&#x1006;</i>禁用</a>';
+                        }
+                        else{
+                            h+='<a href="javascript:;" class="layui-btn  layui-btn-sm btn-enable" data-name="'+row.name+'" data-action="enable"><i class="layui-icon">&#xe605;</i>启用</a><a href="javascript:;" class="layui-btn layui-btn-danger layui-btn-sm btn-uninstall" data-name="'+row.name+'"><i class="layui-icon">&#x1006;</i>卸载</a>';
+                        }
+                    }
+                    else{
+                        h+='<a href="javascript:;" class="layui-btn layui-btn-sm btn-install"><i class="layui-icon">&#xe601;</i>安装</a>';
+                    }
+                    h+='</span> <span class="fr" style="margin-top:10px;"> <a href="javascript:;" class="btn-info text-gray " data-name="'+row.name+'" title="详情"><i class="layui-icon">&#xe63c;</i></a> </span> </div> </div> </div> </div>';
+
+                    $('#addon_list').append(h);
+                });
+            },
+            complete:function(){
+                layer.closeAll();
+            }
+        });
+    }
+
+</script>
+</body>
+</html>

+ 10 - 0
application/admin/view/addon/info.html

@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>Title</title>
+</head>
+<body>
+
+</body>
+</html>

+ 80 - 0
application/admin/view/admin/index.html

@@ -0,0 +1,80 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box">
+
+        <div class="layui-btn-group">
+            <a data-href="{:url('info')}" class="layui-btn layui-btn-primary j-iframe"><i class="layui-icon">&#xe654;</i>添加</a>
+            <a data-href="{:url('del')}" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe640;</i>删除</a>
+        </div>
+
+    </div>
+
+    <form class="layui-form " method="post" id="pageListForm">
+        <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th width="100">编号</th>
+                <th >名称</th>
+                <th width="100">状态</th>
+                <th width="140">上次登录时间</th>
+                <th width="140">上次登录IP</th>
+                <th width="130">登录次数</th>
+                <th width="100">操作</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td>
+                    {if condition="$admin['admin_id'] neq $vo['admin_id']"}
+                    <input type="checkbox" name="ids[]" value="{$vo.admin_id}" class="layui-checkbox checkbox-ids" lay-skin="primary">
+                    {/if}
+                </td>
+                <td>{$vo.admin_id}</td>
+                <td>{$vo.admin_name|htmlspecialchars}</td>
+                <td>
+                    <input type="checkbox" name="status" {if condition="$vo['admin_status'] eq 1"}checked{/if} value="{$vo['admin_status']}" lay-skin="switch" lay-filter="switchStatus" lay-text="正常|关闭" data-href="{:url('field?col=admin_status&ids='.$vo['admin_id'])}">
+                </td>
+                <td>{$vo.admin_last_login_time|mac_day=color}</td>
+                <td>{$vo.admin_last_login_ip|long2ip}</td>
+                <td>{$vo.admin_login_num}</td>
+                <td>
+                    <a class="layui-badge-rim j-iframe" data-href="{:url('info?id='.$vo['admin_id'])}" href="javascript:;" title="编辑">编辑</a>
+                    {if condition="$admin['admin_id'] neq $vo['admin_id']"}
+                    <a class="layui-badge-rim j-tr-del" data-href="{:url('del?ids='.$vo['admin_id'])}" href="javascript:;" title="删除">删除</a>
+                    {/if}
+                </td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+        <div id="pages" class="center"></div>
+    </form>
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    var curUrl="{:url('admin/index',$param)}";
+    layui.use(['laypage', 'layer'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer;
+
+        laypage.render({
+            elem: 'pages'
+            ,count: {$total}
+            ,limit: {$limit}
+            ,curr: {$page}
+            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
+            ,jump: function(obj,first){
+                if(!first){
+                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
+                }
+            }
+        });
+    });
+</script>
+</body>
+</html>

+ 145 - 0
application/admin/view/admin/info.html

@@ -0,0 +1,145 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+    <form class="layui-form layui-form-pane" method="post" action="">
+        <input id="admin_id" name="admin_id" type="hidden" value="{$info.admin_id}">
+        <div class="layui-form-item">
+            <label class="layui-form-label">账号:</label>
+            <div class="layui-input-block  ">
+                <input type="text" class="layui-input" value="{$info.admin_name}" placeholder="" id="admin_name" name="admin_name">
+            </div>
+        </div>
+        <div class="layui-form-item">
+            <label class="layui-form-label">密码:</label>
+            <div class="layui-input-block">
+                <input type="password" class="layui-input" value="{$info.admin_pwd}" placeholder="" id="admin_pwd" name="admin_pwd">
+            </div>
+        </div>
+
+        <div class="layui-form-item">
+            <label class="layui-form-label">状态:</label>
+            <div class="layui-input-block">
+                    <input name="admin_status" type="radio" id="rad-1" value="0" title="禁用" {if condition="$info['admin_status'] neq 1"}checked {/if}>
+                    <input name="admin_status" type="radio" id="rad-2" value="1" title="启用" {if condition="$info['admin_status'] eq 1"}checked {/if}>
+            </div>
+        </div>
+
+        <div class="layui-form-item ">
+            <label class="layui-form-label">权限:</label>
+            <div class="layui-input-block">
+                <blockquote class="layui-elem-quote layui-quote-nm">
+                    提示:<br>
+                    1.权限控制精准到每个操作,创始人ID为1的管理员拥有所有权限。
+                    2.--开头的是页面内按钮操作选项。
+                </blockquote>
+
+
+                <div class="role-list-form ">
+                    {volist name="menus" id="vo" key="k1"}
+                    <dl class="role-list-form-top permission-list">
+                        <dt>
+                            <input type="checkbox" value="" {$vo.ck} lay-skin="primary" data-id="{$k1}" lay-filter="roleAuth1" title="{$vo.name}">
+                        </dt>
+                        <dd>
+                            {volist name="$vo.sub" id="sub" key="k2"}
+                                <input type="checkbox" value="{$sub.controller}/{$sub.action}" name="admin_auth[]" {$sub.ck} data-pid="{$k1}" title="{$sub.name}" lay-skin="primary" lay-filter="roleAuth2">
+                            {/volist}
+                        </dd>
+                    </dl>
+                    {/volist}
+                </div>
+
+            </div>
+        </div>
+
+        <div class="layui-form-item center">
+            <div class="layui-input-block">
+                <button type="button" class="layui-btn layui-btn-normal formCheckAll" lay-filter="formCheckAll" >全选</button>
+                <button type="button" class="layui-btn layui-btn-normal formCheckOther" lay-filter="formCheckOther">反选</button>
+
+                <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit" data-child="true">保 存</button>
+                <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
+            </div>
+        </div>
+    </form>
+
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    layui.use(['form', 'layer'], function () {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery;
+
+        // 验证
+        form.verify({
+            admin_name: function (value) {
+                if (value == "") {
+                    return "请输入管理员名称";
+                }
+            },
+            admin_pwd: function (value) {
+                if (value == "") {
+                    return "请输入管理员密码";
+                }
+            }
+        });
+
+        form.on('checkbox(roleAuth1)', function(data) {
+            var child = $(data.elem).parent('dt').siblings('dd').find('input');
+            /* 自动选中子节点 */
+            child.each(function(index, item) {
+                if(item.disabled == true){
+
+                }
+                else {
+                    item.checked = data.elem.checked;
+                }
+            });
+            form.render('checkbox');
+        });
+
+        form.on('checkbox(roleAuth2)', function(data) {
+            var child = $(data.elem).parent().find('input');
+            var parent = $(data.elem).parent('dd').siblings('dt').find('input');
+            var parent_ck= true;
+            /* 自动选中子节点 */
+            child.each(function(index, item) {
+                if(!item.checked){
+                    parent_ck = false;
+                }
+            });
+            parent.each(function(index, item) {
+                item.checked = parent_ck;
+            });
+            form.render('checkbox');
+        });
+
+
+        $('.formCheckAll').click(function(){
+            var child = $('.role-list-form-top').find('input');
+            /* 自动选中子节点 */
+            child.each(function(index, item) {
+                item.checked = true;
+            });
+            form.render('checkbox');
+        });
+        $('.formCheckOther').click(function(){
+            var child = $('.role-list-form-top').find('input');
+            /* 自动选中子节点 */
+            child.each(function(index, item) {
+                item.checked = (item.checked  ? false : true);
+            });
+            form.render('checkbox');
+        });
+
+    });
+
+
+
+
+</script>
+
+</body>
+</html>

+ 165 - 0
application/admin/view/art/batch.html

@@ -0,0 +1,165 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <form class="layui-form" method="post" action="">
+
+        <div class="my-toolbar-box">
+
+            <div class="center mb10">
+
+                    <div class="layui-input-inline w150">
+                        <select name="type">
+                            <option value="">选择分类</option>
+                            {volist name="type_tree" id="vo"}
+                            {if condition="$vo.type_mid eq 2"}
+                            <option value="{$vo.type_id}" {if condition="$param['type'] eq $vo.type_id"}selected {/if}>{$vo.type_name}</option>
+                            {volist name="vo.child" id="ch"}
+                            <option value="{$ch.type_id}" {if condition="$param['type'] eq $ch.type_id"}selected {/if}>&nbsp;&nbsp;&nbsp;&nbsp;├&nbsp;{$ch.type_name}</option>
+                            {/volist}
+                            {/if}
+                            {/volist}
+                        </select>
+                    </div>
+                    <div class="layui-input-inline w150">
+                        <select name="status">
+                            <option value="">选择状态</option>
+                            <option value="0" {if condition="$param['status'] eq '0'"}selected {/if}>未审核</option>
+                            <option value="1" {if condition="$param['status'] eq '1'"}selected {/if}>已审核</option>
+                        </select>
+                    </div>
+                    <div class="layui-input-inline w150">
+                        <select name="level">
+                            <option value="">选择推荐</option>
+                            <option value="9" {if condition="$param['level'] eq '9'"}selected {/if}>推荐9-幻灯</option>
+                            <option value="1" {if condition="$param['level'] eq '1'"}selected {/if}>推荐1</option>
+                            <option value="2" {if condition="$param['level'] eq '2'"}selected {/if}>推荐2</option>
+                            <option value="3" {if condition="$param['level'] eq '3'"}selected {/if}>推荐3</option>
+                            <option value="4" {if condition="$param['level'] eq '4'"}selected {/if}>推荐4</option>
+                            <option value="5" {if condition="$param['level'] eq '5'"}selected {/if}>推荐5</option>
+                            <option value="6" {if condition="$param['level'] eq '6'"}selected {/if}>推荐6</option>
+                            <option value="7" {if condition="$param['level'] eq '7'"}selected {/if}>推荐7</option>
+                            <option value="8" {if condition="$param['level'] eq '8'"}selected {/if}>推荐8</option>
+                        </select>
+                    </div>
+                    <div class="layui-input-inline w150">
+                        <select name="lock">
+                            <option value="">选择锁定</option>
+                            <option value="0" {if condition="$param['lock'] eq '0'"}selected {/if}>未锁定</option>
+                            <option value="1" {if condition="$param['lock'] eq '1'"}selected {/if}>已锁定</option>
+                        </select>
+                    </div>
+                    <div class="layui-input-inline w150">
+                        <select name="pic">
+                            <option value="">选择图片</option>
+                            <option value="1" {if condition="$param['pic'] eq '1'"}selected{/if}>无图片</option>
+                            <option value="2" {if condition="$param['pic'] eq '2'"}selected{/if}>远程图片</option>
+                            <option value="3" {if condition="$param['pic'] eq '3'"}selected{/if}>同步出错图</option>
+                        </select>
+                    </div>
+
+                    <div class="layui-input-inline">
+                        <input type="text" autocomplete="off" placeholder="请输入关键字" class="layui-input" name="wd" value="{$param['wd']}">
+                    </div>
+
+            </div>
+
+        </div>
+
+        <fieldset class="layui-elem-field">
+            <legend>批量删除</legend>
+            <div class="layui-field-box">
+                <div class="layui-form-item">
+                    <div class="layui-inline">
+                        <label class="layui-form-label"><input type="checkbox" lay-ignore value="1" name="ck_del">确认删除</label>
+                        <div class="layui-input-inline" style="width: 100px;">
+                        </div>
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <button type="button" class="layui-btn btn_submit">批量删除</button>
+                </div>
+            </div>
+        </fieldset>
+
+        <fieldset class="layui-elem-field">
+        <legend>批量设置</legend>
+        <div class="layui-field-box">
+
+            <div class="layui-form-item">
+                <div class="layui-inline">
+                    <label class="layui-form-label"><input type="checkbox" lay-ignore value="1" name="ck_level" title="推荐">推荐</label>
+                    <div class="layui-input-inline" style="width: 100px;">
+                        <select name="val_level">
+                            <option value="">选择推荐</option>
+                            <option value="9" >推荐9-幻灯</option>
+                            <option value="1" >推荐1</option>
+                            <option value="2" >推荐2</option>
+                            <option value="3" >推荐3</option>
+                            <option value="4" >推荐4</option>
+                            <option value="5" >推荐5</option>
+                            <option value="6" >推荐6</option>
+                            <option value="7" >推荐7</option>
+                            <option value="8" >推荐8</option>
+                        </select>
+                    </div>
+                </div>
+            </div>
+
+            <div class="layui-form-item">
+                <div class="layui-inline">
+                    <label class="layui-form-label"><input type="checkbox" lay-ignore value="1" name="ck_lock">锁定</label>
+                    <div class="layui-input-inline" style="width: 100px;">
+                        <select name="val_lock">
+                            <option value="">选择操作</option>
+                            <option value="0" >解锁</option>
+                            <option value="1" >锁定</option>
+                        </select>
+                    </div>
+                </div>
+            </div>
+
+            <div class="layui-form-item">
+                <div class="layui-inline">
+                    <label class="layui-form-label"><input type="checkbox" lay-ignore value="1" name="ck_status">状态</label>
+                    <div class="layui-input-inline" style="width: 100px;">
+                        <select name="val_status">
+                            <option value="">选择状态</option>
+                            <option value="0" >未审核</option>
+                            <option value="1" >已审核</option>
+                        </select>
+                    </div>
+                </div>
+            </div>
+
+            <div class="layui-form-item">
+                <div class="layui-inline">
+                    <label class="layui-form-label"><input type="checkbox" lay-ignore value="1" name="ck_hits">人气</label>
+                    <div class="layui-input-inline" style="width: 100px;">
+                        <input type="text" name="val_hits_min" required  placeholder="最小值" autocomplete="off" class="layui-input">
+                    </div>
+                    <div class="layui-input-inline" style="width: 100px;">
+                        <input type="text" name="val_hits_max" required  placeholder="最大值" autocomplete="off" class="layui-input">
+                    </div>
+                </div>
+            </div>
+
+            <div class="layui-form-item">
+                <button type="submit" class="layui-btn btn_submit">批量设置</button>
+            </div>
+
+        </div>
+    </fieldset>
+    </form>
+</div>
+
+<script type="text/javascript">
+    layui.use(['form'], function () {
+
+    });
+
+    $('.btn_submit').click(function(){
+        $('form').submit();
+    })
+</script>
+</body>
+</html>

+ 169 - 0
application/admin/view/art/index.html

@@ -0,0 +1,169 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box">
+
+        <div class="center mb10">
+            <form class="layui-form " method="post">
+                <input type="hidden" value="{$param.select}" name="select">
+                <input type="hidden" value="{$param.input}" name="input">
+                <div class="layui-input-inline w150">
+                    <select name="type">
+                        <option value="">选择分类</option>
+                        {volist name="type_tree" id="vo"}
+                        {if condition="$vo.type_mid eq 2"}
+                        <option value="{$vo.type_id}" {if condition="$param['type'] eq $vo.type_id"}selected {/if}>{$vo.type_name}</option>
+                        {volist name="vo.child" id="ch"}
+                        <option value="{$ch.type_id}" {if condition="$param['type'] eq $ch.type_id"}selected {/if}>&nbsp;&nbsp;&nbsp;&nbsp;├&nbsp;{$ch.type_name}</option>
+                        {/volist}
+                        {/if}
+                        {/volist}
+                    </select>
+                </div>
+                <div class="layui-input-inline w150">
+                    <select name="status">
+                        <option value="">选择状态</option>
+                        <option value="0" {if condition="$param['status'] eq '0'"}selected {/if}>未审核</option>
+                        <option value="1" {if condition="$param['status'] eq '1'"}selected {/if}>已审核</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline w150">
+                    <select name="level">
+                        <option value="">选择推荐</option>
+                        <option value="9" {if condition="$param['level'] eq '9'"}selected {/if}>推荐9-幻灯</option>
+                        <option value="1" {if condition="$param['level'] eq '1'"}selected {/if}>推荐1</option>
+                        <option value="2" {if condition="$param['level'] eq '2'"}selected {/if}>推荐2</option>
+                        <option value="3" {if condition="$param['level'] eq '3'"}selected {/if}>推荐3</option>
+                        <option value="4" {if condition="$param['level'] eq '4'"}selected {/if}>推荐4</option>
+                        <option value="5" {if condition="$param['level'] eq '5'"}selected {/if}>推荐5</option>
+                        <option value="6" {if condition="$param['level'] eq '6'"}selected {/if}>推荐6</option>
+                        <option value="7" {if condition="$param['level'] eq '7'"}selected {/if}>推荐7</option>
+                        <option value="8" {if condition="$param['level'] eq '8'"}selected {/if}>推荐8</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline w150">
+                    <select name="lock">
+                        <option value="">选择锁定</option>
+                        <option value="0" {if condition="$param['lock'] eq '0'"}selected {/if}>未锁定</option>
+                        <option value="1" {if condition="$param['lock'] eq '1'"}selected {/if}>已锁定</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline w150">
+                    <select name="pic">
+                        <option value="">选择图片</option>
+                        <option value="1" {if condition="$param['pic'] eq '1'"}selected{/if}>无图片</option>
+                        <option value="2" {if condition="$param['pic'] eq '2'"}selected{/if}>远程图片</option>
+                        <option value="3" {if condition="$param['pic'] eq '3'"}selected{/if}>同步出错图</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline w150">
+                    <select name="order">
+                        <option value="">选择排序</option>
+                        <option value="art_time" {if condition="$param['order'] eq 'art_time'"}selected{/if}>更新时间</option>
+                        <option value="art_id" {if condition="$param['order'] eq 'art_id'"}selected{/if}>编号</option>
+                        <option value="art_hits" {if condition="$param['order'] eq 'art_hits'"}selected{/if}>总人气</option>
+                        <option value="art_hits_month" {if condition="$param['order'] eq 'art_hits_month'"}selected{/if}>月人气</option>
+                        <option value="art_hits_week" {if condition="$param['order'] eq 'art_hits_week'"}selected{/if}>周人气</option>
+                        <option value="art_hits_day" {if condition="$param['order'] eq 'art_hits_day'"}selected{/if}>日人气</option>
+                    </select>
+                </div>
+
+                <div class="layui-input-inline">
+                    <input type="text" autocomplete="off" placeholder="请输入搜索条件" class="layui-input" name="wd" value="{$param['wd']}">
+                </div>
+                <button class="layui-btn mgl-20 j-search" >查询</button>
+            </form>
+        </div>
+
+        <div class="layui-btn-group">
+            <a data-href="{:url('info')}" data-full="1" class="layui-btn layui-btn-primary j-iframe"><i class="layui-icon">&#xe654;</i>添加</a>
+            <a data-href="{:url('del')}" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe640;</i>删除</a>
+            <a data-href="{:url('index/select')}?tab=art&col=type_id&tpl=select_type&url=art/field" data-width="270" data-height="100" data-checkbox="1" class="layui-btn layui-btn-primary j-select"><i class="layui-icon">&#xe620;</i>分类</a>
+            <a data-href="{:url('index/select')}?tab=art&col=art_level&tpl=select_level&url=art/field" data-width="270" data-height="100" data-checkbox="1" class="layui-btn layui-btn-primary j-select"><i class="layui-icon">&#xe620;</i>推荐</a>
+            <a data-href="{:url('index/select')}?tab=art&col=art_hits&tpl=select_hits&url=art/field" data-width="470" data-height="100" data-checkbox="1" class="layui-btn layui-btn-primary j-select"><i class="layui-icon">&#xe620;</i>点击</a>
+            <a data-href="{:url('index/select')}?tab=art&col=art_status&tpl=select_status&url=art/field" data-width="470" data-height="100" data-checkbox="1" class="layui-btn layui-btn-primary j-select"><i class="layui-icon">&#xe620;</i>状态</a>
+            <a data-href="{:url('index/select')}?tab=art&col=art_lock&tpl=select_lock&url=art/field" data-width="470" data-height="100" data-checkbox="1" class="layui-btn layui-btn-primary j-select"><i class="layui-icon">&#xe620;</i>锁定</a>
+            <a class="layui-btn layui-btn-primary j-iframe" data-href="{:url('images/opt?tab=art')}" href="javascript:;" title="同步远程图片"><i class="layui-icon">&#xe620;</i>同步图片</a>
+            <a class="layui-btn layui-btn-primary j-iframe" data-checkbox="true" data-href="{:url('make/make?ac=info&tab=art')}" href="javascript:;" title="生成页面"><i class="layui-icon">&#xe620;</i>生成页面</a>
+            {if condition="$param.select eq 1"}
+            <a data-href="" onclick="parent.onSelectResult('{$param.input}',$('.checkbox-ids:checked'))" class="layui-btn layui-btn-normal">选择返回</a>
+            {/if}
+            {if condition="$param['repeat'] neq ''"}
+            <a data-href="{:url('del')}?repeat=1&retain=min" data-checkbox="no" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe640;</i>一键删重[保留小ID]</a>
+            <a data-href="{:url('del')}?repeat=1&retain=max" data-checkbox="no" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe640;</i>一键删重[保留大ID]</a>
+            {/if}
+        </div>
+
+    </div>
+
+
+    <form class="layui-form " method="post" id="pageListForm">
+        <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th width="50">编号</th>
+                <th >名称</th>
+                <th width="50">人气</th>
+                <th width="30">评分</th>
+                <th width="30">推荐</th>
+                <th width="30">浏览</th>
+                <th width="80">编辑人</th>
+                <th width="120">更新时间</th>
+                <th width="80">操作</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" value="{$vo.art_id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                <td>{$vo.art_id}</td>
+                <td>[{$vo.type.type_name}] <a target="_blank" class="layui-badge-rim " href="{:mac_url_art_detail($vo)}">{$vo.art_name|htmlspecialchars}</a> {if condition="$vo.art_status eq 0"} <span class="layui-badge">未审</span>{/if} {if condition="$vo.art_lock eq 1"} <span class="layui-badge">锁定</span>{/if}</td>
+                <td>{$vo.art_hits}</td>
+                <td>{$vo.art_score}</td>
+                <td><a data-href="{:url('index/select')}?tab=art&col=art_level&tpl=select_level&url=art/field&ids={$vo.art_id}" data-width="270" data-height="100" class=" j-select"><span class="layui-badge layui-bg-orange">{$vo.art_level}</span></a></td>
+                <td>{if condition="$vo.ismake eq 1"}<a target="_blank" class="layui-badge layui-bg-green " href="{:mac_url_art_detail($vo)}">Y</a>{else/}<a class="layui-badge" href="{:url('make/make?ac=info&tab=art')}?ids={$vo.art_id}&ref=1">N</a>{/if}</td>
+                <td>{$vo.art_author|htmlspecialchars}</td>
+                <td>{$vo.art_time|mac_day=color}</td>
+                <td>
+                    <a class="layui-badge-rim j-iframe" data-full="1" data-href="{:url('info?id='.$vo['art_id'])}" href="javascript:;" title="编辑">编辑</a>
+                    <a class="layui-badge-rim j-tr-del" data-href="{:url('del?ids='.$vo['art_id'])}" href="javascript:;" title="删除">删除</a>
+                </td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+        <div id="pages" class="center"></div>
+    </form>
+</div>
+
+
+
+
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    var curUrl="{:url('art/data',$param)}";
+    layui.use(['laypage', 'layer','form'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer,
+                form = layui.form;
+
+        laypage.render({
+            elem: 'pages'
+            ,count: {$total}
+            ,limit: {$limit}
+            ,curr: {$page}
+            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
+            ,jump: function(obj,first){
+                if(!first){
+                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
+                }
+            }
+        });
+
+
+    });
+</script>
+</body>
+</html>

+ 482 - 0
application/admin/view/art/info.html

@@ -0,0 +1,482 @@
+{include file="../../../application/admin/view/public/head" /}
+<script type="text/javascript" src="__STATIC__/js/jquery.jscolor.js"></script>
+{include file="../../../application/admin/view/public/editor" flag="art_editor"/}
+
+<div class="page-container p10">
+    <div class="showpic" style="display:none;"><img class="showpic_img" width="120" height="160"></div>
+    
+    <form class="layui-form layui-form-pane" method="post" action="">
+        <input type="hidden" name="art_id" value="{$info.art_id}">
+
+        <div class="layui-tab">
+            <ul class="layui-tab-title ">
+                <li class="layui-this">基本信息</a></li>
+                <li>其他信息</li>
+            </ul>
+            <div class="layui-tab-content">
+
+                <div class="layui-tab-item layui-show">
+                    
+                <div class="layui-form-item">
+                    <label class="layui-form-label">参数:</label>
+                    <div class="layui-input-inline w150">
+                            <select name="type_id" lay-filter="type_id">
+                                <option value="">请选择分类</option>
+                                {volist name="type_tree" id="vo"}
+                                    {if condition="$vo.type_mid eq 2"}
+                                    <option value="{$vo.type_id}" {if condition="$info.type_id eq $vo.type_id"}selected{/if}>{$vo.type_name}</option>
+                                    {volist name="$vo.child" id="ch"}
+                                    <option value="{$ch.type_id}" {if condition="$info.type_id eq $ch.type_id"}selected{/if}>&nbsp;|&nbsp;&nbsp;&nbsp;|—{$ch.type_name}</option>
+                                    {/volist}
+                                    {/if}
+                                {/volist}
+                            </select>
+                    </div>
+                    <div class="layui-input-inline w150">
+                            <select name="art_level">
+                                <option value="0">请选择推荐</option>
+                                <option value="9" {if condition="$info.art_level eq 9"}selected{/if}>推荐9-幻灯</option>
+                                <option value="1" {if condition="$info.art_level eq 1"}selected{/if}>推荐1</option>
+                                <option value="2" {if condition="$info.art_level eq 2"}selected{/if}>推荐2</option>
+                                <option value="3" {if condition="$info.art_level eq 3"}selected{/if}>推荐3</option>
+                                <option value="4" {if condition="$info.art_level eq 4"}selected{/if}>推荐4</option>
+                                <option value="5" {if condition="$info.art_level eq 5"}selected{/if}>推荐5</option>
+                                <option value="6" {if condition="$info.art_level eq 6"}selected{/if}>推荐6</option>
+                                <option value="7" {if condition="$info.art_level eq 7"}selected{/if}>推荐7</option>
+                                <option value="8" {if condition="$info.art_level eq 8"}selected{/if}>推荐8</option>
+
+                            </select>
+                    </div>
+                    <div class="layui-input-inline w150">
+                            <select name="art_status">
+                                <option value="1" >已审核</option>
+                                <option value="0" {if condition="$info.art_status eq '0'"}selected{/if}>未审核</option>
+                            </select>
+                    </div>
+                    <div class="layui-input-inline w150">
+                        <select name="art_lock">
+                            <option value="0">未锁</option>
+                            <option value="1" {if condition="$info.art_lock eq 1"}selected{/if}>锁定</option>
+                        </select>
+                    </div>
+
+                    <div class="layui-input-inline">
+                        <input type="checkbox" name="uptime" title="更新时间" value="1" checked class="layui-checkbox checkbox-ids" lay-skin="primary">
+                    </div>
+                </div>
+
+                <div class="layui-form-item">
+                    <label class="layui-form-label">标题:</label>
+                    <div class="layui-input-inline w500">
+                        <input type="text" class="layui-input" value="{$info.art_name}" placeholder="请输入" name="art_name">
+                    </div>
+                    <label class="layui-form-label">副标:</label>
+                    <div class="layui-input-inline ">
+                        <input type="text" class="layui-input" value="{$info.art_sub}" placeholder="请输入副标题" name="art_sub">
+                    </div>
+
+                </div>
+
+                <div class="layui-form-item">
+                    <label class="layui-form-label">拼音:</label>
+                    <div class="layui-input-inline w500">
+                        <input type="text" class="layui-input" value="{$info.art_en}" placeholder="" name="art_en">
+                    </div>
+                    <label class="layui-form-label">首字母:</label>
+                    <div class="layui-input-inline w70">
+                        <input type="text" class="layui-input" value="{$info.art_letter}" placeholder="" name="art_letter">
+                    </div>
+                    <label class="layui-form-label">高亮:</label>
+                    <div class="layui-input-inline w70">
+                        <input type="text" class="layui-input color" value="{$info.art_color}" placeholder="" name="art_color">
+                    </div>
+                </div>
+
+                <div class="layui-form-item">
+                    <label class="layui-form-label">TAG:</label>
+                    <div class="layui-input-inline w500">
+                        <input type="text" class="layui-input" value="{$info.art_tag}" placeholder="" name="art_tag">
+                    </div>
+                    <div class="layui-input-inline w120">
+                        <input type="checkbox" name="uptag" title="自动生成" value="1" class="layui-checkbox checkbox-ids" lay-skin="primary">
+                    </div>
+                </div>
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">备注:</label>
+                        <div class="layui-input-inline w500">
+                            <input type="text" class="layui-input" value="{$info.art_remarks}" placeholder="" name="art_remarks">
+                        </div>
+                    </div>
+
+
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">关联视频:</label>
+                        <div class="layui-input-inline w500">
+                            <input type="text" class="layui-input" value="{$info.art_rel_vod}" placeholder="如“变形金刚”1、2、3部ID分别为11,12,13或将每部都填“变形金刚”" name="art_rel_vod">
+                        </div>
+                        <div class="layui-input-inline ">
+                            <a class="layui-btn j-iframe" data-href="{:url('vod/data')}?select=1&input=art_rel_vod" href="javascript:;" title="查询数据">查询数据</a>
+                        </div>
+                    </div>
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">关联文章:</label>
+                        <div class="layui-input-inline w500">
+                            <input type="text" class="layui-input" value="{$info.art_rel_art}" placeholder="如“变形金刚资讯”1、2、3部ID分别为11,12,13或将每部都填“变形金刚资讯”" name="art_rel_art">
+                        </div>
+                        <div class="layui-input-inline ">
+                            <a class="layui-btn j-iframe" data-href="{:url('art/data')}?select=1&input=art_rel_art" href="javascript:;" title="查询数据">查询数据</a>
+                        </div>
+                    </div>
+
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">扩展分类:</label>
+                        <div class="layui-input-inline w500">
+                            <input type="text" class="layui-input" value="{$info.art_class}" placeholder="" id="art_class" name="art_class">
+                        </div>
+                        <div class="layui-input-inline w500 art_class_label">
+
+                        </div>
+                    </div>
+
+                <div class="layui-form-item">
+                    <label class="layui-form-label">图片:</label>
+                    <div class="layui-input-inline w500 upload">
+                        <input type="text" class="layui-input upload-input" style="max-width:100%;" value="{$info.art_pic}" placeholder="" id="art_pic" name="art_pic">
+                    </div>
+                    <div class="layui-input-inline ">
+                        <button type="button" class="layui-btn layui-upload" lay-data="{data:{thumb:1,thumb_class:'upload-thumb'}}" id="upload1">上传图片</button>
+                    </div>
+                </div>
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">缩略图:</label>
+                        <div class="layui-input-inline w500 upload">
+                            <input type="text" class="layui-input upload-input" style="max-width:100%;" value="{$info.art_pic_thumb}" placeholder="" id="art_pic_thumb" name="art_pic_thumb">
+                        </div>
+                        <div class="layui-input-inline ">
+                            <button type="button" class="layui-btn layui-upload" lay-data="{data:{thumb:0,thumb_class:'upload-thumb'}}" id="upload2">上传图片</button>
+                        </div>
+                    </div>
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">海报图:</label>
+                        <div class="layui-input-inline w500 upload">
+                            <input type="text" class="layui-input upload-input" style="max-width:100%;" value="{$info.art_pic_slide}" placeholder="" id="art_pic_slide" name="art_pic_slide">
+                        </div>
+                        <div class="layui-input-inline ">
+                            <button type="button" class="layui-btn layui-upload" lay-data="{data:{thumb:0,thumb_class:'upload-thumb'}}" id="upload3">上传图片</button>
+                        </div>
+                    </div>
+
+                <div class="layui-form-item">
+                        <label class="layui-form-label">简介:</label>
+                    <div class="layui-input-block">
+                        <textarea name="art_blurb" cols="" rows="3" class="layui-textarea"  placeholder="不填写将自动从第一页详情里获取前100个字" style="height:40px;">{$info.art_blurb}</textarea>
+                    </div>
+                </div>
+
+                    <script>
+                        var ueArray=[];
+                        var content_arr_len = {$art_page_list|count};
+                    </script>
+
+                <div id="artlist" class="contents">
+                    {volist name="$art_page_list" id="vo"}
+                    <div class="layui-form-item" data-i="{$key}">
+                        <label class="layui-form-label">分页内容{$key}:</label>
+                        <div class="layui-input-inline w200"><input type="text" name="art_title[]" class="layui-input" value="{$vo.title}" placeholder="页标题"></div>
+                        <div class="layui-input-inline w200"><input type="text" name="art_note[]" class="layui-input" value="{$vo.note}" placeholder="页备注"></div>
+                        <div class="layui-input-inline w200"><a href="javascript:void(0)" class="j-editor-clear">清空</a>&nbsp;<a href="javascript:void(0)" class="j-editor-remove">删除</a>&nbsp;<a href="javascript:void(0)" class="j-editor-up">上移</a>&nbsp;<a href="javascript:void(0)" class="j-editor-down">下移</a>&nbsp;<br></div>
+                        <div class="p10 m20"></div>
+                        <div class="layui-input-block"><textarea id="art_content{$key}" name="art_content[]" type="text/plain" style="width:99%;height:250px">{$vo.content|mac_url_content_img}</textarea></div>
+                        <script>ueArray[{$key}] = editor_getEditor('art_content{$key}');</script>
+                    </div>
+                    {/volist}
+                </div>
+
+
+                    <div class="layui-form-item">
+                        <label class=""><button class="layui-btn radius j-editor-add" type="button">添加一页内容</button></label>
+                        <div class="layui-input-block">
+
+                        </div>
+                    </div>
+                    
+        </div>
+
+                <div class="layui-tab-item">
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">顶数量:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_up}" placeholder="" id="art_up" name="art_up">
+                            </div>
+                            <label class="layui-form-label">踩数量:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_down}" placeholder="" id="art_down" name="art_down">
+                            </div>
+                            <button class="layui-btn" type="button" id="btn_rnd">随机生成</button>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">总人气:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_hits}" placeholder="" id="art_hits" name="art_hits">
+                            </div>
+                            <label class="layui-form-label">月人气:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_hits_month}" placeholder="" id="art_hits_month" name="art_hits_month" >
+                            </div>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">周人气:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_hits_week}" placeholder="" id="art_hits_week" name="art_hits_week">
+                            </div>
+                            <label class="layui-form-label">日人气:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input " value="{$info.art_hits_day}" placeholder="" id="art_hits_day" name="art_hits_day">
+                            </div>
+                        </div>
+
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">平均分:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_score}" placeholder="" id="art_score" name="art_score">
+                            </div>
+                            <label class="layui-form-label">总评分:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_score_all}" placeholder="" id="art_score_all" name="art_score_all">
+                            </div>
+                            <label class="layui-form-label">总评次:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_score_num}" placeholder="" id="art_score_num" name="art_score_num">
+                            </div>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">整数据积分:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_points}" placeholder="" name="art_points">
+                            </div>
+                            <label class="layui-form-label">每页积分:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_points_detail}" placeholder="" name="art_points_detail">
+                            </div>
+                            <label class="layui-form-label">独立模板:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_tpl}" placeholder="" name="art_tpl">
+                            </div>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">编辑人:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_author}" placeholder="" name="art_author">
+                            </div>
+                            <label class="layui-form-label">来源:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_from}" placeholder="" name="art_from">
+                            </div>
+                            <label class="layui-form-label">跳转URL:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_jumpurl}" placeholder="" name="art_jumpurl">
+                            </div>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">访问密码:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_pwd}" placeholder="非静态模式下可用" name="art_pwd">
+                            </div>
+                            <label class="layui-form-label">密码链接:</label>
+                            <div class="layui-input-inline ">
+                                <input type="text" class="layui-input" value="{$info.art_pwd_url}" placeholder="" name="art_pwd_url">
+                            </div>
+
+                        </div>
+
+                    </div>
+
+            </div>
+        </div>
+
+                <div class="layui-form-item center">
+                    <div class="layui-input-block">
+                        <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit" data-child="">保 存</button>
+                        <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
+                    </div>
+                </div>
+    </form>
+
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+
+    layui.use(['form','upload', 'layer'], function () {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery
+                , upload = layui.upload;;
+
+        // 验证
+        form.verify({
+            art_name: function (value) {
+                if (value == "") {
+                    return "请输入专题名称";
+                }
+            }
+        });
+
+        $(document).on("click", ".extend", function(){
+            $id = $(this).attr('data-id');
+            if($id == 'art_class'||$id == 'art_keywords'){
+                $val = $("input[id='"+$id+"']").val();
+                if($val!=''){
+                    $val = $val+',';
+                }
+                if($val.indexOf($(this).text())>-1){
+                    return;
+                }
+                $("input[id='"+$id+"']").val($val+$(this).text());
+            }else{
+                $("input[id='"+$id+"']").val($(this).text());
+            }
+        });
+
+
+        form.on('select(type_id)', function(data){
+            getExtend(data.value);
+        });
+
+        upload.render({
+            elem: '.layui-upload'
+            ,url: "{:url('upload/upload')}?flag=art"
+            ,method: 'post'
+            ,before: function(input) {
+                layer.msg('文件上传中...', {time:3000000});
+            },done: function(res, index, upload) {
+                var obj = this.item;
+                if (res.code == 0) {
+                    layer.msg(res.msg);
+                    return false;
+                }
+                layer.closeAll();
+                var input = $(obj).parent().parent().find('.upload-input');
+                if ($(obj).attr('lay-type') == 'image') {
+                    input.siblings('img').attr('src', res.data.file).show();
+                }
+                input.val(res.data.file);
+
+                if(res.data.thumb_class !=''){
+                    $('.'+ res.data.thumb_class).val(res.data.thumb[0].file);
+                }
+            }
+        });
+
+        $('.upload-input').hover(function (e){
+            var e = window.event || e;
+            var imgsrc = $(this).val();
+            if(imgsrc.trim()==""){ return; }
+            var left = e.clientX+document.body.scrollLeft+20;
+            var top = e.clientY+document.body.scrollTop+20;
+            $(".showpic").css({left:left,top:top,display:""});
+            if(imgsrc.indexOf('://')<0){ imgsrc = ROOT_PATH + '/' + imgsrc;	} else{ imgsrc = imgsrc.replace('mac:','http:'); }
+            $(".showpic_img").attr("src", imgsrc);
+        },function (e){
+            $(".showpic").css("display","none");
+        });
+
+
+        $("#btn_rnd").click(function(){
+            $("#art_hits").val( rndNum(5000,9999) );
+            $("#art_hits_month").val( rndNum(1000,4999) );
+            $("#art_hits_week").val( rndNum(300,999) );
+            $("#art_hits_day").val( rndNum(1,299) );
+            $("#art_up").val( rndNum(1,999) );
+            $("#art_down").val( rndNum(1,999) );
+            $("#art_score").val( rndNum(10) );
+            $("#art_score_all").val( rndNum(1000) );
+            $("#art_score_num").val( rndNum(100) );
+        });
+
+
+
+        $('.contents').on('click','.j-editor-clear',function(){
+            var datai = $(this).parent().parent().attr('data-i');
+            editor_setContent(ueArray[datai],'');
+        });
+        $('.contents').on('click','.j-editor-remove',function(){
+            var datai = $(this).parent().parent().attr('data-i');
+            $(this).parent().parent().remove();
+            delete ueArray[datai];
+        });
+        $('.contents').on('click','.j-editor-up',function(){
+            var current = $(this).parent().parent();
+            var current_index = current.index();
+            var current_i = current.attr('data-i');
+            var prev = current.prev();
+            var prev_i = prev.attr('data-i');
+            if(current_index>0){
+                var current_txt = editor_getContent(ueArray[current_i]);
+                var prev_txt = editor_getContent(ueArray[prev_i]);
+                editor_setContent(ueArray[current_i],prev_txt);
+                editor_setContent(ueArray[prev_i],current_txt);
+            }
+        });
+        $('.contents').on('click','.j-editor-down',function(){
+            var current = $(this).parent().parent();
+            var current_index = current.index();
+            var current_i = current.attr('data-i');
+            var next = current.next();
+            var next_i = next.attr('data-i');
+
+            if(next.length>0){
+                var current_txt = editor_getContent(ueArray[current_i]);
+                var prev_txt = editor_getContent(ueArray[next_i]);
+
+                editor_setContent(ueArray[current_i],prev_txt);
+                editor_setContent(ueArray[next_i],current_txt);
+            }
+        });
+
+        $('.j-editor-add').on('click',function(){
+            content_arr_len++;
+            var tpl='<div class="layui-form-item" data-i="'+content_arr_len+'"><label class="layui-form-label">分页内容'+(content_arr_len)+':</label><div class="layui-input-inline w200"><input type="text" name="art_title[]" class="layui-input" placeholder="页标题"></div><div class="layui-input-inline w200"><input type="text" name="art_note[]" class="layui-input" placeholder="页备注"></div><div class="layui-input-inline w200 p10"><a href="javascript:void(0)" class="j-editor-clear">清空</a>&nbsp;<a href="javascript:void(0)" class="j-editor-remove">删除</a>&nbsp;<a href="javascript:void(0)" class="j-editor-up">上移</a>&nbsp;<a href="javascript:void(0)" class="j-editor-down">下移</a>&nbsp;<br></div><div class="p10 m20"></div><div class="layui-input-block"><textarea id="art_content'+(content_arr_len)+'" name="art_content[]" type="text/plain" style="width:99%;height:250px"></textarea></div></div>';
+            $(".contents").append(tpl);
+            ueArray[content_arr_len] = editor_getEditor( 'art_content'+content_arr_len );
+
+        });
+
+        if(content_arr_len==0){
+            $('.j-editor-add').click();
+        }
+    });
+
+    function getExtend(id){
+        $.post("{:url('type/extend')}", {id:id}, function(res) {
+
+            if (res.code == 1) {
+                $.each(res.data, function(key, value){
+                    $('.art_'+key+"_label").html('');
+                    if(value != ''){
+                        $.each(value, function(key2, value2){
+                            $(".art_"+key+"_label").append('<a class="layui-btn layui-btn-xs extend" href="javascript:;" data-id="art_'+key+'">'+value2+'</a>');
+                        });
+                    }
+                });
+            }
+        });
+    }
+
+    {if condition="$info.art_id gt 0"}
+    setTimeout(function () {
+        getExtend('{$info.type_id}')
+    },1000);
+    {/if}
+    
+</script>
+
+</body>
+</html>

+ 118 - 0
application/admin/view/card/index.html

@@ -0,0 +1,118 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box" >
+        <div class="center mb10">
+            <form class="layui-form " method="post"  id="searchForm">
+                <div class="layui-input-inline w150">
+                    <select name="sale_status">
+                        <option value="">选择出售状态</option>
+                        <option value="0" {if condition="$param['sale_status'] eq '0'"}selected {/if}>未出售</option>
+                        <option value="1" {if condition="$param['sale_status'] eq '1'"}selected {/if}>已出售</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline w150">
+                    <select name="use_status">
+                        <option value="">选择使用状态</option>
+                        <option value="0" {if condition="$param['use_status'] eq '0'"}selected {/if}>未使用</option>
+                        <option value="1" {if condition="$param['use_status'] eq '1'"}selected {/if}>已使用</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline w150">
+                    <select name="time">
+                        <option value="">选择时间</option>
+                        <option value="1" {if condition="$param['time'] eq '1'"}selected {/if}>最后一次</option>
+                        <option value="0" {if condition="$param['time'] eq '0'"}selected {/if}>当天</option>
+                        <option value="7" {if condition="$param['time'] eq '7'"}selected {/if}>一周内</option>
+                        <option value="30" {if condition="$param['time'] eq '30'"}selected {/if}>一个月内</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline">
+                    <input type="text" autocomplete="off" placeholder="请输入搜索条件" class="layui-input" name="wd" value="{$param['wd']}">
+                </div>
+                <button class="layui-btn mgl-20 j-search" >查询</button>
+                <button class="layui-btn mgl-20" type="button" id="btnExport">导出</button>
+            </form>
+        </div>
+
+        <div class="layui-btn-group">
+            <a data-href="{:url('info')}" class="layui-btn layui-btn-primary j-iframe" data-width="600px" data-height="400px"><i class="layui-icon">&#xe654;</i>添加</a>
+            <a data-href="{:url('del')}" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe640;</i>删除</a>
+            <a data-href="{:url('del')}?ids=1&all=1" class="layui-btn layui-btn-primary j-ajax" confirm="确认清空数据吗?操作不可恢复"><i class="layui-icon">&#xe640;</i>清空</a>
+
+        </div>
+    </div>
+
+     <form class="layui-form " method="post" id="pageListForm">
+         <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th width="80">编号</th>
+                <th width="150">卡号</th>
+                <th width="100">密码</th>
+                <th width="100">面值</th>
+                <th width="100">积分</th>
+                <th width="100">创建时间</th>
+                <th width="100">使用人</th>
+                <th width="150">使用时间</th>
+                <th width="50">操作</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" value="{$vo.card_id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                <td>{$vo.card_id}</td>
+                <td>{$vo.card_no|htmlspecialchars}</td>
+                <td>{$vo.card_pwd|htmlspecialchars}</td>
+                <td>{$vo.card_money}</td>
+                <td>{$vo.card_points}</td>
+                <td>{$vo.card_add_time|mac_day=color}</td>
+                <td>{$vo.user_id}、{$vo.user.user_name}</td>
+                <td>{if condition="$vo.card_use_time eq 0"} {else}{$vo.card_use_time|mac_day=color}{/if}</td>
+                <td>
+                    <a class="layui-badge-rim j-tr-del" data-href="{:url('del?ids='.$vo['card_id'])}" href="javascript:;" title="删除">删除</a>
+                </td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+
+        <div id="pages" class="center"></div>
+
+    </form>
+    <iframe id="if" width="0" height="0"></iframe>
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+
+
+<script type="text/javascript">
+    var curUrl="{:url('card/index',$param)}";
+    layui.use(['laypage', 'layer'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer;
+
+        laypage.render({
+            elem: 'pages'
+            ,count: {$total}
+            ,limit: {$limit}
+            ,curr: {$page}
+            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
+            ,jump: function(obj,first){
+                if(!first){
+                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
+                }
+            }
+        });
+
+        $('#btnExport').click(function(){
+            var par = $('#searchForm').serialize() + '&export=1';
+
+            $('#if').attr('src',"{:url('card/index')}?" + par);
+        });
+    });
+</script>
+</body>
+</html>

+ 83 - 0
application/admin/view/card/info.html

@@ -0,0 +1,83 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+    <form class="layui-form layui-form-pane" method="post" action="">
+        <input id="link_id" name="link_id" type="hidden" value="{$info.link_id}">
+        <div class="layui-form-item">
+            <label class="layui-form-label">生成数量:</label>
+            <div class="layui-input-block">
+                <input type="text" class="layui-input" value="10" lay-verify="num" placeholder="请输入生成数量" name="num">
+            </div>
+        </div>
+        <div class="layui-form-item">
+            <label class="layui-form-label">面值:</label>
+            <div class="layui-input-block">
+                <input type="text" class="layui-input" value="" lay-verify="money" placeholder="请输入面值" name="money">
+            </div>
+        </div>
+        <div class="layui-form-item">
+            <label class="layui-form-label">积分数:</label>
+            <div class="layui-input-block">
+                <input type="text" class="layui-input" value="" lay-verify="point" placeholder="请输入积分数" name="point">
+            </div>
+        </div>
+
+        <div class="layui-form-item">
+            <label class="layui-form-label">卡号规则:</label>
+            <div class="layui-input-block">
+                <input type="radio" name="role_no" value="" title="混合" checked>
+                <input type="radio" name="role_no" value="letter" title="字母" >
+                <input type="radio" name="role_no" value="num" title="数字" >
+            </div>
+        </div>
+        <div class="layui-form-item">
+            <label class="layui-form-label">密码规则:</label>
+            <div class="layui-input-block">
+                <input type="radio" name="role_pwd" value="" title="混合" checked>
+                <input type="radio" name="role_pwd" value="letter" title="字母" >
+                <input type="radio" name="role_pwd" value="num" title="数字" >
+            </div>
+        </div>
+
+        <div class="layui-form-item center">
+            <div class="layui-input-block">
+                <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit" data-child="true">保 存</button>
+                <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
+            </div>
+        </div>
+    </form>
+
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    layui.use(['form', 'layer'], function () {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery;
+
+        // 验证
+        form.verify({
+            num: function (value) {
+                if (value == "") {
+                    return "请输入生成数量";
+                }
+            },
+            money: function (value) {
+                if (value == "") {
+                    return "请输入充值卡面值";
+                }
+            },
+            point: function (value) {
+                if (value == "") {
+                    return "请输入充值卡点数";
+                }
+            }
+        });
+
+
+    });
+</script>
+
+</body>
+</html>

+ 102 - 0
application/admin/view/cash/index.html

@@ -0,0 +1,102 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box" >
+        <div class="center mb10">
+            <form class="layui-form " method="post">
+                <div class="layui-input-inline w150">
+                    <select name="status">
+                        <option value="">选择状态</option>
+                        <option value="0" {if condition="$param['status'] eq '0'"}selected {/if}>待审核</option>
+                        <option value="1" {if condition="$param['status'] eq '1'"}selected {/if}>已审核</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline">
+                    <input type="text" autocomplete="off" placeholder="请输入搜索条件" class="layui-input" name="wd" value="{$param['wd']}">
+                </div>
+                <button class="layui-btn mgl-20 j-search" >查询</button>
+            </form>
+        </div>
+
+        <div class="layui-btn-group">
+            <a data-href="{:url('del')}" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe640;</i>删除</a>
+            <a data-href="{:url('del')}?ids=1&all=1" class="layui-btn layui-btn-primary j-ajax" confirm="确认清空数据吗?操作不可恢复"><i class="layui-icon">&#xe640;</i>清空</a>
+            <a data-href="{:url('audit')}" class="layui-btn layui-btn-primary j-page-btns confirm" confirm="确认审核数据吗?操作不可恢复"><i class="layui-icon">&#xe640;</i>审核</a>
+        </div>
+    </div>
+
+     <form class="layui-form " method="post" id="pageListForm">
+         <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th width="50">编号</th>
+                <th width="50">用户</th>
+                <th width="50">状态</th>
+                <th width="50">积分</th>
+                <th width="50">金额</th>
+                <th width="50">银行</th>
+                <th width="50">账号</th>
+                <th width="50">姓名</th>
+                <th width="100">备注</th>
+                <th width="100">时间</th>
+                <th width="100">审核时间</th>
+                <th width="50">操作</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" value="{$vo.cash_id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                <td>{$vo.cash_id}</td>
+                <td>[{$vo.user_id}]{$vo.user_name|htmlspecialchars}</td>
+                <td>{if condition="$vo.cash_status eq 1"}<span class="layui-badge layui-bg-green">已审核</span>{else/}<span class="layui-badge">未审核</span>{/if}</td>
+                <td>{$vo.cash_points}</td>
+                <td>{$vo.cash_money}</td>
+                <td>{$vo.cash_bank_name|htmlspecialchars}</td>
+                <td>{$vo.cash_bank_no|htmlspecialchars}</td>
+                <td>{$vo.cash_payee_name|htmlspecialchars}</td>
+                <td>{$vo.cash_remarks|htmlspecialchars}</td>
+                <td>{$vo.cash_time|mac_day=color}</td>
+                <td>{$vo.cash_time_audit|mac_day=color}</td>
+                <td>
+                    <a class="layui-badge-rim j-tr-del" data-href="{:url('del?ids='.$vo['cash_id'])}" href="javascript:;" title="删除">删除</a>
+                    {if condition="$vo.cash_status neq '1'"}
+                    <a class="layui-badge-rim j-ajax" confirm="确认审核数据吗?" data-href="{:url('audit?ids='.$vo['cash_id'])}" href="javascript:;" title="审核">审核</a>
+                    {/if}
+                </td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+
+        <div id="pages" class="center"></div>
+
+    </form>
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+
+
+<script type="text/javascript">
+    var curUrl="{:url('cash/index',$param)}";
+    layui.use(['laypage', 'layer'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer;
+
+        laypage.render({
+            elem: 'pages'
+            ,count: {$total}
+            ,limit: {$limit}
+            ,curr: {$page}
+            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
+            ,jump: function(obj,first){
+                if(!first){
+                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
+                }
+            }
+        });
+    });
+</script>
+</body>
+</html>

+ 10 - 0
application/admin/view/cj/col_content.html

@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>Title</title>
+</head>
+<body>
+
+</body>
+</html>

+ 43 - 0
application/admin/view/cj/col_url.html

@@ -0,0 +1,43 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <fieldset class="layui-elem-field">
+        <legend>采集信息</legend>
+        <div class="layui-field-box">
+            {$url_list} <br>总共:{$total} 条,重复记录:{$re}条,去重共入库{$total-$re}条。
+        </div>
+    </fieldset>
+
+    <table class="layui-table" lay-size="sm">
+    <thead>
+      <tr>
+        <th width="50">序号</th>
+		<th>链接</th>
+        <th>标题</th>
+      </tr> 
+    </thead>
+    <tbody>
+		{foreach name="url" item="v"}
+		  <tr>
+			  <td>{$n=$n+1}</td>
+			  <td>{$v.url}</td>
+			  <td>{$v.title}</td>
+		  </tr>
+	  {/foreach}
+    </tbody>
+  </table>
+</div>
+<script>
+var total_page = {$total_page};
+var page = {$param['page']};
+var id = {$param['id']};
+if (total_page > page) {
+    var url = "{:url('cj/col_url_list')}";
+	page += 1;
+    //location.href= url + '?page='+page+'&id='+id;
+} else {
+	//alert('采集完成');
+}
+</script>
+</body>
+</html>

+ 79 - 0
application/admin/view/cj/index.html

@@ -0,0 +1,79 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box" >
+        <div class="layui-btn-group">
+            <a data-href="{:url('info')}" data-full="1" class="layui-btn layui-btn-primary j-iframe" data-width="600px" data-height="400px"><i class="layui-icon">&#xe654;</i>添加</a>
+            <a data-href="{:url('import')}" class="layui-btn layui-btn-primary layui-upload" ><i class="layui-icon">&#xe654;</i>导入</a>
+        </div>
+    </div>
+
+    <form method="post" id="pageListForm">
+        <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th width="50">编号</th>
+                <th >名称</th>
+                <th width="120">最后采集时间</th>
+                <th width="250">内容操作</th>
+                <th width="250">操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" value="{$vo.nodeid}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                <td>{$vo.nodeid}</td>
+                <td>{$vo.name}</td>
+                <td>{$vo.lastdate|mac_day}</td>
+                <td>
+                    <a class="layui-btn layui-btn-primary layui-btn-xs j-iframe" data-href="{:url('col_url')}?id={$vo.nodeid}">采集网址</a>
+                    <a class="layui-btn layui-btn-primary layui-btn-xs j-iframe" data-href="{:url('col_content')}?id={$vo.nodeid}">采集内容</a>
+                    <a class="layui-btn layui-btn-primary layui-btn-xs j-iframe" data-href="{:url('publish')}?id={$vo.nodeid}&status=2">内容发布</a>
+                </td>
+                <td>
+                    <a class="layui-btn layui-btn-primary layui-btn-xs j-iframe" data-full="1" data-href="{:url('info')}?id={$vo.nodeid}" title="编辑">编辑</a>
+                    <a class="layui-btn layui-btn-primary layui-btn-xs j-iframe" data-href="{:url('program')}?id={$vo.nodeid}" title="发布方案">发布方案</a>
+                    <a class="layui-btn layui-btn-primary layui-btn-xs" href="{:url('export')}?id={$vo.nodeid}" title="导出">导出</a>
+                    <a class="layui-btn layui-btn-primary layui-btn-xs j-tr-del" href="{:url('del')}?ids={$vo.nodeid}" title="删除">删除</a>
+                </td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+        <div id="pages" class="center"></div>
+    </form>
+
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+<!-- 注意:如果你直接复制所有代码到本地,上述js路径需要改成你本地的 -->
+<script>
+    layui.use(['form','laypage', 'layer','upload'], function() {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery
+                , upload = layui.upload;
+
+        upload.render({
+            elem: '.layui-upload'
+            ,url: "{:url('cj/import')}"
+            ,method: 'post'
+            ,exts:'txt'
+            ,before: function(input) {
+                layer.msg('文件上传中...', {time:3000000});
+            },done: function(res, index, upload) {
+                var obj = this.item;
+                if (res.code == 0) {
+                    layer.msg(res.msg);
+                    return false;
+                }
+                location.reload();
+            }
+        });
+
+    });
+</script>
+</body>
+</html>

+ 415 - 0
application/admin/view/cj/info.html

@@ -0,0 +1,415 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container">
+    <div class="layui-tab layui-tab-brief">
+        <!--添加采集点 start-->
+        <div class="layui-tab-content">
+            <form class="layui-form" name="myform" method="post" id="myform">
+                <input type="hidden" name="data[nodeid]" value="{$data.nodeid}">
+                <div class="layui-tab layui-tab-card" style="min-height: 430px;">
+                    <ul class="layui-tab-title">
+                        <li class="layui-this">网址规则</li>
+                        <li>内容规则</li>
+                        <li>自定义规则</li>
+                        <li>高级配置</li>
+                    </ul>
+                    <div class="layui-tab-content">
+                        <!--网址规则 start-->
+                        <div class="layui-tab-item layui-show">
+                            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
+                                <legend>基本信息</legend>
+                            </fieldset>
+                            <div class="layui-form-item">
+                                <label class="layui-form-label">规则名称:</label>
+                                <div class="layui-input-block" style="width: 60%">
+                                    <input type="text" name="data[name]" placeholder="请输入" value="{$data.name}" class="layui-input">
+                                </div>
+                            </div>
+                            <div class="layui-form-item">
+                                <label class="layui-form-label">目标编码:</label>
+                                <div class="layui-input-block">
+                                    <input type="radio" name="data[sourcecharset]" value="GBK" title="GBK" {if condition="$data['sourcecharset'] eq 'GBK'"}checked='checked'{/if}>
+                                    <input type="radio" name="data[sourcecharset]" value="UTF-8" title="UTF-8" {if condition="$data['sourcecharset'] eq 'UTF-8'"}checked='checked'{/if}>
+                                    <input type="radio" name="data[sourcecharset]" value="BIG5" title="BIG5" {if condition="$data['sourcecharset'] eq 'BIG5'"}checked='checked'{/if}>
+                                </div>
+                            </div>
+                            <div class="layui-form-item">
+                                <label class="layui-form-label">采集模块:</label>
+                                <div class="layui-input-block">
+                                    <input type="radio" name="data[mid]" value="1" title="视频" {if condition="$data['mid'] neq '2'"}checked='checked'{/if}>
+                                    <input type="radio" name="data[mid]" value="2" title="文章" {if condition="$data['mid'] eq '2'"}checked='checked'{/if}>
+                                </div>
+                            </div>
+
+                            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
+                                <legend>网址采集</legend>
+                            </fieldset>
+                            <div class="layui-form-item">
+                                <label class="layui-form-label">网址类型:</label>
+                                <div class="layui-input-block">
+                                    <input type="radio" name="data[sourcetype]" id="_1" value="1" lay-filter="sourcetype" title="序列网址" {if condition="$data['sourcetype'] eq 1"}checked='checked'{/if}>
+                                    <input type="radio" name="data[sourcetype]" id="_2" value="2" lay-filter="sourcetype" title="多个网页" {if condition="$data['sourcetype'] eq 2"}checked='checked'{/if}>
+                                    <input type="radio" name="data[sourcetype]" id="_3" value="3" lay-filter="sourcetype" title="单一网页" {if condition="$data['sourcetype'] eq 3"}checked='checked'{/if}>
+                                </div>
+                            </div>
+                            <div id="url_type_1" {if condition="$data['sourcetype'] neq 1"}style="display:none"{/if}>
+                                <div class="layui-form-item">
+                                    <label class="layui-form-label">采集网址:</label>
+                                    <div class="layui-input-inline" style="width: 60%;">
+                                        <input type="text" name="urlpage1" id="urlpage_1" placeholder="http://..." value="{$data.urlpage}" class="layui-input">
+                                        <div class="layui-form-mid layui-word-aux">
+                                            (如:http://www.phpcms.cn/help/rumen/(*).html,页码使用(*)做为通配符。
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="layui-form-item">
+                                    <label class="layui-form-label">页码配置:</label>
+                                    <div class="layui-form-mid">从</div>
+                                    <div class="layui-input-inline" style="width: 60px;">
+                                        <input type="text" name="data[pagesize_start]" value="{$data.pagesize_start}" class="layui-input">
+                                    </div>
+                                    <div class="layui-form-mid"> 至</div>
+                                    <div class="layui-input-inline" style="width: 60px;">
+                                        <input type="text" name="data[pagesize_end]" value="{$data.pagesize_end}" class="layui-input">
+                                    </div>
+                                    <div class="layui-form-mid">页,每次增加</div>
+                                    <div class="layui-input-inline" style="width: 60px;">
+                                        <input type="text" name="data[par_num]" value="{$data.par_num}" class="layui-input">
+                                    </div>
+                                    <div class="layui-input-inline" style="width:10%;">
+                                        <a class="layui-btn" onclick="testUrl();" href="javascript:;">测试</a>
+                                    </div>
+                                </div>
+                            </div>
+                            <!--多个网址-->
+                            <div id="url_type_2" class="layui-form-item" {if condition="$data['sourcetype'] neq 2"}style="display:none"{/if}>
+                                <label class="layui-form-label">采集网址:</label>
+                                <div class="layui-input-inline" style="width: 60%;">
+                                    <textarea class="layui-textarea" name="urlpage2" id="urlpage_2">{$data.urlpage}</textarea>
+                                    <div class="layui-form-mid layui-word-aux">
+                                        每行一条
+                                    </div>
+                                </div>
+                            </div>
+                            <!--单一网址-->
+                            <div id="url_type_3" class="layui-form-item" {if condition="$data['sourcetype'] neq 3"}style="display:none"{/if}>
+                                <label class="layui-form-label">采集网址:</label>
+                                <div class="layui-input-inline" style="width: 60%;">
+                                    <input type="text" name="urlpage3" id="urlpage_3" placeholder="http://..." value="{$data.urlpage}" class="layui-input">
+                                </div>
+                            </div>
+
+                            <div class="layui-form-item">
+                                <label class="layui-form-label">网址配置:</label>
+                                <div class="layui-form-mid">网址中必须包含</div>
+                                <div class="layui-input-inline" style="width: 160px;">
+                                    <input type="text" name="data[url_contain]" value="{$data.url_contain}" class="layui-input">
+                                </div>
+                                <div class="layui-form-mid"> 网址中不得包含</div>
+                                <div class="layui-input-inline" style="width: 160px;">
+                                    <input type="text" name="data[url_except]" value="{$data.url_except}" class="layui-input">
+                                </div>
+                            </div>
+                            <div class="layui-form-item">
+                                <label class="layui-form-label">采集区间:</label>
+                                <div class="layui-input-inline">
+                                    <textarea name="data[url_start]" class="layui-textarea">{$data.url_start}</textarea>
+                                </div>
+                                <div class="layui-form-mid">到</div>
+                                <div class="layui-input-inline">
+                                    <textarea name="data[url_end]" class="layui-textarea">{$data.url_end}</textarea>
+                                </div>
+                            </div>
+                        </div>
+
+                        <!--网址规则 end-->
+                            <!--内容规则 start-->
+                        <div class="layui-tab-item">
+                            <blockquote class="layui-elem-quote layui-text" style="margin:20px 0;border-left-color: #ff5722;">
+                                    <p>1、匹配规则请设置开始和结束符,具体内容使用“[内容]”做为通配符 。</p>
+                                    <p>2、匹配规则也可以是固定内容,只要不出现“[内容]”通配符就视为固定内容。</p>
+                                    <p>3、过滤选项格式为“要过滤的内容[|]替换值”,要过滤的内容支持正则表达式,每行一条。</p>
+                            </blockquote>
+                            <div class="layui-btn-group">
+                                    <a class="layui-btn" href="javascript:void(0);" onclick="showAll(this);">全部展开</a>
+                                    <a class="layui-btn" href="javascript:void(0);" onclick="hideAll(this);">全部合上</a>
+                            </div>
+                            <div class="layui-collapse" lay-filter="lay_state" style="margin: 20px 0;">
+                                    <div class="layui-colla-item">
+                                        <h2 class="layui-colla-title">标题规则</h2>
+                                        <div class="layui-colla-content layui-show">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">匹配规则:</label>
+                                                <div class="layui-input-inline w300">
+                                                    <textarea name="data[title_rule]" id="title_rule" class="layui-textarea">{$data.title_rule}</textarea>
+                                                    <div class="layui-form-mid layui-word-aux">
+                                                        使用"<a href="javascript:insertText('title_rule', '[内容]')"> [内容] </a>"作为通配符
+                                                    </div>
+                                                </div>
+                                                <div class="layui-form-mid">过滤规则:</div>
+                                                <div class="layui-input-inline w300">
+                                                    <textarea name="data[title_html_rule]" id="title_html_rule" class="layui-textarea">{$data.title_html_rule}</textarea>
+                                                    <div class="layui-form-mid layui-word-aux">
+                                                        <input type="button" value="选择" class="layui-btn layui-btn-xs" onclick="add_tag('title_html_rule')">
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+
+                                <div class="layui-colla-item">
+                                    <h2 class="layui-colla-title">分类规则</h2>
+                                    <div class="layui-colla-content layui-show">
+                                        <div class="layui-form-item">
+                                            <label class="layui-form-label">匹配规则:</label>
+                                            <div class="layui-input-inline w300">
+                                                <textarea name="data[type_rule]" id="type_rule" class="layui-textarea">{$data.type_rule}</textarea>
+                                                <div class="layui-form-mid layui-word-aux">
+                                                    使用"<a href="javascript:insertText('content_rule', '[内容]')"> [内容] </a>"作为通配符
+                                                </div>
+                                            </div>
+                                            <div class="layui-form-mid">过滤规则:</div>
+                                            <div class="layui-input-inline w300">
+                                                <textarea name="data[type_html_rule]" id="type_html_rule" class="layui-textarea">{$data.type_html_rule}</textarea>
+                                                <div class="layui-form-mid layui-word-aux">
+                                                    <input type="button" value="选择" class="layui-btn layui-btn-xs" onclick="add_tag('type_html_rule')">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+
+                                    <div class="layui-colla-item">
+                                        <h2 class="layui-colla-title">内容规则</h2>
+                                        <div class="layui-colla-content layui-show">
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">匹配规则:</label>
+                                                <div class="layui-input-inline w300">
+                                                    <textarea name="data[content_rule]" id="content_rule" class="layui-textarea">{$data.content_rule}</textarea>
+                                                    <div class="layui-form-mid layui-word-aux">
+                                                        使用"<a href="javascript:insertText('content_rule', '[内容]')"> [内容] </a>"作为通配符
+                                                    </div>
+                                                </div>
+                                                <div class="layui-form-mid">过滤规则:</div>
+                                                <div class="layui-input-inline w300">
+                                                    <textarea name="data[content_html_rule]" id="content_html_rule" class="layui-textarea">{$data.content_html_rule}</textarea>
+                                                    <div class="layui-form-mid layui-word-aux">
+                                                        <input type="button" value="选择" class="layui-btn layui-btn-xs" onclick="add_tag('content_html_rule')">
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+
+                                    <div class="layui-colla-item">
+                                        <h2 class="layui-colla-title">分页模式</h2>
+                                        <div class="layui-colla-content layui-show">
+                                            <div class="layui-form-item">
+                                                <input type="radio" name="data[content_page_rule]" id="_1" value="1" title="全部列出模式" lay-filter="content_page_rule" {if condition="$data['content_page_rule'] neq 2"}checked="checked"{/if}>
+                                                <input type="radio" name="data[content_page_rule]" id="_2" value="2" title="上下页模式" lay-filter="content_page_rule" {if condition="$data['content_page_rule'] eq 2"}checked="checked"{/if}>
+                                            </div>
+
+                                            <div class="layui-form-item" id="nextpage" {if condition="$data['content_page_rule'] neq '2'"}style="display:none"{/if}>
+                                                <label class="layui-form-label">下一页规则:</label>
+                                                <div class="layui-input-inline w600">
+                                                    <input type="text" name="data[content_nextpage]" class="layui-input" value="{$data.content_nextpage}">
+                                                    <div class="layui-form-mid layui-word-aux">请填写下一页超链接中间的代码。如:<a href="http://www.xxx.com/page_1.html">下一页</a>,他的“下一页规则”为“下一页”。</div>
+                                                </div>
+                                            </div>
+                                            <div class="layui-form-item">
+                                                <label class="layui-form-label">匹配规则:</label>
+                                                从 <textarea rows="5" cols="40" name="data[content_page_start]" id="content_page_start">{$data.content_page_start}</textarea> 到 <textarea rows="5" cols="40" name="data[content_page_end]" id="content_page_end">{$data.content_page_end}</textarea>
+                                            </div>
+                                        </div>
+                                    </div>
+                            </div>
+                        </div>
+
+
+                        <!--内容规则 end-->
+                        <!--自定义规则 start-->
+                        <div class="layui-tab-item" id="customize_config">
+
+                            <div class="layui-form-item">
+                                <div class="layui-input-block">
+                                    <a class="layui-btn layui-btn-sm layui-btn-normal" href="javascript:;" onclick="add_caiji()">添加一组</a>
+                                </div>
+                            </div>
+
+                            {volist name="$data.customize_config" id="vo"}
+                            <div class="layui-form-item mt10"><label class="layui-form-label">规则名称:</label><div class="layui-input-inline"><input type="text" name="data[customize_config][name][]" placeholder="请输入" value="{$vo.name}" class="layui-input"></div><div class="layui-form-mid">规则英文名:</div><div class="layui-input-inline"><input type="text" name="data[customize_config][en_name][]" placeholder="请输入" value="{$vo.en_name}" class="layui-input"></div></div><div class="layui-form-item"><label class="layui-form-label">匹配规则:</label><div class="layui-input-inline"><textarea name="data[customize_config][rule][]" id="role_'+caiji+'" class="layui-textarea">{$vo.rule}</textarea><div class="layui-form-mid layui-word-aux">使用"<a href="javascript:insertText(\'title_rule\', \'[内容]\')"> [内容] </a>"作为通配符    </div></div><div class="layui-form-mid">过滤规则:</div><div class="layui-input-inline"><textarea name="data[customize_config][html_rule][]" id="content_html_rule_'+caiji+'" class="layui-textarea">{$vo.html_rule}</textarea><div class="layui-form-mid layui-word-aux"><a class="layui-btn layui-btn-xs" href="javascript:;" onclick="add_tag(\'content_html_rule_'+caiji+'\')">选择</a></div></div></div><hr>
+                            {/volist}
+
+                        </div>
+                        <!--自定义规则 end-->
+                        <!--高级配置 start-->
+                        <div class="layui-tab-item">
+
+                            <div class="layui-form-item">
+                                <label class="layui-form-label">内容分页:</label>
+                                <div class="layui-input-block">
+                                    <input type="radio" name="data[content_page]" value="0" title="不分页">
+                                    <div class="layui-unselect layui-form-radio layui-form-radioed">
+                                        <i class="layui-anim layui-icon"></i>
+                                        <div>不分页</div>
+                                    </div>
+                                    <input type="radio" name="data[content_page]" value="1" title="按原文分页" checked>
+                                    <div class="layui-unselect layui-form-radio layui-form-radioed">
+                                        <i class="layui-anim layui-icon"></i>
+                                        <div>按原文分页</div>
+                                    </div>
+                                </div>
+                            </div>
+                            <hr>
+                            <div class="layui-form-item">
+                                <label class="layui-form-label">导入顺序:</label>
+                                <div class="layui-input-block">
+                                    <input type="radio" name="data[coll_order]" value="1" title="与目标站相同">
+                                    <div class="layui-unselect layui-form-radio layui-form-radioed">
+                                        <i class="layui-anim layui-icon"></i>
+                                        <div>与目标站相同</div>
+                                    </div>
+                                    <input type="radio" name="data[coll_order]" value="2" title="与目标站相反" checked>
+                                    <div class="layui-unselect layui-form-radio layui-form-radioed">
+                                        <i class="layui-anim layui-icon"></i>
+                                        <div>与目标站相反</div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                        <!--高级配置 end-->
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <div class="layui-input-block w150" style="margin:20px auto;">
+                        <button type="submit" name="dosubmit" id="dosubmit" class="layui-btn layui-btn-fluid">保存
+                        </button>
+                    </div>
+                </div>
+            </form>
+        </div>
+        <!--添加采集点 end-->
+    </div>
+</div>
+<style>
+    .ib{display: inline-block;}
+</style>
+<div id="html_rule_show" class="aui_content" style="display:none; padding: 20px 25px;">
+    <label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_1" value="<p([^>]*)>(.*)</p>[|]"> &lt;p&gt;</label><label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_2" value="<a([^>]*)>(.*)</a>[|]"> &lt;a&gt;</label><label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_3" value="<script([^>]*)>(.*)</script>[|]"> &lt;script&gt;</label><label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_4" value="<iframe([^>]*)>(.*)</iframe>[|]"> &lt;iframe&gt;</label><label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_5" value="<table([^>]*)>(.*)</table>[|]"> &lt;table&gt;</label><label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_6" value="<span([^>]*)>(.*)</span>[|]"> &lt;span&gt;</label><label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_7" value="<b([^>]*)>(.*)</b>[|]"> &lt;b&gt;</label><label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_8" value="<img([^>]*)>[|]"> &lt;img&gt;</label><label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_9" value="<object([^>]*)>(.*)</object>[|]"> &lt;object&gt;</label><label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_10" value="<embed([^>]*)>(.*)</embed>[|]"> &lt;embed&gt;</label><label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_11" value="<param([^>]*)>(.*)</param>[|]"> &lt;param&gt;</label><label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_12" value="<div([^>]*)>[|]"> &lt;div&gt;</label><label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_13" value="</div>[|]"> &lt;/div&gt;</label><label class="ib" style="width:120px"><input type="checkbox" name="html_rule" id="_14" value="<!--([^>]*)-->[|]"> &lt;!-- --&gt;</label><br><div class="bk15"></div>
+    <center><input type="button" value="全选" class="button" onclick="selectall('html_rule')"> <input type="button" class="button" value="反选" onclick="anti_selectall('html_rule')"></center>
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+<script type="text/javascript">
+    layui.use(['element','form','upload','layer'],function () {
+        // 操作对象
+        var element = layui.element;
+        form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery
+                , upload = layui.upload;
+
+        form.on('radio(sourcetype)',function (data) {
+            var num = 4;
+            for (var i=1; i<=num; i++){
+                if (data.value==i){
+                    $('#url_type_'+i).show();
+                } else {
+                    $('#url_type_'+i).hide();
+                }
+            }
+        });
+        form.on('radio(content_page_rule)',function (data) {
+            $('#nextpage').hide();
+            if(data.value==2){
+                $('#nextpage').show();
+            }
+        });
+
+
+
+        //监听折叠
+        element.on('collapse(lay_state)', function(data){
+            //layer.msg('展开状态:'+ data.show);
+        });
+    });
+
+    function selectall(obj) {
+        $("input[name='"+obj+"']").each(function(i,n){
+            this.checked = true;
+        });
+    }
+    function anti_selectall(obj) {
+        $("input[name='"+obj+"']").each(function(i,n){
+            if (this.checked) {
+                this.checked = false;
+            } else {
+                this.checked = true;
+            }});
+    }
+    //折叠面板
+    function showAll(_this) {
+        $(_this).parents(".layui-btn-group").siblings(".layui-collapse").children(".layui-colla-item").children(".layui-colla-content").addClass("layui-show");
+    }
+    function hideAll(_this) {
+        $(_this).parents(".layui-btn-group").siblings(".layui-collapse").children(".layui-colla-item").children(".layui-colla-content").removeClass("layui-show");
+    }
+
+    //  包含内容
+    function insertText(id, text) {
+        $('#' + id).focus();
+        var str = document.selection.createRange();
+        str.text = text;
+    }
+
+    function add_tag(id) {
+        var index = layer.open({
+            type: 1
+            ,title: '过滤规则' //不显示标题栏
+            ,closeBtn: 1
+            ,area: '600px;'
+            ,shade: 0.8
+            ,id: 'LAY_layuipro' //设定一个id,防止重复弹出
+            ,btn: ['添加', '取消']
+            ,btnAlign: 'c'
+            ,moveType: 1 //拖拽模式,0或者1
+            ,content: $('#html_rule_show')
+            ,yes: function(layero){
+                var str = '';
+                $("input[name='html_rule']:checked").each(function(){
+                    str+=$(this).val()+"\n";
+                });
+                alert(str);
+                $("#"+id).val(str);
+                layer.close(index);
+            }
+        });
+    }
+
+    var caiji=0;
+    function add_caiji()
+    {
+        $('#customize_config').append('<div class="layui-form-item mt10"><label class="layui-form-label">规则名称:</label><div class="layui-input-inline"><input type="text" name="data[customize_config][name][]" placeholder="请输入" value="" class="layui-input"></div><div class="layui-form-mid">规则英文名:</div><div class="layui-input-inline"><input type="text" name="data[customize_config][en_name][]" placeholder="请输入" value="" class="layui-input"></div></div><div class="layui-form-item"><label class="layui-form-label">匹配规则:</label><div class="layui-input-inline"><textarea name="data[customize_config][rule][]" id="role_'+caiji+'" class="layui-textarea"></textarea><div class="layui-form-mid layui-word-aux">使用"<a href="javascript:insertText(\'title_rule\', \'[内容]\')"> [内容] </a>"作为通配符    </div></div><div class="layui-form-mid">过滤规则:</div><div class="layui-input-inline"><textarea name="data[customize_config][html_rule][]" id="content_html_rule_'+caiji+'" class="layui-textarea"></textarea><div class="layui-form-mid layui-word-aux"><a class="layui-btn layui-btn-xs" href="javascript:;" onclick="add_tag(\'content_html_rule_'+caiji+'\')">选择</a></div></div></div><hr>');
+        caiji++;
+    }
+
+    function testUrl() {
+        var data = $('#myform').serialize();
+
+        layer.open({
+            type: 2
+            ,title: '测试序列网址'
+            ,closeBtn: 1
+            ,area: ['500px;','400px']
+            ,shade: 0.8
+            ,id: 'LAY_testUrl' //设定一个id,防止重复弹出
+            ,btn: ['关闭']
+            ,btnAlign: 'c'
+            ,moveType: 1 //拖拽模式,0或者1
+            ,content: '{:url('show_url')}?call=1&' +data
+        });
+    }
+
+
+</script>
+</body>
+</html>

+ 49 - 0
application/admin/view/cj/program.html

@@ -0,0 +1,49 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+    <form class="layui-form layui-form-pane" action="">
+        <input type="hidden" name="id" value="{$param.id}">
+        <fieldset class="layui-elem-field">
+            <legend>标签与数据库对应关系</legend>
+        </fieldset>
+
+                    <table class="layui-table" lay-size="sm" style="width:600px;">
+                        <thead>
+                        <tr>
+                            <th width="100">数据库字段</th>
+                            <th width="100">标签字段</th>
+                            <th width="100">处理函数</th>
+                        </tr>
+                        </thead>
+
+                        {volist name="column_list" id="vo"}
+                        <tr>
+                            <td><input type="hidden" name="model_field[]" value="{$vo.Field}">{$vo.Field}</td>
+                            <td><select name="node_field[]">
+                                <option value="">请选择</option>
+                                {volist name="node_field" id="vo2" key="key2"}
+                                <option value="{$key}" {if condition="$program_config['map'][$vo.Field] eq $key"}selected{/if}>{$vo2}</option>
+                                {/volist}
+                            </select>
+                            </td>
+                            <td><select name="funcs[]"><option value="" >请选择</option><option value="trim" {if condition="$program_config['funcs'][$vo.Field] eq 'trim'"}selected{/if}>去空格</option></select></td>
+                        </tr>
+                        {/volist}
+                        </tbody>
+                    </table>
+
+        <div class="layui-form-item center">
+            <div class="layui-input-block">
+                <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit" data-child="true">保 存</button>
+                <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
+            </div>
+        </div>
+    </form>
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+<script type="text/javascript">
+
+</script>
+
+</body>
+</html>

+ 83 - 0
application/admin/view/cj/publish.html

@@ -0,0 +1,83 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container">
+    <form class="layui-form layui-form-pane" action="">
+        <div class="layui-tab">
+            <ul class="layui-tab-title">
+                <li {if condition="$param.status eq ''"}class="layui-this"{/if}><a href="{:url('cj/publish')}?id={$param.id}">全部</a></li>
+                <li {if condition="$param.status eq '1'"}class="layui-this"{/if}><a href="{:url('cj/publish')}?id={$param.id}&status=1">未采集</a></li>
+                <li {if condition="$param.status eq '2'"}class="layui-this"{/if}><a href="{:url('cj/publish')}?id={$param.id}&status=2">已采集</a></li>
+                <li {if condition="$param.status eq '3'"}class="layui-this"{/if}><a href="{:url('cj/publish')}?id={$param.id}&status=3">已发布</a></li>
+            </ul>
+
+            <div class="layui-tab-content">
+                <div class="layui-tab-item layui-show">
+
+                    <div class="layui-btn-group">
+                        <a data-href="{:url('content_del')}" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe640;</i>删除</a>
+                        <a data-href="{:url('content_del')}?ids=1&all=1" class="layui-btn layui-btn-primary j-ajax" confirm="确认清空数据吗?操作不可恢复"><i class="layui-icon">&#xe640;</i>清空</a>
+
+                        <a data-href="{:url('content_into')}?id={$param.id}" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe654;</i>导入</a>
+                        <a data-href="{:url('content_into')}?id={$param.id}&all=1" data-ajax="no" data-checkbox="no" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe654;</i>全部导入</a>
+                    </div>
+
+                    <table class="layui-table" lay-size="sm">
+                        <thead>
+                        <tr>
+                            <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                            <th width="50">编号</th>
+                            <th width="50">状态</th>
+                            <th width="250">标题</th>
+                            <th >网址</th>
+                            <th width="40">操作</th>
+                        </tr>
+                        </thead>
+
+                        {volist name="list" id="vo"}
+                        <tr>
+                            <td><input type="checkbox" name="ids[]" value="{$vo.id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                            <td>{$vo.id}</td>
+                            <td>{if condition="$vo.status eq '1'"}未采集{elseif condition="$vo.status eq '2'"}已采集{else/}已发布{/if}</td>
+                            <td>{$vo.title}</td>
+                            <td>{$vo.url}</td>
+                            <td>
+                                <a class="layui-badge-rim " data-href="{:url('show?ids='.$vo['id'])}" href="javascript:;" title="查看">查看</a>
+                            </td>
+                        </tr>
+                        {/volist}
+                        </tbody>
+                    </table>
+
+                    <div id="pages" class="center"></div>
+
+                </div>
+
+            </div>
+        </div>
+
+    </form>
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+<script type="text/javascript">
+    var curUrl="{:url('cj/publish',$param)}";
+    layui.use(['laypage', 'layer'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer;
+
+        laypage.render({
+            elem: 'pages'
+            ,count: {$total}
+            ,limit: {$limit}
+            ,curr: {$page}
+            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
+            ,jump: function(obj,first){
+                if(!first){
+                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
+                }
+            }
+        });
+    });
+</script>
+
+</body>
+</html>

+ 29 - 0
application/admin/view/cj/show_url.html

@@ -0,0 +1,29 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+    <fieldset class="layui-elem-field">
+        <legend>网址列表</legend>
+        <div class="layui-field-box">
+            {volist name="urls" id="vo"}
+            <p>{$vo}</p>
+            <hr>
+            {/volist}
+        </div>
+    </fieldset>
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    layui.use(['form', 'layer'], function () {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery;
+
+
+
+    });
+
+</script>
+
+</body>
+</html>

+ 122 - 0
application/admin/view/collect/actor.html

@@ -0,0 +1,122 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box">
+
+        <div class="mb10">
+            <div class="layui-input-inline w150 m5"><a href="javascript:;" data-id="" class="select_type red">查看全部资源</a></div>
+            {volist name="type" id="vo"}
+            <div class="layui-input-inline w150 m5">
+                <a href="javascript:;" data-id="{$vo.type_id}" class="select_type">{$vo.type_name|htmlspecialchars}</a>
+                <a id="{$param['cjflag']}_{$vo.type_id}" data-href="{:url('index/select')}?tab=actor&col={$param['cjflag']}_{$vo.type_id}&ids=1&tpl=select_type&refresh=no&url=collect/bind" data-width="270" data-height="100" class="j-select" >
+                    {if condition="$vo.isbind eq 1"}
+                    <span class="red">[{$vo.local_type_name}]</span>
+                    {else}
+                    [绑定]
+                    {/if}
+                </a>
+            </div>
+            {/volist}
+
+        </div>
+
+        <div class="center mb10">
+            <form class="layui-form " method="">
+                <div class="layui-input-inline">
+                    <input type="text" autocomplete="off" placeholder="请输入搜索条件" class="layui-input" name="wd" value="{$param['wd']}">
+                </div>
+                <button type="button" class="layui-btn mgl-20 j-btn" >查询</button>
+            </form>
+        </div>
+
+    </div>
+
+
+    <form class="layui-form " method="post" id="pageListForm">
+        <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th >名称</th>
+                <th width="60">分类</th>
+                <th width="60">性别</th>
+                <th width="140">时间</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" value="{$vo.actor_id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                <td>{$vo.actor_name|htmlspecialchars}</td>
+                <td>{$vo.type_name|htmlspecialchars}</td>
+                <td>{$vo.actor_sex|htmlspecialchars}</td>
+                <td>{$vo.actor_time|mac_day=color}</td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+        <div class="layui-btn-group">
+            {php}
+                $p1 = $param;
+                unset($p1['ac']);
+                $p1_str = http_build_query($p1);
+            {/php}
+            <a data-href="{:url('api')}?{$p1_str}&ac=cjsel" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采选中</a>
+            <a data-href="{:url('api')}?{$p1_str}&h=24&ac=cjday" data-checkbox="no" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采当天</a>
+            <a data-href="{:url('api')}?{$p1_str}&ac=cjall" data-checkbox="no" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采全部</a>
+        </div>
+
+        <div id="pages" class="center"></div>
+    </form>
+
+</div>
+
+
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    var curUrl="{:url('api')}?{$param_str}";
+    layui.use(['laypage', 'layer','form'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer,
+                form = layui.form;
+
+        laypage.render({
+            elem: 'pages'
+            ,count: {$total}
+            ,limit: {$limit}
+            ,curr: {$page}
+            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
+            ,jump: function(obj,first){
+                if(!first){
+                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
+                }
+            }
+        });
+
+
+        $('.j-btn').click(function(){
+           var wd = $('input[name="wd"]').val();
+            var url = changeParam(curUrl,'wd',wd);
+            location.href = url.replace('%7Bpage%7D',1).replace('%7Blimit%7D','');
+        });
+
+        $('.select_type').click(function(){
+            var t = $(this).attr('data-id');
+            var url = changeParam(curUrl,'t',t);
+            location.href = url.replace('%7Bpage%7D',1).replace('%7Blimit%7D','');
+        });
+
+    });
+    function onSubmitResult(res)
+    {
+        if(res.data.st==1){
+            $('#'+res.data.id).html('<span class="red">[解绑]</span>');
+        }
+        else{
+            $('#'+res.data.id).html('[绑定]');
+        }
+    }
+</script>
+</body>
+</html>

+ 128 - 0
application/admin/view/collect/art.html

@@ -0,0 +1,128 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box">
+
+        <div class="mb10">
+            <div class="layui-input-inline w150 m5"><a href="javascript:;" data-id="" class="select_type red">查看全部资源</a></div>
+            {volist name="type" id="vo"}
+            <div class="layui-input-inline w150 m5">
+                <a href="javascript:;" data-id="{$vo.type_id}" class="select_type">{$vo.type_name|htmlspecialchars}</a>
+                <a id="{$param['cjflag']}_{$vo.type_id}" data-href="{:url('index/select')}?tab=art&col={$param['cjflag']}_{$vo.type_id}&ids=1&tpl=select_type&refresh=no&url=collect/bind" data-width="270" data-height="100" class="j-select" >
+                    {if condition="$vo.isbind eq 1"}
+                    <span class="red">[{$vo.local_type_name}]</span>
+                    {else}
+                    [绑定]
+                    {/if}
+                </a>
+            </div>
+            {/volist}
+
+        </div>
+
+        <div class="center mb10">
+            <form class="layui-form " method="">
+                <div class="layui-input-inline">
+                    <input type="text" autocomplete="off" placeholder="请输入搜索条件" class="layui-input" id="wd" name="wd" value="{$param['wd']}">
+                </div>
+                <button type="button" class="layui-btn mgl-20 j-btn" >查询</button>
+            </form>
+        </div>
+
+    </div>
+
+
+    <form class="layui-form " method="post" id="pageListForm">
+        <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th >名称</th>
+                <th width="60">分类</th>
+                <th width="60">来源</th>
+                <th width="140">时间</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" value="{$vo.art_id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                <td>{$vo.art_name|htmlspecialchars}</td>
+                <td>{$vo.type_name|htmlspecialchars}</td>
+                <td>{$vo.art_from|htmlspecialchars}</td>
+                <td>{$vo.art_time|mac_day=color}</td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+        <div class="layui-btn-group">
+            {php}
+                $p1 = $param;
+                unset($p1['ac']);
+                $p1_str = http_build_query($p1);
+            {/php}
+            <a data-href="{:url('api')}?{$p1_str}&ac=cjsel" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采选中</a>
+            <a data-href="{:url('api')}?{$p1_str}&h=24&ac=cjday" data-checkbox="no" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采当天</a>
+            <a data-href="{:url('api')}?{$p1_str}&ac=cjall" data-checkbox="no" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采全部</a>
+        </div>
+
+        <div id="pages" class="center"></div>
+    </form>
+
+</div>
+
+
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    var curUrl="{:url('api')}?{$param_str}";
+    layui.use(['laypage', 'layer','form'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer,
+                form = layui.form;
+
+        laypage.render({
+            elem: 'pages'
+            ,count: {$total}
+            ,limit: {$limit}
+            ,curr: {$page}
+            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
+            ,jump: function(obj,first){
+                if(!first){
+                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
+                }
+            }
+        });
+
+        $('#wd').on('keydown', function (event) {
+            if (event.keyCode == 13) {
+                $('.j-btn').click();
+                return false;
+            }
+        });
+
+        $('.j-btn').click(function(){
+           var wd = $('input[name="wd"]').val();
+            var url = changeParam(curUrl,'wd',wd);
+            location.href = url.replace('%7Bpage%7D',1).replace('%7Blimit%7D','');
+        });
+
+        $('.select_type').click(function(){
+            var t = $(this).attr('data-id');
+            var url = changeParam(curUrl,'t',t);
+            location.href = url.replace('%7Bpage%7D',1).replace('%7Blimit%7D','');
+        });
+
+    });
+    function onSubmitResult(res)
+    {
+        if(res.data.st==1){
+            $('#'+res.data.id).html('<span class="red">['+ res.data.local_type_name +']</span>');
+        }
+        else{
+            $('#'+res.data.id).html('[绑定]');
+        }
+    }
+</script>
+</body>
+</html>

+ 71 - 0
application/admin/view/collect/index.html

@@ -0,0 +1,71 @@
+{include file="../../../application/admin/view/public/head" /}
+
+<div class="page-container p10">
+
+    <div class="my-toolbar-box">
+
+        <div class="layui-btn-group">
+            <a data-href="{:url('info')}" class="layui-btn layui-btn-primary j-iframe" data-width="800px" data-height="610px"><i class="layui-icon">&#xe654;</i>添加</a>
+            <a data-href="{:url('del')}" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe640;</i>删除</a>
+            <a data-href="{:url('clearbind')}" class="layui-btn layui-btn-primary j-page-btns confirm" data-checkbox="false" data-ajax="yes"><i class="layui-icon">&#xe640;</i>清空绑定分类</a>
+
+                {if condition="$collect_break_vod neq ''"}
+                <a href="{:url('load')}?flag=vod" class="layui-btn layui-btn-danger ">【进入视频断点采集】</a>
+                {/if}
+                {if condition="$collect_break_art neq ''"}
+                <a href="{:url('load')}?flag=art" class="layui-btn layui-btn-danger ">【进入文章断点采集】</a>
+                {/if}
+
+        </div>
+
+    </div>
+
+    <form class="layui-form " method="post" id="pageListForm">
+        <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th width="100">编号</th>
+                <th width="100">接口类型</th>
+                <th width="100">资源类型</th>
+                <th>资源站</th>
+                <th width="200">采集选项</th>
+                <th width="100">操作</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" value="{$vo.collect_id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                <td>{$vo.collect_id}</td>
+                <td>{if condition="$vo['collect_type'] eq 1"}xml{else/}json{/if} </td>
+                <td>{$vo.collect_mid|mac_get_mid_text}</td>
+                <td><a class="layui-badge-rim" href="{:url('api')}?{:http_build_query(['ac'=>'list','cjflag'=>md5($vo.collect_url),'cjurl'=>$vo.collect_url,'h'=>'','t'=>'','ids'=>'','wd'=>'','type'=>$vo.collect_type,'mid'=>$vo.collect_mid,'opt'=>$vo.collect_opt,'filter'=>$vo.collect_filter,'filter_from'=>$vo.collect_filter_from,'param'=>base64_encode($vo.collect_param)])}" title="进入资源库">【{$vo.collect_name}】{$vo.collect_url}</a></td>
+                <td>
+                    <a class="layui-badge-rim" href="{:url('api')}?{:http_build_query(['ac'=>'cj','cjflag'=>md5($vo.collect_url),'cjurl'=>$vo.collect_url,'h'=>'24','t'=>'','ids'=>'','wd'=>'','type'=>$vo.collect_type,'mid'=>$vo.collect_mid,'opt'=>$vo.collect_opt,'filter'=>$vo.collect_filter,'filter_from'=>$vo.collect_filter_from,'param'=>base64_encode($vo.collect_param)])}" title="采集当天">采集当天</a>
+                    <a class="layui-badge-rim" href="{:url('api')}?{:http_build_query(['ac'=>'cj','cjflag'=>md5($vo.collect_url),'cjurl'=>$vo.collect_url,'h'=>'168','t'=>'','ids'=>'','wd'=>'','type'=>$vo.collect_type,'mid'=>$vo.collect_mid,'opt'=>$vo.collect_opt,'filter'=>$vo.collect_filter,'filter_from'=>$vo.collect_filter_from,'param'=>base64_encode($vo.collect_param)])}" title="采集本周">采集本周</a>
+                    <a class="layui-badge-rim" href="{:url('api')}?{:http_build_query(['ac'=>'cj','cjflag'=>md5($vo.collect_url),'cjurl'=>$vo.collect_url,'h'=>'','t'=>'','ids'=>'','wd'=>'','type'=>$vo.collect_type,'mid'=>$vo.collect_mid,'opt'=>$vo.collect_opt,'filter'=>$vo.collect_filter,'filter_from'=>$vo.collect_filter_from,'param'=>base64_encode($vo.collect_param)])}" title="采集所有">采集所有</a>
+                </td>
+                <td>
+                    <a class="layui-badge-rim j-iframe" data-href="{:url('info?id='.$vo['collect_id'])}" data-width="800px" data-height="610px" href="javascript:;" title="编辑">编辑</a>
+                    <a class="layui-badge-rim j-tr-del" data-href="{:url('del?ids='.$vo['collect_id'])}" href="javascript:;" title="删除">删除</a>
+                </td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+        <div id="pages" class="center"></div>
+    </form>
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+<script type="text/javascript">
+    layui.use(['laypage', 'layer'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer;
+
+
+    });
+</script>
+</body>
+</html>

+ 140 - 0
application/admin/view/collect/info.html

@@ -0,0 +1,140 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+    <form class="layui-form layui-form-pane" method="post" action="">
+        <input id="collect_id" name="collect_id" type="hidden" value="{$info.collect_id}">
+        <div class="layui-form-item">
+            <label class="layui-form-label">资源名称:</label>
+            <div class="layui-input-block  ">
+                <input type="text" class="layui-input" value="{$info.collect_name}" placeholder="" id="collect_name" name="collect_name">
+            </div>
+        </div>
+        <div class="layui-form-item">
+            <label class="layui-form-label">接口地址:</label>
+            <div class="layui-input-block">
+                <input type="text" class="layui-input" value="{$info.collect_url}" placeholder="" id="collect_url" name="collect_url">
+            </div>
+        </div>
+        <div class="layui-form-item">
+            <label class="layui-form-label">附加参数:</label>
+            <div class="layui-input-block">
+                <input type="text" class="layui-input" value="{$info.collect_param}" placeholder="" id="collect_param" name="collect_param">
+            </div>
+            <div class="layui-form-mid layui-word-aux" style="margin-left:110px; ">提示信息:一般&开头,例如老版xml格式采集下载地址需加入&ct=1</div>
+        </div>
+        <div class="layui-form-item">
+            <label class="layui-form-label">接口类型:</label>
+            <div class="layui-input-block">
+                <input name="collect_type" type="radio" value="1" title="xml" {if condition="$info['collect_type'] eq 1"}checked {/if}>
+                <input name="collect_type" type="radio" value="2" title="json" {if condition="$info['collect_type'] neq 1"}checked {/if}>
+            </div>
+        </div>
+
+        <div class="layui-form-item">
+            <label class="layui-form-label">资源类型:</label>
+            <div class="layui-input-block">
+                <input name="collect_mid" lay-filter="collect_mid" type="radio" value="1" title="视频" {if condition="$info['collect_mid'] eq 1"}checked {/if}>
+                <input name="collect_mid" lay-filter="collect_mid" type="radio" value="2" title="文章" {if condition="$info['collect_mid'] eq 2"}checked {/if}>
+                <input name="collect_mid" lay-filter="collect_mid" type="radio" value="8" title="演员" {if condition="$info['collect_mid'] eq 8"}checked {/if}>
+                <input name="collect_mid" lay-filter="collect_mid" type="radio" value="9" title="角色" {if condition="$info['collect_mid'] eq 9"}checked {/if}>
+                <input name="collect_mid" lay-filter="collect_mid" type="radio" value="11" title="网址" {if condition="$info['collect_mid'] eq 11"}checked {/if}>
+            </div>
+        </div>
+
+        <div class="layui-form-item">
+            <label class="layui-form-label">数据操作:</label>
+            <div class="layui-input-block">
+                <input name="collect_opt" type="radio" value="0" title="新增+更新" {if condition="$info['collect_opt'] eq 0"}checked {/if}>
+                <input name="collect_opt" type="radio" value="1" title="新增" {if condition="$info['collect_opt'] eq 1"}checked {/if}>
+                <input name="collect_opt" type="radio" value="2" title="更新" {if condition="$info['collect_opt'] eq 2"}checked {/if}>
+            </div>
+            <div class="layui-form-mid layui-word-aux" style="">提示信息:如果某个资源作为副资源不想新增数据,可以只勾选更新。</div>
+        </div>
+
+        <div class="layui-form-item row_filer" {if condition="$info['collect_mid'] neq '1'"} style="display:none;" {/if}>
+            <label class="layui-form-label">地址过滤:</label>
+            <div class="layui-input-block">
+                <input name="collect_filter" type="radio" value="0" title="不过滤" {if condition="$info['collect_filter'] eq 0"}checked {/if}>
+                <input name="collect_filter" type="radio" value="1" title="新增+更新" {if condition="$info['collect_filter'] eq 1"}checked {/if}>
+                <input name="collect_filter" type="radio" value="1" title="新增" {if condition="$info['collect_filter'] eq 2"}checked {/if}>
+                <input name="collect_filter" type="radio" value="2" title="更新" {if condition="$info['collect_filter'] eq 3"}checked {/if}>
+            </div>
+        </div>
+        <div class="layui-form-item row_filer" {if condition="$info['collect_mid'] neq '1'"} style="display:none;" {/if}>
+            <label class="layui-form-label">过滤代码:</label>
+            <div class="layui-input-block">
+                <input type="text" class="layui-input" value="{$info.collect_filter_from}" placeholder="" id="collect_filter_from" name="collect_filter_from">
+            </div>
+            <div class="layui-form-mid layui-word-aux" style="margin-left:110px; ">过滤提示:多组地址的资源开启白名单后只会入库指定代码的地址。比如 youku,iqiyi</div>
+        </div>
+        <div class="layui-form-item center">
+            <div class="layui-input-block">
+                <button class="layui-btn layui-btn-normal" type="button" id="btnTest" >测 试</button>
+                <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit" data-child="true">保 存</button>
+                <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
+            </div>
+        </div>
+    </form>
+
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    layui.use(['form', 'layer'], function () {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery;
+
+        // 验证
+        form.verify({
+            collect_name: function (value) {
+                if (value == "") {
+                    return "请输入资源名称";
+                }
+            },
+            collect_url: function (value) {
+                if (value == "") {
+                    return "请输入接口地址";
+                }
+            }
+        });
+
+
+        $('#btnTest').click(function() {
+            var that = $(this);
+            var data = 'cjurl='+ $('#collect_url').val() + '&cjflag='+ '&ac=list';
+
+            $.post("{:url('test')}",data,function(r){
+                if(r.code==1){
+                    layer.msg('测试类型成功,接口类型:'+ r.msg ,{time:1800});
+                    if(r.msg=='json'){
+                        $("input[name='collect_type'][value=2]").attr("checked",true);
+                    }
+                    else{
+                        $("input[name='collect_type'][value=1]").attr("checked",true);
+                    }
+                    form.render('radio');
+                }
+                else{
+                    layer.msg(r.msg,{time:1800});
+                }
+            });
+
+        });
+
+        form.on('radio(collect_mid)',function(data){
+            $('.row_filer').hide();
+            if(data.value=='1'){
+                $('.row_filer').show();
+            }
+        });
+
+    });
+
+
+
+
+</script>
+
+</body>
+</html>

+ 122 - 0
application/admin/view/collect/role.html

@@ -0,0 +1,122 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box">
+
+        <div class="mb10">
+            <div class="layui-input-inline w150 m5"><a href="javascript:;" data-id="" class="select_type red">查看全部资源</a></div>
+            {volist name="type" id="vo"}
+            <div class="layui-input-inline w150 m5">
+                <a href="javascript:;" data-id="{$vo.type_id}" class="select_type">{$vo.type_name|htmlspecialchars}</a>
+                <a id="{$param['cjflag']}_{$vo.type_id}" data-href="{:url('index/select')}?tab=role&col={$param['cjflag']}_{$vo.type_id}&ids=1&tpl=select_type&refresh=no&url=collect/bind" data-width="270" data-height="100" class="j-select" >
+                    {if condition="$vo.isbind eq 1"}
+                    <span class="red">[{$vo.local_type_name}]</span>
+                    {else}
+                    [绑定]
+                    {/if}
+                </a>
+            </div>
+            {/volist}
+
+        </div>
+
+        <div class="center mb10">
+            <form class="layui-form " method="">
+                <div class="layui-input-inline">
+                    <input type="text" autocomplete="off" placeholder="请输入搜索条件" class="layui-input" name="wd" value="{$param['wd']}">
+                </div>
+                <button type="button" class="layui-btn mgl-20 j-btn" >查询</button>
+            </form>
+        </div>
+
+    </div>
+
+
+    <form class="layui-form " method="post" id="pageListForm">
+        <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th >名称</th>
+                <th width="200">所属视频</th>
+                <th width="100">演员</th>
+                <th width="140">时间</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" value="{$vo.role_id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                <td>{$vo.role_name|htmlspecialchars}</td>
+                <td>{$vo.vod_name|htmlspecialchars}</td>
+                <td>{$vo.role_actor|htmlspecialchars}</td>
+                <td>{$vo.role_time|mac_day=color}</td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+        <div class="layui-btn-group">
+            {php}
+                $p1 = $param;
+                unset($p1['ac']);
+                $p1_str = http_build_query($p1);
+            {/php}
+            <a data-href="{:url('api')}?{$p1_str}&ac=cjsel" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采选中</a>
+            <a data-href="{:url('api')}?{$p1_str}&h=24&ac=cjday" data-checkbox="no" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采当天</a>
+            <a data-href="{:url('api')}?{$p1_str}&ac=cjall" data-checkbox="no" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采全部</a>
+        </div>
+
+        <div id="pages" class="center"></div>
+    </form>
+
+</div>
+
+
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    var curUrl="{:url('api')}?{$param_str}";
+    layui.use(['laypage', 'layer','form'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer,
+                form = layui.form;
+
+        laypage.render({
+            elem: 'pages'
+            ,count: {$total}
+            ,limit: {$limit}
+            ,curr: {$page}
+            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
+            ,jump: function(obj,first){
+                if(!first){
+                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
+                }
+            }
+        });
+
+
+        $('.j-btn').click(function(){
+           var wd = $('input[name="wd"]').val();
+            var url = changeParam(curUrl,'wd',wd);
+            location.href = url.replace('%7Bpage%7D',1).replace('%7Blimit%7D','');
+        });
+
+        $('.select_type').click(function(){
+            var t = $(this).attr('data-id');
+            var url = changeParam(curUrl,'t',t);
+            location.href = url.replace('%7Bpage%7D',1).replace('%7Blimit%7D','');
+        });
+
+    });
+    function onSubmitResult(res)
+    {
+        if(res.data.st==1){
+            $('#'+res.data.id).html('<span class="red">[解绑]</span>');
+        }
+        else{
+            $('#'+res.data.id).html('[绑定]');
+        }
+    }
+</script>
+</body>
+</html>

+ 153 - 0
application/admin/view/collect/timing.html

@@ -0,0 +1,153 @@
+{include file="../../../application/admin/view/public/head" /}
+<script language="javascript">
+    var b=false;
+    var iv_cj,iv_makeinfo,iv_makeindex,iv_maketype;
+    var urln=0,typeids='{$vod_type_ids_today}';
+    var cjUrl = "{:url('collect/apis')}";
+
+    $(function(){
+        $("#btnGO").click(function(){
+            var time = new Array();
+            time['cj'] = Number($("#ds_cj").val());
+            time['makeinfo'] = Number($("#ds_makeinfo").val());
+            time['makeindex'] = Number($("#ds_makeindex").val());
+            time['maketype'] = Number($("#ds_maketype").val());
+            if(time['cj'] > 0){
+                iv_cj = window.setInterval('cj()',1000*60* time['cj']);
+            }
+            if(time['makeinfo'] > 0){
+                iv_makeinfo = window.setInterval('makeinfo()',1000*60* time['makeinfo']);
+            }
+            if(time['makeindex'] > 0){
+                iv_makeindex = window.setInterval('makeindex()',1000*60* time['makeindex']);
+            }
+            if(time['maketype'] > 0){
+                iv_maketype = window.setInterval('maketype()',1000*60* time['maketype']);
+            }
+            $("#dsinfo").css("display",'');
+            $(this).val('执行中...');
+            $("#btnGO").attr('disabled',true);
+            $("#btnCancel").attr('disabled',false);
+            $b=true;
+        });
+        $("#btnCancel").click(function(){
+            window.clearInterval(iv_cj);
+            window.clearInterval(iv_makeinfo);
+            window.clearInterval(iv_makeindex);
+            window.clearInterval(iv_maketype);
+            $("#sp_cj").html('');
+            $("#sp_makeinfo").html('');
+            $("#sp_makeindex").html('');
+            $("#sp_maketype").html('');
+            $("#dsinfo").css("display",'none');
+            $("#btnGO").val('执行任务');
+            $("#btnGO").attr('disabled',false);
+            $("#btnCancel").attr('disabled',true);
+            $b=false;
+        });
+    });
+    function cj()
+    {
+        var urlc=$("#ds_url option:selected").length;
+        $("#ds_url option:selected").each(function(k,v) {
+            if(urln < urlc){
+                if(urln==k){
+                    $("#sp_cj").html("<iframe width='100%' height='200' src='"+v.value+"' scrolling='auto'></iframe>");
+                    urln++;
+                    return false;
+                }
+            }
+            else{
+                urln=0;
+            }
+        });
+    }
+    function makeinfo()
+    {
+        $("#sp_makeinfo").html("<iframe width='100%' height='200' src='{:url('make/make')}?ac=info&tab=vod&ac2=nomake' scrolling='auto'></iframe>");
+    }
+    function makeindex()
+    {
+        $("#sp_makeindex").html("<iframe width='100%' height='200' src='{:url('make/make')}?ac=index' scrolling='auto'></iframe>");
+    }
+    function maketype()
+    {
+        if(typeids==''){
+            $("#sp_maketype").html("今日没有更新的数据,所以栏目无需更新!");
+        }
+        else{
+            $("#sp_maketype").html("<iframe width='100%' height='200' src='{:url('make/make')}?ac=type&tab=vod&vodtype="+typeids+"' scrolling='auto'></iframe>");
+        }
+    }
+    function reflogin()
+    {
+        $("#sp_reflogin").html("<iframe width='100%' height='100' src='{:url('index/welcome')}' scrolling='auto' style='display:none'></iframe>");
+    }
+
+</script>
+
+<div class="page-container p10">
+    <div style="width:650px; height:420px; margin:0 auto;">
+
+        <blockquote class="layui-elem-quote">定时采集生成插件WEB挂机版<br>注:不需要定时操作的模块,请填写0</blockquote>
+
+
+        <table style="">
+            <tr>
+                <td width="50%" rowspan="4"> <div style="">  </div></td>
+                <td>采集抓取频率(分钟/次):</td>
+                <td><input id="ds_cj" name="ds_cj" type="text" class="layui-input w50" value="5" /></td>
+            </tr>
+            <tr>
+                <td>内容生成频率(分钟/次): </td>
+                <td><input id="ds_makeinfo" name="ds_makeinfo" class="layui-input w50" type="text"  value="6" /></td>
+            </tr>
+            <tr>
+                <td>首页生成频率(分钟/次): </td>
+                <td><input id="ds_makeindex" name="ds_makeindex" class="layui-input w50" type="text"  value="20"/></td>
+            </tr>
+            <tr>
+                <td>栏目生成频率(分钟/次): </td>
+                <td><input id="ds_maketype" name="ds_maketype" class="layui-input w50" type="text" value="120"/></td>
+            </tr>
+            <tr>
+                <td colspan="2" style="text-align:center" class="p10">
+                    <input type="button" id="btnGO" class="layui-btn" value="执行任务"/>&nbsp;
+                    <input type="button" id="btnCancel" class="layui-btn layui-btn-warm" value="停止执行" disabled=true/>
+                </td>
+            </tr>
+        </table>
+
+    </div>
+
+    <div style="width:100%;height:50px;"></div>
+    <div id="dsinfo" style="width:650px;margin:0 auto;display:none;">
+        <table border='0' cellpadding='0' cellspacing='0' width='760' height='100%' align='center' style="border:1px solid #CCCCCC; font-size:12px">
+            <tr><td valign='top' style="background:#ECF5FF">视频_定时采集</td></tr>
+            <tr><td valign='top' id='sp_cj' height='150'>等侍中...</td></tr>
+            <tr><td valign='top' height='1' style="background:#e8e8e8"></td></tr>
+            <tr><td valign='top' style="background:#ECF5FF">视频_定时生成内容页</td></tr>
+            <tr><td valign='top' id='sp_makeinfo' height='150'>等侍中...</td></tr>
+            <tr><td valign='top' height='1' style="background:#e8e8e8"></td></tr>
+            <tr><td valign='top' style="background:#ECF5FF">视频_定时生成首页</td></tr>
+            <tr><td valign='top' id='sp_makeindex' height='150'>等侍中...</td></tr>
+            <tr><td valign='top' height='1' style="background:#e8e8e8"></td></tr>
+            <tr><td valign='top' style="background:#ECF5FF">视频_定时生成栏目页</td></tr>
+            <tr><td valign='top' id='sp_maketype' height='150'>等侍中...</td></tr>
+        </table>
+        <span id="sp_reflogin"></span>
+    </div>
+
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+<script type="text/javascript">
+    layui.use(['laypage', 'layer'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer;
+
+
+    });
+</script>
+</body>
+</html>

+ 31 - 0
application/admin/view/collect/union.html

@@ -0,0 +1,31 @@
+{include file="../../../application/admin/view/public/head" /}
+
+<div class="page-container p10">
+
+    <div class="my-toolbar-box">
+        <div class="layui-btn-group">
+            {if condition="$collect_break_vod neq ''"}
+            <a href="{:url('load')}?flag=vod" class="layui-btn layui-btn-danger ">【进入视频断点采集】</a>
+            {/if}
+            {if condition="$collect_break_art neq ''"}
+            <a href="{:url('load')}?flag=art" class="layui-btn layui-btn-danger ">【进入文章断点采集】</a>
+            {/if}
+            </div>
+    </div>
+    <hr>
+
+    <script src="" charset="utf-8"></script>
+
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+<script type="text/javascript">
+    layui.use(['laypage', 'layer'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer;
+
+
+    });
+</script>
+</body>
+</html>

+ 128 - 0
application/admin/view/collect/vod.html

@@ -0,0 +1,128 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box">
+
+        <div class="mb10">
+            <div class="layui-input-inline w150 m5"><a href="javascript:;" data-id="" class="select_type red">查看全部资源</a></div>
+            {volist name="type" id="vo"}
+            <div class="layui-input-inline w150 m5">
+                <a href="javascript:;" data-id="{$vo.type_id}" class="select_type">{$vo.type_name|htmlspecialchars}</a>
+                <a id="{$param['cjflag']}_{$vo.type_id}" data-href="{:url('index/select')}?tab=vod&col={$param['cjflag']}_{$vo.type_id}&ids=1&tpl=select_type&refresh=no&url=collect/bind" data-width="270" data-height="100" class="j-select" >
+                    {if condition="$vo.isbind eq 1"}
+                    <span class="red">[{$vo.local_type_name}]</span>
+                    {else}
+                    [绑定]
+                    {/if}
+                </a>
+            </div>
+            {/volist}
+
+        </div>
+
+        <div class="center mb10">
+            <form class="layui-form " method="">
+                <div class="layui-input-inline">
+                    <input type="text" autocomplete="off" placeholder="请输入搜索条件" class="layui-input" id="wd" name="wd" value="{$param['wd']}">
+                </div>
+                <button type="button" class="layui-btn mgl-20 j-btn" >查询</button>
+            </form>
+        </div>
+
+    </div>
+
+
+    <form class="layui-form " method="post" id="pageListForm">
+        <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th >名称</th>
+                <th width="60">分类</th>
+                <th width="60">来源</th>
+                <th width="140">时间</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" value="{$vo.vod_id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                <td>{$vo.vod_name|htmlspecialchars}</td>
+                <td>{$vo.type_name|htmlspecialchars}</td>
+                <td>{$vo.vod_play_from|htmlspecialchars}</td>
+                <td>{$vo.vod_time|mac_day=color}</td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+        <div class="layui-btn-group">
+            {php}
+                $p1 = $param;
+                unset($p1['ac']);
+                $p1_str = http_build_query($p1);
+            {/php}
+            <a data-href="{:url('api')}?{$p1_str}&ac=cjsel" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采选中</a>
+            <a data-href="{:url('api')}?{$p1_str}&h=24&ac=cjday" data-checkbox="no" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采当天</a>
+            <a data-href="{:url('api')}?{$p1_str}&ac=cjall" data-checkbox="no" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采全部</a>
+        </div>
+
+        <div id="pages" class="center"></div>
+    </form>
+
+</div>
+
+
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    var curUrl="{:url('api')}?{$param_str}";
+    layui.use(['laypage', 'layer','form'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer,
+                form = layui.form;
+
+        laypage.render({
+            elem: 'pages'
+            ,count: {$total}
+            ,limit: {$limit}
+            ,curr: {$page}
+            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
+            ,jump: function(obj,first){
+                if(!first){
+                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
+                }
+            }
+        });
+
+        $('#wd').on('keydown', function (event) {
+            if (event.keyCode == 13) {
+                $('.j-btn').click();
+                return false;
+            }
+        });
+
+        $('.j-btn').click(function(){
+           var wd = $('input[name="wd"]').val();
+            var url = changeParam(curUrl,'wd',wd);
+            location.href = url.replace('%7Bpage%7D',1).replace('%7Blimit%7D','');
+        });
+
+        $('.select_type').click(function(){
+            var t = $(this).attr('data-id');
+            var url = changeParam(curUrl,'t',t);
+            location.href = url.replace('%7Bpage%7D',1).replace('%7Blimit%7D','');
+        });
+
+    });
+    function onSubmitResult(res)
+    {
+        if(res.data.st==1){
+            $('#'+res.data.id).html('<span class="red">['+ res.data.local_type_name +']</span>');
+        }
+        else{
+            $('#'+res.data.id).html('[绑定]');
+        }
+    }
+</script>
+</body>
+</html>

+ 122 - 0
application/admin/view/collect/website.html

@@ -0,0 +1,122 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box">
+
+        <div class="mb10">
+            <div class="layui-input-inline w150 m5"><a href="javascript:;" data-id="" class="select_type red">查看全部资源</a></div>
+            {volist name="type" id="vo"}
+            <div class="layui-input-inline w150 m5">
+                <a href="javascript:;" data-id="{$vo.type_id}" class="select_type">{$vo.type_name|htmlspecialchars}</a>
+                <a id="{$param['cjflag']}_{$vo.type_id}" data-href="{:url('index/select')}?tab=website&col={$param['cjflag']}_{$vo.type_id}&ids=1&tpl=select_type&refresh=no&url=collect/bind" data-width="270" data-height="100" class="j-select" >
+                    {if condition="$vo.isbind eq 1"}
+                    <span class="red">[{$vo.local_type_name}]</span>
+                    {else}
+                    [绑定]
+                    {/if}
+                </a>
+            </div>
+            {/volist}
+
+        </div>
+
+        <div class="center mb10">
+            <form class="layui-form " method="">
+                <div class="layui-input-inline">
+                    <input type="text" autocomplete="off" placeholder="请输入搜索条件" class="layui-input" name="wd" value="{$param['wd']}">
+                </div>
+                <button type="button" class="layui-btn mgl-20 j-btn" >查询</button>
+            </form>
+        </div>
+
+    </div>
+
+
+    <form class="layui-form " method="post" id="pageListForm">
+        <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th >名称</th>
+                <th width="60">分类</th>
+                <th width="60">地区</th>
+                <th width="140">时间</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" value="{$vo.website_id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                <td>{$vo.website_name|htmlspecialchars}</td>
+                <td>{$vo.type_name|htmlspecialchars}</td>
+                <td>{$vo.website_area|htmlspecialchars}</td>
+                <td>{$vo.website_time|mac_day=color}</td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+        <div class="layui-btn-group">
+            {php}
+                $p1 = $param;
+                unset($p1['ac']);
+                $p1_str = http_build_query($p1);
+            {/php}
+            <a data-href="{:url('api')}?{$p1_str}&ac=cjsel" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采选中</a>
+            <a data-href="{:url('api')}?{$p1_str}&h=24&ac=cjday" data-checkbox="no" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采当天</a>
+            <a data-href="{:url('api')}?{$p1_str}&ac=cjall" data-checkbox="no" data-ajax="no" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe654;</i>采全部</a>
+        </div>
+
+        <div id="pages" class="center"></div>
+    </form>
+
+</div>
+
+
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    var curUrl="{:url('api')}?{$param_str}";
+    layui.use(['laypage', 'layer','form'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer,
+                form = layui.form;
+
+        laypage.render({
+            elem: 'pages'
+            ,count: {$total}
+            ,limit: {$limit}
+            ,curr: {$page}
+            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
+            ,jump: function(obj,first){
+                if(!first){
+                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
+                }
+            }
+        });
+
+
+        $('.j-btn').click(function(){
+           var wd = $('input[name="wd"]').val();
+            var url = changeParam(curUrl,'wd',wd);
+            location.href = url.replace('%7Bpage%7D',1).replace('%7Blimit%7D','');
+        });
+
+        $('.select_type').click(function(){
+            var t = $(this).attr('data-id');
+            var url = changeParam(curUrl,'t',t);
+            location.href = url.replace('%7Bpage%7D',1).replace('%7Blimit%7D','');
+        });
+
+    });
+    function onSubmitResult(res)
+    {
+        if(res.data.st==1){
+            $('#'+res.data.id).html('<span class="red">[解绑]</span>');
+        }
+        else{
+            $('#'+res.data.id).html('[绑定]');
+        }
+    }
+</script>
+</body>
+</html>

+ 134 - 0
application/admin/view/comment/index.html

@@ -0,0 +1,134 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box" >
+        <div class="center mb10">
+            <form class="layui-form " method="post">
+                <div class="layui-input-inline w100">
+                    <select name="status">
+                        <option value="">选择状态</option>
+                        <option value="0" {if condition="$param['status'] == '0'"}selected {/if}>未审核</option>
+                        <option value="1" {if condition="$param['status'] == '1'"}selected {/if}>已审核</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline w100">
+                    <select name="mid">
+                        <option value="">选择模块</option>
+                        <option value="1" {if condition="$param['mid'] eq '1'"}selected {/if}>视频</option>
+                        <option value="2" {if condition="$param['mid'] eq '2'"}selected {/if}>文章</option>
+                        <option value="3" {if condition="$param['mid'] eq '3'"}selected {/if}>专题</option>
+                        <option value="8" {if condition="$param['mid'] eq '8'"}selected {/if}>演员</option>
+                        <option value="9" {if condition="$param['mid'] eq '9'"}selected {/if}>角色</option>
+                        <option value="11" {if condition="$param['mid'] eq '11'"}selected {/if}>网址</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline w100">
+                    <select name="report">
+                        <option value="">选择举报</option>
+                        <option value="1" {if condition="$param['report'] eq '1'"}selected {/if}>未举报</option>
+                        <option value="2" {if condition="$param['report'] eq '2'"}selected {/if}>有举报</option>
+                    </select>
+                </div>
+
+                <div class="layui-input-inline">
+                    <input type="text" autocomplete="off" placeholder="请输入搜索条件" class="layui-input" name="wd" value="{$param['wd']}">
+                </div>
+                <button class="layui-btn mgl-20 j-search" >查询</button>
+            </form>
+        </div>
+
+        <div class="layui-btn-group">
+            <a data-href="{:url('del')}" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe640;</i>删除</a>
+            <a data-href="{:url('index/select')}?tab=comment&col=comment_status&tpl=select_status&url=comment/field" data-width="470" data-height="100" data-checkbox="1" class="layui-btn layui-btn-primary j-select"><i class="layui-icon">&#xe620;</i>状态</a>
+            <a data-href="{:url('del')}?all=1" class="layui-btn layui-btn-primary j-ajax" confirm="确认清空数据吗?操作不可恢复"><i class="layui-icon">&#xe640;</i>清空</a>
+        </div>
+    </div>
+
+    <form class="layui-form" method="post" id="pageListForm" >
+        <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th width="60">编号</th>
+                <th width="60">模块</th>
+                <th width="60">状态</th>
+                <th >评论内容</th>
+                <th width="100">操作</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" value="{$vo.comment_id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                <td>{$vo.comment_id}</td>
+                <td>{$vo.comment_mid|mac_get_mid_text}</td>
+                <td>{if condition="$vo.comment_status eq 0"}<span class="layui-badge">未审核</span>{else}<span class="layui-badge layui-bg-green">已审核</span>{/if}</td>
+                <td>
+                    <div class="c-999 f-12">
+                        <u style="cursor:pointer" class="text-primary">{$vo.comment_name|htmlspecialchars}:</u>
+                        <time>【{$vo.comment_time|mac_day=color}】</time>
+                        <span class="ml-20">ip:【{$vo.comment_ip|long2ip}】</span>
+                        <span class="ml-20">顶:【{$vo.comment_up}】</span>
+                        <span class="ml-20">踩:【{$vo.comment_down}】</span>
+                        <span class="ml-20">举报:【{$vo.comment_report}】</span>
+                        <span class="ml-20">链接:
+                            {if condition="!is_array($vo.data)"}
+                            【数据已删除】
+                            {elseif condition="$vo.comment_mid eq 1"}
+                            【<a target="_blank" href="{$vo.data|mac_url_vod_detail}">{$vo.data.vod_name}</a>】</span>
+                            {elseif condition="$vo.comment_mid eq 2"}
+                            【<a target="_blank" href="{$vo.data|mac_url_art_detail}">{$vo.data.art_name}</a>】</span>
+                            {elseif condition="$vo.comment_mid eq 3"}
+                            【<a target="_blank" href="{$vo.data|mac_url_topic_detail}">{$vo.data.topic_name}</a>】</span>
+                            {elseif condition="$vo.comment_mid eq 8"}
+                            【<a target="_blank" href="{$vo.data|mac_url_actor_detail}">{$vo.data.actor_name}</a>】</span>
+                            {elseif condition="$vo.comment_mid eq 9"}
+                            【<a target="_blank" href="{$vo.data|mac_url_role_detail}">{$vo.data.role_name}</a>】</span>
+                            {/if}
+                    </div>
+                    <div class="f-12 c-999">
+                        评论:{$vo.comment_content|htmlspecialchars}
+                    </div>
+                </td>
+                <td>
+                    <a class="layui-badge-rim j-iframe" data-href="{:url('info?id='.$vo['comment_id'])}" href="javascript:;" title="编辑">编辑</a>
+                    <a class="layui-badge-rim j-tr-del" data-href="{:url('del?ids='.$vo['comment_id'])}" href="javascript:;" title="删除">删除</a>
+                </td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+
+        <div id="pages" class="center"></div>
+
+    </form>
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+
+
+<script type="text/javascript">
+    var curUrl="{:url('comment/data',$param)}";
+    layui.use(['laypage', 'layer','form'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer,
+                form = layui.form;
+
+        laypage.render({
+            elem: 'pages'
+            ,count: {$total}
+            ,limit: {$limit}
+            ,curr: {$page}
+            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
+            ,jump: function(obj,first){
+                if(!first){
+                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
+                }
+            }
+        });
+
+
+    });
+</script>
+</body>
+</html>

+ 71 - 0
application/admin/view/comment/info.html

@@ -0,0 +1,71 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+    <form class="layui-form layui-form-pane" method="post" action="">
+        <input id="comment_id" name="comment_id" type="hidden" value="{$info.comment_id}">
+        <input id="comment_mid" name="comment_mid" type="hidden" value="{$info.comment_mid}">
+        <input id="comment_rid" name="comment_rid" type="hidden" value="{$info.comment_rid}">
+        <div class="layui-form-item">
+            <label class="layui-form-label">模块:</label>
+            <div class="layui-input-inline w80">
+                <input type="text" class="layui-input" value="{$info.comment_mid|mac_get_mid_text}" readonly="readonly">
+            </div>
+            <label class="layui-form-label">昵称:</label>
+            <div class="layui-input-inline w80">
+                <input type="text" class="layui-input" value="{$info.comment_name}" readonly="readonly" name="comment_name" >
+            </div>
+            <label class="layui-form-label">时间:</label>
+            <div class="layui-input-inline w130">
+                <input type="text" class="layui-input" value="{$info.comment_time|date='Y-m-d H:i:s',###}" readonly="readonly">
+            </div>
+        </div>
+        <div class="layui-form-item">
+            <label class="layui-form-label">顶数:</label>
+            <div class="layui-input-inline w80">
+                <input type="text" class="layui-input" value="{$info.comment_up}" name="comment_up">
+            </div>
+            <label class="layui-form-label">踩数:</label>
+            <div class="layui-input-inline w80">
+                <input type="text" class="layui-input" value="{$info.comment_down}" name="comment_down">
+            </div>
+        </div>
+
+        <div class="layui-form-item">
+            <label class="layui-form-label">评论内容:</label>
+            <div class="layui-input-block">
+                <textarea type="text" class="layui-textarea" lay-verify="comment_content" placeholder="请输入评论内容" name="comment_content">{$info.comment_content}</textarea>
+            </div>
+        </div>
+
+        <div class="layui-form-item center">
+            <div class="layui-input-block">
+                <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit" data-child="true">保 存</button>
+                <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
+            </div>
+        </div>
+    </form>
+
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    layui.use(['form', 'layer'], function () {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery;
+
+        // 验证
+        form.verify({
+            comment_content: function (value) {
+                if (value == "") {
+                    return "请输入评论内容";
+                }
+            }
+        });
+
+
+    });
+</script>
+
+</body>
+</html>

+ 68 - 0
application/admin/view/database/export.html

@@ -0,0 +1,68 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box" >
+        <ul class="layui-tab-title mb10">
+            <li class="layui-this"><a href="{:url('index')}">备份数据库</a></li>
+            <li><a href="{:url('index')}?group=import">恢复数据库</a></li>
+        </ul>
+
+        <div class="layui-btn-group">
+            <a data-href="{:url('export')}" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe62d;</i>备份数据库</a>
+            <a data-href="{:url('optimize')}" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe631;</i>优化数据库</a>
+            <a data-href="{:url('repair')}" class="layui-btn layui-btn-primary j-page-btns"><i class="layui-icon">&#xe60c;</i>修复数据库</a>
+        </div>
+    </div>
+
+    <form id="pageListForm" class="layui-form">
+        <table class="layui-table mt10" lay-even="" lay-skin="row">
+            <colgroup>
+                <col width="50">
+            </colgroup>
+            <thead>
+            <tr>
+                <th><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th>表名</th>
+                <th>数据量</th>
+                <th>大小</th>
+                <th>冗余</th>
+                <th>备注</th>
+                <th width="90">操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" class="layui-checkbox checkbox-ids" value="{$vo['Name']}" lay-skin="primary"></td>
+                <td>{$vo['Name']}</td>
+                <td>{$vo['Rows']}</td>
+                <td>{$vo['Data_length']/1024|round=###,2} kb</td>
+                <td>{$vo['Data_free']/1024|round=###,2} kb</td>
+                <td>{$vo['Comment']}</td>
+                <td>
+                        <a data-href="{:url('optimize?ids='.$vo['Name'])}" class="layui-badge-rim j-ajax">优化</a>
+                        <a data-href="{:url('repair?ids='.$vo['Name'])}" class="layui-badge-rim  j-ajax">修复</a>
+                </td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+    </form>
+
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+
+
+<script type="text/javascript">
+    layui.use(['form', 'layer'], function () {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery;
+
+
+
+    });
+</script>
+</body>
+</html>

+ 59 - 0
application/admin/view/database/import.html

@@ -0,0 +1,59 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box" >
+        <ul class="layui-tab-title mb10">
+            <li ><a href="{:url('index')}">备份数据库</a></li>
+            <li class="layui-this"><a href="{:url('index')}?group=import">恢复数据库</a></li>
+        </ul>
+    </div>
+
+    <form id="pageListForm" class="layui-form">
+        <table class="layui-table mt10" lay-even="" lay-skin="row">
+            <thead>
+            <tr>
+                <th>备份名称</th>
+                <th>备份卷数</th>
+                <th>备份压缩</th>
+                <th>备份大小</th>
+                <th>备份时间</th>
+                <th width="80">操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            {volist name="list" id="vo"}
+            <tr>
+                <td>{:date('Ymd-His', $vo['time'])}</td>
+                <td>{$vo['part']}</td>
+                <td>{$vo['compress']}</td>
+                <td>{:round($vo['size']/1024, 2)} K</td>
+                <td>{:date('Y-m-d H:i:s', $vo['time'])}</td>
+                <td>
+                    <div class="layui-btn-group">
+                        <a data-href="{:url('import?id='.strtotime($key))}" class="layui-badge-rim layui-btn-small j-ajax" confirm="确认还原此备份吗?此操作不可恢复">还原</a>
+                        <a data-href="{:url('del?id='.strtotime($key))}" class="layui-badge-rim layui-btn-small j-tr-del">删除</a>
+                    </div>
+                </td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+    </form>
+
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+
+
+<script type="text/javascript">
+    layui.use(['form', 'layer'], function () {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery;
+
+
+
+    });
+</script>
+</body>
+</html>

+ 133 - 0
application/admin/view/database/rep.html

@@ -0,0 +1,133 @@
+{include file="../../../application/admin/view/public/head" /}
+<style>
+    .layui-form-select ul {max-height:200px}
+    .layui-btn+.layui-btn{margin-left:0px; }
+</style>
+<div class="page-container">
+    <form class="layui-form layui-form-pane" action="">
+        <div class="layui-tab">
+            <ul class="layui-tab-title">
+                <li class="layui-this">批量替换</li>
+            </ul>
+            <div class="layui-tab-content">
+                <div class="layui-tab-item layui-show">
+
+                <div class="layui-form-item">
+                    <label class="layui-form-label">选择数据表:</label>
+                    <div class="layui-input-inline w400" >
+                        <select name="table" lay-filter="table" lay-verify="table">
+                            <option value="">请选择表</option>
+                            {volist name="list" id="vo"}
+                                <option value="{$vo.Name}">{$vo.Name}【{$vo.Comment}】</option>
+                            {/volist}
+                        </select>
+                    </div>
+                </div>
+                <div class="layui-form-item row-fields">
+                    <label class="layui-form-label">选择字段:</label>
+                    <div class="layui-input-block fields" >
+
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">要替换的字段:</label>
+                    <div class="layui-input-block" >
+                        <input type="text" id="field" name="field" placeholder="请选择字段" lay-verify="field" class="layui-input">
+                    </div>
+                </div>
+
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">被替换的内容:</label>
+                        <div class="layui-input-block" >
+                            <textarea name="findstr" placeholder="请输入" lay-verify="findstr" class="layui-textarea"></textarea>
+                        </div>
+                    </div>
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">替换为内容:</label>
+                        <div class="layui-input-block" >
+                            <textarea name="tostr" placeholder="请输入" lay-verify="tostr" class="layui-textarea"></textarea>
+                        </div>
+                    </div>
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">替换条件:</label>
+                        <div class="layui-input-block" >
+                            <input type="text" name="where" placeholder="请输入" value="" class="layui-input">
+                        </div>
+                    </div>
+
+                <div class="layui-form-item">
+
+                </div>
+            </div>
+            </div>
+        </div>
+        <div class="layui-form-item center">
+            <div class="layui-input-block">
+                <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit">保 存</button>
+                <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
+            </div>
+        </div>
+    </form>
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+<script type="text/javascript">
+    layui.use(['form', 'layer'], function(){
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer,
+                $ = layui.jquery;
+
+        form.on('select(table)', function(data){
+            $('.fields').html('');
+            if(data.value !=''){
+                $.post("{:url('columns')}", {table:data.value}, function(res) {
+                    if (res.code == 1) {
+                        $.each(res.data,function(index,row){
+                            $(".fields").append('<a class="layui-btn layui-btn-xs w80" href="javascript:setfield(\''+row.Field+'\')">'+row.Field+'</a>&nbsp;&nbsp;');
+                            if(index>0 && index%5==0){
+                                //$(".fields").append('<br>');
+                            }
+
+                        });
+                    }
+                    layer.msg(res.msg);
+                });
+            }
+        });
+
+
+        // 验证
+        form.verify({
+            table: function (value) {
+                if (value == "") {
+                    return "请选择数据表";
+                }
+            },
+            field: function (value) {
+                if (value == "") {
+                    return "请选择字段";
+                }
+            },
+            findstr: function (value) {
+                if (value == "") {
+                    return "请输入需要替换的内容";
+                }
+            },
+            tostr: function (value) {
+                if (value == "") {
+                    return "请输入替换为内容";
+                }
+            }
+        });
+
+    });
+
+    function setfield(v){
+        $('#field').val(v);
+    }
+
+</script>
+
+</body>
+</html>

+ 60 - 0
application/admin/view/database/sql.html

@@ -0,0 +1,60 @@
+{include file="../../../application/admin/view/public/head" /}
+
+<div class="page-container">
+    <form class="layui-form layui-form-pane" action="">
+        <div class="layui-tab">
+            <ul class="layui-tab-title">
+                <li class="layui-this">执行sql语句</li>
+            </ul>
+            <div class="layui-tab-content">
+                <div class="layui-tab-item layui-show">
+
+                    <div class="layui-input-block" >
+                    <blockquote class="layui-elem-quote layui-quote-nm">
+                        常用语句对照:<br>
+                        1.查询数据
+                        SELECT * FROM {pre}vod   查询所有数据<br>
+                        SELECT * FROM {pre}vod WHERE vod_id=1000   查询指定ID数据
+                        <br>
+                        2.删除数据
+                        DELETE FROM {pre}vod   删除所有数据<br>
+                        DELETE FROM {pre}vod WHERE vod_id=1000   删除指定的第几条数据<br>
+                        DELETE FROM {pre}vod WHERE vod_actor LIKE '%刘德华%'   vod_actor"刘德华"的数据
+                        <br>
+                        3.修改数据
+                        UPDATE {pre}vod SET vod_hits=1   将所有vod_hits字段里的值修改成"1"<br>
+                        UPDATE {pre}vod SET vod_hits=1 WHERE vod_id=1000  指定的第几条数据把vod_hits字段里的值修改成"1"
+                        <br>
+                        4.替换图片地址
+                        UPDATE {pre}vod SET vod_pic=REPLACE(vod_pic, '原始字符串', '替换成其他字符串')
+                        <br>
+                        5.清空数据ID重新从1开始
+                        TRUNCATE {pre}vod
+                    </blockquote>
+                    </div>
+
+                <div class="layui-form-item">
+                    <div class="layui-input-block" >
+                        <textarea name="sql" class="layui-textarea" rows="10" placeholder="请输入sql语句" ></textarea>
+                    </div>
+                </div>
+
+            </div>
+            </div>
+        </div>
+        <div class="layui-form-item center">
+            <div class="layui-input-block">
+                <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit">确认执行</button>
+                <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
+            </div>
+        </div>
+    </form>
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+<script type="text/javascript">
+
+</script>
+
+</body>
+</html>

+ 119 - 0
application/admin/view/domain/index.html

@@ -0,0 +1,119 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+    <div class="showpic" style="display:none;"><img class="showpic_img" width="120" height="160"></div>
+    
+    <form class="layui-form layui-form-pane" method="post" action="">
+        <input type="hidden" name="vod_id" value="{$info.vod_id}">
+
+        <div class="layui-tab">
+            <ul class="layui-tab-title ">
+                <li class="layui-this">站群配置</a></li>
+            </ul>
+            <div class="layui-tab-content">
+
+                <div class="layui-tab-item layui-show">
+
+                    <blockquote class="layui-elem-quote layui-quote-nm">
+                        提示信息:<br>
+                        1,此功能支持非静态模式下同1个数据库不同域名显示不同的模板和网站配置信息<br>
+                        2,不限制域名网站数量<br>
+                        3,导入文本格式是:域名$网站名称$关键字$描述$模板$模板目录$广告目录。每行一个网站。清空原有数据。<br>
+                        <a class="layui-btn layui-btn-primary" href="{:url('export')}" title="导出">导出</a>
+                        <a class="layui-btn layui-btn-primary layui-upload" data-href="{:url('import')}" >导入</a>
+                    </blockquote>
+
+                    <script>
+                        var arr_len = {$domain_list|count};
+                    </script>
+                    {php}
+                    $n=0;
+                    {/php}
+
+                    <div id="domain_list" class="contents">
+                        {volist name="$domain_list" id="vo"}
+                        {php}
+                        $n++;
+                        {/php}
+                        <div class="layui-form-item tr" data-i="{$key}">
+                        <label class="layui-form-label">网站{$n}:</label>
+                            <div class="layui-input-inline w150"><input type="text" name="domain[site_url][]" class="layui-input" placeholder="域名" value="{$vo.site_url}"></div>&nbsp;
+                            <div class="layui-input-inline w150"><input type="text" name="domain[site_name][]" class="layui-input" placeholder="网站名称" value="{$vo.site_name}"></div>&nbsp;
+                            <div class="layui-input-inline w150"><input type="text" name="domain[site_keywords][]" class="layui-input" placeholder="关键字" value="{$vo.site_keywords}"></div>&nbsp;
+                            <div class="layui-input-inline w150"><input type="text" name="domain[site_description][]" class="layui-input" placeholder="描述" value="{$vo.site_description}"></div>&nbsp;
+                            <div class="layui-input-inline w150"><select name="domain[template_dir][]"><option value="no">请选择模板.</option>{volist name="templates" id="vo2"}<option value="{$vo2}" {if condition="$vo2 eq $vo.template_dir"}selected{/if}>{$vo2}</option>{/volist}</select></div>
+                            <div class="layui-input-inline w150"><input type="text" name="domain[html_dir][]" class="layui-input" placeholder="模板目录" value="{$vo.html_dir}"></div>
+                            <div class="layui-input-inline w150"><input type="text" name="domain[ads_dir][]" class="layui-input" placeholder="广告目录" value="{$vo.ads_dir}"></div>
+                            <div> <a class="layui-badge-rim j-tr-del" data-href="{:url('del?ids='.$vo['site_url'])}" href="javascript:;" title="删除">删除</a></div>
+                        </div>
+                        {/volist}
+                    </div>
+                    <div class="layui-form-item">
+                        <label class=""><button class="layui-btn radius j-player-add" type="button">添加一组</button></label>
+                        <div class="layui-input-block">
+
+                        </div>
+                    </div>
+
+
+        </div>
+
+            </div>
+        </div>
+
+                <div class="layui-form-item center">
+                    <div class="layui-input-block">
+
+                        <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit" data-child="">保 存</button>
+                        <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
+                    </div>
+                </div>
+    </form>
+
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    var template_select='{volist name="templates" id="vo"}<option value="{$vo}">{$vo}</option>{/volist}';
+
+    layui.use(['form','layer','upload'], function () {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery
+            , upload = layui.upload;
+
+
+        upload.render({
+            elem: '.layui-upload'
+            ,url: "{:url('domain/import')}"
+            ,method: 'post'
+            ,exts:'txt'
+            ,before: function(input) {
+                layer.msg('文件上传中...', {time:3000000});
+            },done: function(res, index, upload) {
+                var obj = this.item;
+                if (res.code == 0) {
+                    layer.msg(res.msg);
+                    return false;
+                }
+                location.reload();
+            }
+        });
+
+        $('.j-player-add').on('click',function(){
+            arr_len++;
+            var tpl='<div class="layui-form-item" ><label class="layui-form-label">网站:'+arr_len+'</label><div class="layui-input-inline w150"><input type="text" name="domain[site_url][]" class="layui-input" placeholder="域名" ></div>&nbsp;<div class="layui-input-inline w150"><input type="text" name="domain[site_name][]" class="layui-input" placeholder="网站名称"></div>&nbsp;<div class="layui-input-inline w150"><input type="text" name="domain[site_keywords][]" class="layui-input" placeholder="关键字" ></div>&nbsp;<div class="layui-input-inline w150"><input type="text" name="domain[site_description][]" class="layui-input" placeholder="描述" ></div>&nbsp;<div class="layui-input-inline w150"><select name="domain[template_dir][]"><option value="no">请选择模板.</option>'+template_select+'</select></div><div class="layui-input-inline w150"><input type="text" name="domain[html_dir][]" class="layui-input" placeholder="模板目录" ></div><div class="layui-input-inline w150"><input type="text" name="domain[ads_dir][]" class="layui-input" placeholder="广告目录" ></div><div><a href="javascript:void(0)" class="j-editor-remove">删除</a>&nbsp;</div></div>';
+            $("#domain_list").append(tpl);
+
+            form.render('select');
+        });
+
+        if(arr_len==0) {
+            $('.j-player-add').click();
+        }
+    });
+    
+</script>
+
+</body>
+</html>

+ 27 - 0
application/admin/view/extend/pay/alipay.html

@@ -0,0 +1,27 @@
+<div class="layui-tab-item ">
+
+    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
+        <legend>支付宝设置 <a target="_blank" href="https://open.alipay.com/?maccms" class="layui-btn layui-btn-primary">点击进入注册</a></legend>
+    </fieldset>
+
+    <div class="layui-form-item">
+        <label class="layui-form-label">收款账号:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[alipay][account]" placeholder="" value="{$config['pay']['alipay']['account']}" class="layui-input">
+        </div>
+    </div>
+    <div class="layui-form-item">
+        <label class="layui-form-label">合作者身份:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[alipay][appid]" placeholder="" value="{$config['pay']['alipay']['appid']}" class="layui-input">
+        </div>
+        <div class="layui-form-mid layui-word-aux">appid</div>
+    </div>
+    <div class="layui-form-item">
+        <label class="layui-form-label">安全校验码:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[alipay][appkey]" placeholder="" value="{$config['pay']['alipay']['appkey']}" class="layui-input">
+        </div>
+        <div class="layui-form-mid layui-word-aux">appkey</div>
+    </div>
+</div>

+ 33 - 0
application/admin/view/extend/pay/codepay.html

@@ -0,0 +1,33 @@
+<div class="layui-tab-item">
+
+    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
+        <legend>码支付设置 <a target="_blank" href="https://codepay.fateqq.com/i/40625" class="layui-btn layui-btn-primary">点击进入注册</a></legend>
+    </fieldset>
+
+    <div class="layui-form-item">
+        <label class="layui-form-label">支付商家编号:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[codepay][appid]" placeholder="" value="{$config['pay']['codepay']['appid']}" class="layui-input">
+        </div>
+    </div>
+    <div class="layui-form-item">
+        <label class="layui-form-label">支付商家密钥:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[codepay][appkey]" placeholder="" value="{$config['pay']['codepay']['appkey']}" class="layui-input">
+        </div>
+    </div>
+    <div class="layui-form-item">
+        <label class="layui-form-label">商家收款平台:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[codepay][type]" placeholder="" value="{$config['pay']['codepay']['type']}" class="layui-input">
+        </div>
+        <div class="layui-form-mid layui-word-aux">1:支付宝;2:QQ钱包;3:微信(多个用逗号分隔)</div>
+    </div>
+    <div class="layui-form-item">
+        <label class="layui-form-label">收款通知类型:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[codepay][act]" placeholder="" value="{$config['pay']['codepay']['act']}" class="layui-input">
+        </div>
+        <div class="layui-form-mid layui-word-aux">0表示及时到账 1则为商家代收款</div>
+    </div>
+</div>

+ 26 - 0
application/admin/view/extend/pay/weixin.html

@@ -0,0 +1,26 @@
+<div class="layui-tab-item">
+
+    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
+        <legend>微信设置 <a target="_blank" href="https://pay.weixin.qq.com/?maccms" class="layui-btn layui-btn-primary">点击进入注册</a></legend>
+    </fieldset>
+
+    <div class="layui-form-item">
+        <label class="layui-form-label">APPID:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[weixin][appid]" placeholder="" value="{$config['pay']['weixin']['appid']}" class="layui-input">
+        </div>
+    </div>
+    <div class="layui-form-item">
+        <label class="layui-form-label">商户号:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[weixin][mchid]" placeholder="" value="{$config['pay']['weixin']['mchid']}" class="layui-input">
+        </div>
+    </div>
+    <div class="layui-form-item">
+        <label class="layui-form-label">商户密钥:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[weixin][appkey]" placeholder="" value="{$config['pay']['weixin']['appkey']}" class="layui-input">
+        </div>
+    </div>
+
+</div>

+ 33 - 0
application/admin/view/extend/pay/zhapay.html

@@ -0,0 +1,33 @@
+<div class="layui-tab-item">
+
+    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
+        <legend>幻兮支付设置 <a target="_blank" href="https://www.zhapay.com/ad_8rRGj4nN.html" class="layui-btn layui-btn-primary">点击进入注册</a></legend>
+    </fieldset>
+
+    <div class="layui-form-item">
+        <label class="layui-form-label">支付商家编号:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[zhapay][appid]" placeholder="" value="{$config['pay']['zhapay']['appid']}" class="layui-input">
+        </div>
+    </div>
+    <div class="layui-form-item">
+        <label class="layui-form-label">支付商家密钥:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[zhapay][appkey]" placeholder="" value="{$config['pay']['zhapay']['appkey']}" class="layui-input">
+        </div>
+    </div>
+    <div class="layui-form-item">
+        <label class="layui-form-label">商家收款平台:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[zhapay][type]" placeholder="" value="{$config['pay']['zhapay']['type']}" class="layui-input">
+        </div>
+        <div class="layui-form-mid layui-word-aux">1:微信;2:支付宝;(多个用逗号分隔)</div>
+    </div>
+    <div class="layui-form-item">
+        <label class="layui-form-label">收款通知类型:</label>
+        <div class="layui-input-inline w400">
+            <input type="text" name="pay[zhapay][act]" placeholder="" value="{$config['pay']['zhapay']['act']}" class="layui-input">
+        </div>
+        <div class="layui-form-mid layui-word-aux">2表示及时到账 1则为商家代收款</div>
+    </div>
+</div>

+ 9 - 0
application/admin/view/extend/upload/alibaba.html

@@ -0,0 +1,9 @@
+<div class="layui-form-item upload_mode mode_Alibaba" {if condition="$config['upload']['mode'] neq 'Alibaba'"}style="display:none;" {/if}>
+<label class="layui-form-label">阿里巴巴图床:</label>
+<div class="layui-input-block">
+    <a href="http://alibaba.com" target="_blank" class="layui-btn layui-btn-primary">目前免费不用申请</a>
+</div>
+</div>
+<div class="layui-form-item upload_mode mode_Alibaba" {if condition="$config['upload']['mode'] neq 'Alibaba'"}style="display:none;" {/if}>
+
+</div>

+ 32 - 0
application/admin/view/extend/upload/ftp.html

@@ -0,0 +1,32 @@
+<div class="layui-form-item upload_mode mode_Ftp" {if condition="$config['upload']['mode'] neq 'Ftp'"}style="display:none;" {/if}>
+<label class="layui-form-label">FTP存储:</label>
+<div class="layui-input-block">
+    <a href="javascript:;" target="_blank" class="layui-btn layui-btn-primary">请确认FTP可以正常连接</a>
+</div>
+</div>
+<div class="layui-form-item upload_mode mode_Ftp" {if condition="$config['upload']['mode'] neq 'Ftp'"}style="display:none;" {/if}>
+<label class="layui-form-label">服务器:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][ftp][host]" placeholder="ip或域名" value="{$config['upload']['api']['ftp']['host']}" class="layui-input" >
+</div>
+<label class="layui-form-label">端口:</label>
+<div class="layui-input-inline w100">
+    <input type="text" name="upload[api][ftp][port]" placeholder="端口号" value="{$config['upload']['api']['ftp']['port']}" class="layui-input" >
+</div>
+<label class="layui-form-label">账号:</label>
+<div class="layui-input-inline w100">
+    <input type="text" name="upload[api][ftp][user]" placeholder="ftp账号" value="{$config['upload']['api']['ftp']['user']}" class="layui-input" >
+</div>
+<label class="layui-form-label">密码:</label>
+<div class="layui-input-inline w100">
+    <input type="text" name="upload[api][ftp][pwd]" placeholder="ftp密码" value="{$config['upload']['api']['ftp']['pwd']}" class="layui-input" >
+</div>
+<label class="layui-form-label">路径:</label>
+<div class="layui-input-inline w100">
+    <input type="text" name="upload[api][ftp][path]" placeholder="网站根路径" value="{$config['upload']['api']['ftp']['path']}" class="layui-input" >
+</div>
+<label class="layui-form-label">外链URL:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][ftp][url]" placeholder="外链URL" value="{$config['upload']['api']['ftp']['url']}" class="layui-input" >
+</div>
+</div>

+ 24 - 0
application/admin/view/extend/upload/qiniu.html

@@ -0,0 +1,24 @@
+<div class="layui-form-item upload_mode mode_Qiniu" {if condition="$config['upload']['mode'] neq 'Qiniu'"}style="display:none;" {/if}>
+<label class="layui-form-label">七牛云API:</label>
+<div class="layui-input-block">
+    <a href="https://www.qiniu.com/" target="_blank" class="layui-btn layui-btn-primary">点击申请 https://www.qiniu.com/</a>
+</div>
+</div>
+<div class="layui-form-item upload_mode mode_Qiniu" {if condition="$config['upload']['mode'] neq 'Qiniu'"}style="display:none;" {/if}>
+<label class="layui-form-label">服务名:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][qiniu][bucket]" placeholder="七牛云-服务名" value="{$config['upload']['api']['qiniu']['bucket']}" class="layui-input"  >
+</div>
+<label class="layui-form-label">公钥:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][qiniu][accesskey]" placeholder="七牛云-公钥" value="{$config['upload']['api']['qiniu']['accesskey']}" class="layui-input"  >
+</div>
+<label class="layui-form-label">私钥:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][qiniu][secretkey]" placeholder="七牛云-私钥" value="{$config['upload']['api']['qiniu']['secretkey']}" class="layui-input"  >
+</div>
+<label class="layui-form-label">外链URL:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][qiniu][url]" placeholder="七牛云-外链URL" value="{$config['upload']['api']['qiniu']['url']}" class="layui-input"  >
+</div>
+</div>

+ 28 - 0
application/admin/view/extend/upload/uomg.html

@@ -0,0 +1,28 @@
+<div class="layui-form-item upload_mode mode_Uomg" {if condition="$config['upload']['mode'] neq 'Uomg'"}style="display:none;" {/if}>
+<label class="layui-form-label">优启梦图床:</label>
+<div class="layui-input-block">
+    <a href="http://api.uomg.com/" target="_blank" class="layui-btn layui-btn-primary">目前免费不用申请 http://api.uomg.com/</a>
+</div>
+</div>
+<div class="layui-form-item upload_mode mode_Uomg" {if condition="$config['upload']['mode'] neq 'Uomg'"}style="display:none;" {/if}>
+<label class="layui-form-label">OPENID:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][uomg][openid]" placeholder="" value="{$config['upload']['api']['uomg']['openid']}" class="layui-input"  >
+</div>
+<label class="layui-form-label">操作员名:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][uomg][key]" placeholder="" value="{$config['upload']['api']['uomg']['key']}" class="layui-input"  >
+</div>
+<label class="layui-form-label">类型:</label>
+<div class="layui-input-inline w200">
+    <select class="w150" name="upload[api][uomg][type]">
+        <option value="ali" {if condition="$config['upload'][api][uomg][type] eq 'ali'"}selected {/if}>阿里巴巴</option>
+        <option value="baidu" {if condition="$config['upload'][api][uomg][type] eq 'baidu'"}selected {/if}>百度识图</option>
+        <option value="sina" {if condition="$config['upload'][api][uomg][type] eq 'sina'"}selected {/if}>新浪微博</option>
+        <option value="sogou" {if condition="$config['upload'][api][uomg][type] eq 'sogou'"}selected {/if}>搜狗图片</option>
+        <option value="juejin" {if condition="$config['upload'][api][uomg][type] eq 'juejin'"}selected {/if}>掘金社区</option>
+        <option value="360" {if condition="$config['upload'][api][uomg][type] eq '360'"}selected {/if}>奇虎360</option>
+        <option value="jd" {if condition="$config['upload'][api][uomg][type] eq 'jd'"}selected {/if}>京东商城</option>
+    </select>
+</div>
+</div>

+ 24 - 0
application/admin/view/extend/upload/upyun.html

@@ -0,0 +1,24 @@
+<div class="layui-form-item upload_mode mode_Upyun" {if condition="$config['upload']['mode'] neq 'Upyun'"}style="display:none;" {/if}>
+<label class="layui-form-label">又云拍API:</label>
+<div class="layui-input-block">
+    <a href="https://www.upyun.com/" target="_blank" class="layui-btn layui-btn-primary">点击申请 https://www.upyun.com/</a>
+</div>
+</div>
+<div class="layui-form-item upload_mode mode_Upyun" {if condition="$config['upload']['mode'] neq 'Upyun'"}style="display:none;" {/if}>
+<label class="layui-form-label">服务名:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][upyun][bucket]" placeholder="又云拍-服务名" value="{$config['upload']['api']['upyun']['bucket']}" class="layui-input"  >
+</div>
+<label class="layui-form-label">操作员名:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][upyun][username]" placeholder="又云拍-操作员名" value="{$config['upload']['api']['upyun']['username']}" class="layui-input"  >
+</div>
+<label class="layui-form-label">操作员密码:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][upyun][pwd]" placeholder="又云拍-操作员密码" value="{$config['upload']['api']['upyun']['pwd']}" class="layui-input"  >
+</div>
+<label class="layui-form-label">外链URL:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][upyun][url]" placeholder="又云拍-外链URL" value="{$config['upload']['api']['upyun']['url']}" class="layui-input"  >
+</div>
+</div>

+ 37 - 0
application/admin/view/extend/upload/weibo.html

@@ -0,0 +1,37 @@
+<div class="layui-form-item upload_mode mode_Weibo" {if condition="$config['upload']['mode'] neq 'Weibo'"}style="display:none;" {/if}>
+<label class="layui-form-label">新浪微博:</label>
+<div class="layui-input-block">
+    <a href="https://www.weibo.com/" target="_blank" class="layui-btn layui-btn-primary">点击申请 https://www.weibo.com/</a>
+</div>
+</div>
+<div class="layui-form-item upload_mode mode_Weibo" {if condition="$config['upload']['mode'] neq 'Weibo'"}style="display:none;" {/if}>
+<label class="layui-form-label">账号:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][weibo][user]" placeholder="微博登录账号" value="{$config['upload']['api']['weibo']['user']}" class="layui-input"  >
+</div>
+<label class="layui-form-label">密码:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][weibo][pwd]" placeholder="微博登录密码" value="{$config['upload']['api']['weibo']['pwd']}" class="layui-input"  >
+</div>
+<label class="layui-form-label">获取尺寸:</label>
+<div class="layui-input-inline">
+    <select class="w150" name="upload[api][weibo][size]">
+        <option value="large" {if condition="$config['upload'][api][weibo][size] eq 'large'"}selected {/if}>large</option>
+        <option value="bmiddle" {if condition="$config['upload'][api][weibo][size] eq 'bmiddle'"}selected {/if}>bmiddle</option>
+        <option value="small" {if condition="$config['upload'][api][weibo][size] eq 'small'"}selected {/if}>small</option>
+        <option value="mw2048" {if condition="$config['upload'][api][weibo][size] eq 'mw2048'"}selected {/if}>mw2048</option>
+        <option value="mw1024" {if condition="$config['upload'][api][weibo][size] eq 'mw1024'"}selected {/if}>mw1024</option>
+        <option value="mw690" {if condition="$config['upload'][api][weibo][size] eq 'mw690'"}selected {/if}>mw690</option>
+        <option value="orj480" {if condition="$config['upload'][api][weibo][size] eq 'orj480'"}selected {/if}>orj480</option>
+        <option value="orj360" {if condition="$config['upload'][api][weibo][size] eq 'orj360'"}selected {/if}>orj360</option>
+        <option value="thumb150" {if condition="$config['upload'][api][weibo][size] eq 'thumb150'"}selected {/if}>thumb150</option>
+        <option value="square" {if condition="$config['upload'][api][weibo][size] eq 'square'"}selected {/if}>square</option>
+    </select>
+</div>
+<label class="layui-form-label">cookie:</label>
+<div class="layui-input-inline w200">
+    <input type="text" name="upload[api][weibo][cookie]" placeholder="登录cookie-会自动读取" value="{$config['upload']['api']['weibo']['cookie']}" class="layui-input"  >
+    <input type="hidden" name="upload[api][weibo][time]" placeholder="登录时间-不用设置" value="{$config['upload']['api']['weibo']['time']}" class="layui-input"  >
+</div>
+
+</div>

+ 122 - 0
application/admin/view/gbook/index.html

@@ -0,0 +1,122 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box" >
+        <div class="center mb10">
+            <form class="layui-form " method="post">
+                <div class="layui-input-inline w100">
+                    <select name="status">
+                        <option value="">选择状态</option>
+                        <option value="0" {if condition="$param['status'] == '0'"}selected {/if}>未审核</option>
+                        <option value="1" {if condition="$param['status'] == '1'"}selected {/if}>已审核</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline w100">
+                    <select name="type">
+                        <option value="">选择回复状态</option>
+                        <option value="1" {if condition="$param['reply'] eq '1'"}selected {/if}>未回复</option>
+                        <option value="2" {if condition="$param['reply'] eq '2'"}selected {/if}>已回复</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline w100">
+                    <select name="type">
+                        <option value="">选择类型</option>
+                        <option value="1" {if condition="$param['type'] eq '1'"}selected {/if}>留言数据</option>
+                        <option value="2" {if condition="$param['type'] eq '2'"}selected {/if}>报错数据</option>
+                    </select>
+                </div>
+                <div class="layui-input-inline">
+                    <input type="text" autocomplete="off" placeholder="请输入搜索条件" class="layui-input" name="wd" value="{$param['wd']}">
+                </div>
+                <button class="layui-btn mgl-20 j-search" >查询</button>
+            </form>
+        </div>
+        <div class="layui-btn-group">
+            <a data-href="{:url('del')}" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe640;</i>删除</a>
+            <a data-href="{:url('index/select')}?tab=gbook&col=gbook_status&tpl=select_status&url=gbook/field" data-width="470" data-height="100" data-checkbox="1" class="layui-btn layui-btn-primary j-select"><i class="layui-icon">&#xe620;</i>状态</a>
+            <a data-href="{:url('del')}?all=1" class="layui-btn layui-btn-primary j-ajax" confirm="确认清空数据吗?操作不可恢复"><i class="layui-icon">&#xe640;</i>清空</a>
+        </div>
+    </div>
+
+
+        <form class="layui-form" method="post" id="pageListForm" >
+            <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th width="60">编号</th>
+                <th width="60">状态</th>
+                <th width="60">类型</th>
+                <th >留言内容</th>
+                <th >回复内容</th>
+                <th width="100">操作</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td><input type="checkbox" name="ids[]" value="{$vo.gbook_id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
+                <td>{$vo.gbook_id}</td>
+                <td>{if condition="$vo.gbook_status eq 0"}<span class="layui-badge">未审核</span>{else}<span class="layui-badge layui-bg-green">已审核</span>{/if}</td>
+                <td>{if condition="$vo.gbook_rid eq 0"}留言数据{else/}报错数据{/if}</td>
+                <td>
+                    <div class="c-999 f-12">
+                        <u style="cursor:pointer" class="text-primary">{$vo.gbook_name|htmlspecialchars}:</u>
+                        <time>【{$vo.gbook_time|mac_day=color}】</time>
+                        <span class="ml-20">ip:【{$vo.gbook_ip|long2ip}】</span>
+                    </div>
+                    <div class="f-12 c-999">
+                        <span class="ml-20">状态:</span>
+                        留言:{$vo.gbook_content|htmlspecialchars}
+                    </div>
+                </td>
+                <td>
+                    <div class="c-999 f-12">
+                        回复时间:{$vo.gbook_reply_time|mac_day=color}
+                    </div>
+                    <div class="f-12 c-999">
+                        回复:{$vo.gbook_reply|htmlspecialchars}
+                    </div>
+                    <div> </div>
+                </td>
+                <td>
+                    <a class="layui-badge-rim j-iframe" data-href="{:url('info?id='.$vo['gbook_id'])}" href="javascript:;" title="回复">回复</a>
+                    <a class="layui-badge-rim j-tr-del" data-href="{:url('del?ids='.$vo['gbook_id'])}" href="javascript:;" title="删除">删除</a>
+                </td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+
+        <div id="pages" class="center"></div>
+
+    </form>
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    var curUrl="{:url('gbook/data',$param)}";
+    layui.use(['laypage', 'layer','form'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer,
+                form = layui.form;
+
+        laypage.render({
+            elem: 'pages'
+            ,count: {$total}
+            ,limit: {$limit}
+            ,curr: {$page}
+            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
+            ,jump: function(obj,first){
+                if(!first){
+                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
+                }
+            }
+        });
+
+
+    });
+</script>
+</body>
+</html>

+ 67 - 0
application/admin/view/gbook/info.html

@@ -0,0 +1,67 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+    <form class="layui-form layui-form-pane" method="post" action="">
+        <input id="gbook_id" name="gbook_id" type="hidden" value="{$info.gbook_id}">
+        <input id="gbook_rid" name="gbook_rid" type="hidden" value="{$info.gbook_rid}">
+        <div class="layui-form-item">
+
+            <label class="layui-form-label">昵称:</label>
+            <div class="layui-input-inline w80">
+                <input type="text" class="layui-input" value="{$info.gbook_name}" readonly="readonly" name="gbook_name" >
+            </div>
+            <label class="layui-form-label">留言时间:</label>
+            <div class="layui-input-inline w130">
+                <input type="text" class="layui-input" value="{$info.gbook_time|date='Y-m-d H:i:s',###}" readonly="readonly">
+            </div>
+            <label class="layui-form-label">回复时间:</label>
+            <div class="layui-input-inline w130">
+                <input type="text" class="layui-input" value="{$info.gbook_reply_time|date='Y-m-d H:i:s',###}" readonly="readonly">
+            </div>
+        </div>
+
+        <div class="layui-form-item">
+            <label class="layui-form-label">留言内容:</label>
+            <div class="layui-input-block">
+                <textarea type="text" class="layui-textarea" lay-verify="gbook_content" placeholder="请输入评论内容" name="gbook_content">{$info.gbook_content}</textarea>
+            </div>
+        </div>
+        <div class="layui-form-item">
+            <label class="layui-form-label">回复内容:</label>
+            <div class="layui-input-block">
+                <textarea type="text" class="layui-textarea" lay-verify="gbook_reply" placeholder="请输入回复内容" name="gbook_reply">{$info.gbook_reply}</textarea>
+            </div>
+        </div>
+
+        <div class="layui-form-item center">
+            <div class="layui-input-block">
+                <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit" data-child="true">保 存</button>
+                <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
+            </div>
+        </div>
+    </form>
+
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    layui.use(['form', 'layer'], function () {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery;
+
+        // 验证
+        form.verify({
+            gbook_content: function (value) {
+                if (value == "") {
+                    return "请输入留言内容";
+                }
+            }
+        });
+
+
+    });
+</script>
+
+</body>
+</html>

+ 78 - 0
application/admin/view/group/index.html

@@ -0,0 +1,78 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-toolbar-box">
+
+        <div class="layui-btn-group">
+            <a data-href="{:url('info')}" class="layui-btn layui-btn-primary j-iframe"><i class="layui-icon">&#xe654;</i>添加</a>
+            <a data-href="{:url('del')}" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe640;</i>删除</a>
+        </div>
+
+    </div>
+
+    <form class="layui-form " method="post" id="pageListForm">
+        <table class="layui-table" lay-size="sm">
+            <thead>
+            <tr>
+                <th width="25"><input type="checkbox" lay-skin="primary" lay-filter="allChoose"></th>
+                <th width="100">编号</th>
+                <th >名称</th>
+                <th width="100">状态</th>
+                <th width="100">包天</th>
+                <th width="100">包周</th>
+                <th width="100">包月</th>
+                <th width="100">包年</th>
+                <th width="100">操作</th>
+            </tr>
+            </thead>
+
+            {volist name="list" id="vo"}
+            <tr>
+                <td>
+                    {if condition="$vo['group_id'] gt 2"}
+                    <input type="checkbox" name="ids[]" value="{$vo.group_id}" class="layui-checkbox checkbox-ids" lay-skin="primary">
+                    {/if}
+                </td>
+                <td>{$vo.group_id}</td>
+                <td>{$vo.group_name|htmlspecialchars}</td>
+                <td>
+                    {if condition="$vo['group_id'] gt 2"}
+                    <input type="checkbox" name="status" {if condition="$vo['group_status'] eq 1"}checked{/if} value="{$vo['group_status']}" lay-skin="switch" lay-filter="switchStatus" lay-text="正常|关闭" data-href="{:url('field?col=group_status&ids='.$vo['group_id'])}">
+                    {/if}
+                </td>
+                <td>{$vo.group_points_day}</td>
+                <td>{$vo.group_points_week}</td>
+                <td>{$vo.group_points_month}</td>
+                <td>{$vo.group_points_year}</td>
+                <td>
+                    <a class="layui-badge-rim j-iframe" data-href="{:url('info?id='.$vo['group_id'])}" href="javascript:;" title="编辑">编辑</a>
+                    {if condition="$vo['group_id'] gt 2"}
+                    <a class="layui-badge-rim j-tr-del" data-href="{:url('del?ids='.$vo['group_id'])}" href="javascript:;" title="删除">删除</a>
+                    {/if}
+                </td>
+            </tr>
+            {/volist}
+            </tbody>
+        </table>
+
+    </form>
+
+    <blockquote class="layui-elem-quote layui-quote-nm">
+        提示信息:<br>
+        1.游客、普通会员属于系统内置会员组,无法删除和禁用; <br>2.请单独设置每个会员组的权限,不会向下继承权限;
+    </blockquote>
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+
+    layui.use(['laypage', 'layer'], function() {
+        var laypage = layui.laypage
+                , layer = layui.layer;
+
+
+    });
+</script>
+</body>
+</html>

+ 137 - 0
application/admin/view/group/info.html

@@ -0,0 +1,137 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+    <form class="layui-form layui-form-pane" method="post" action="">
+        <input id="group_id" name="group_id" type="hidden" value="{$info.group_id}">
+        <div class="layui-form-item">
+            <label class="layui-form-label">名称:</label>
+            <div class="layui-input-block  ">
+                <input type="text" class="layui-input" value="{$info.group_name}" placeholder="请输入会员组名称" lay-verify="group_name" name="group_name">
+            </div>
+        </div>
+
+        {if condition="$info.group_id gt 2"}
+        <div class="layui-form-item">
+            <label class="layui-form-label">包天价格:</label>
+            <div class="layui-input-inline">
+                <input type="text" class="layui-input" value="{$info.group_points_day}" placeholder="包天" lay-verify="group_points_day" name="group_points_day">
+            </div>
+            <label class="layui-form-label">包周价格:</label>
+            <div class="layui-input-inline">
+                <input type="text" class="layui-input" value="{$info.group_points_week}" placeholder="包周" lay-verify="group_points_week" name="group_points_week">
+            </div>
+        </div>
+        <div class="layui-form-item">
+            <label class="layui-form-label">包月价格:</label>
+            <div class="layui-input-inline">
+                <input type="text" class="layui-input" value="{$info.group_points_month}" placeholder="包月" lay-verify="group_points_month" name="group_points_month">
+            </div>
+            <label class="layui-form-label">包年价格:</label>
+            <div class="layui-input-inline">
+                <input type="text" class="layui-input" value="{$info.group_points_year}" placeholder="包年" lay-verify="group_points_year" name="group_points_year">
+            </div>
+        </div>
+
+        <div class="layui-form-item">
+            <label class="layui-form-label">状态:</label>
+            <div class="layui-input-block">
+                    <input name="group_status" type="radio" value="0" title="禁用" {if condition="$info['group_status'] neq 1"}checked {/if}>
+                    <input name="group_status" type="radio" value="1" title="启用" {if condition="$info['group_status'] eq 1"}checked {/if}>
+            </div>
+        </div>
+        {/if}
+
+        <div class="layui-form-item ">
+            <label class="layui-form-label">相关权限:</label>
+            <div class="layui-input-block">
+                <blockquote class="layui-elem-quote layui-quote-nm">
+                    提示:<br>
+                    1.列表页、内容页、播放页、下载页4个权限,控制是否可以进入页面,没权限会直接返回提示信息。<br>
+                    2.试看权限:如果没有访问播放页的权限、或者有权限但是需要积分购买的数据,开启了试看权限也是可以进入页面的。
+                </blockquote>
+
+                <div class="role-list-form ">
+                {volist name="type_tree" id="vo" key="k1"}
+                    <dl class="role-list-form-top permission-list">
+                        <dt>
+                            分类:<input type="checkbox" value="{$vo.type_id}" name="group_type[]" data-id="{$k1}" lay-skin="primary" lay-filter="roleAuth1" title="{$vo.type_name}" {if condition="strpos(','.$info['group_type'],','.$vo['type_id'].',')>0"}checked {/if}>
+                            权限:<input type="checkbox" name="group_popedom[{$vo.type_id}][1]" value="1" lay-skin="primary" title="列表页" {if condition="!empty($info['group_popedom'][$vo.type_id][1])"}checked {/if}>
+                            <input type="checkbox" name="group_popedom[{$vo.type_id}][2]" value="2" lay-skin="primary" title="内容页" {if condition="!empty($info['group_popedom'][$vo.type_id][2])"}checked {/if}>
+                            {if condition="$vo.type_mid eq 1"}
+                            <input type="checkbox" name="group_popedom[{$vo.type_id}][3]" value="3" lay-skin="primary" title="播放页" {if condition="!empty($info['group_popedom'][$vo.type_id][3])"}checked {/if}>
+                            <input type="checkbox" name="group_popedom[{$vo.type_id}][4]" value="4" lay-skin="primary" title="下载页" {if condition="!empty($info['group_popedom'][$vo.type_id][4])"}checked {/if}>
+                            <input type="checkbox" name="group_popedom[{$vo.type_id}][5]" value="5" lay-skin="primary" title="试看" {if condition="!empty($info['group_popedom'][$vo.type_id][5])"}checked {/if}>
+                            {/if}
+                        </dt>
+                    </dl>
+                    {volist name="$vo.child" id="sub" key="k2"}
+                    <dl class="role-list-form-top permission-list">
+                        <dt>
+                            分类:<input type="checkbox" value="{$sub.type_id}" name="group_type[]" data-id="{$k1}" lay-skin="primary" lay-filter="roleAuth1" title="---{$sub.type_name}" {if condition="strpos(','.$info['group_type'],','.$sub  ['type_id'].',')>0"}checked {/if}>
+                            权限:<input type="checkbox" name="group_popedom[{$sub.type_id}][1]" value="1" lay-skin="primary" title="列表页" {if condition="!empty($info['group_popedom'][$sub.type_id][1])"}checked {/if}>
+                            <input type="checkbox" name="group_popedom[{$sub.type_id}][2]" value="2" lay-skin="primary" title="内容页" {if condition="!empty($info['group_popedom'][$sub.type_id][2])"}checked {/if}>
+                            {if condition="$sub.type_mid eq 1"}
+                            <input type="checkbox" name="group_popedom[{$sub.type_id}][3]" value="3" lay-skin="primary" title="播放页" {if condition="!empty($info['group_popedom'][$sub.type_id][3])"}checked {/if}>
+                            <input type="checkbox" name="group_popedom[{$sub.type_id}][4]" value="4" lay-skin="primary" title="下载页" {if condition="!empty($info['group_popedom'][$sub.type_id][4])"}checked {/if}>
+                            <input type="checkbox" name="group_popedom[{$sub.type_id}][5]" value="5" lay-skin="primary" title="试看" {if condition="!empty($info['group_popedom'][$sub.type_id][5])"}checked {/if}>
+                            {/if}
+                        </dt>
+                    </dl>
+                    {/volist}
+                {/volist}
+                </div>
+            </div>
+        </div>
+
+        <div class="layui-form-item center">
+            <div class="layui-input-block">
+
+                <button type="button" class="layui-btn layui-btn-normal formCheckAll" lay-filter="formCheckAll" >全选</button>
+                <button type="button" class="layui-btn layui-btn-normal formCheckOther" lay-filter="formCheckOther">反选</button>
+
+                <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit" data-child="true">保 存</button>
+                <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
+            </div>
+        </div>
+    </form>
+
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+
+<script type="text/javascript">
+    layui.use(['form', 'layer'], function () {
+        // 操作对象
+        var form = layui.form
+                , layer = layui.layer
+                , $ = layui.jquery;
+
+        // 验证
+        form.verify({
+            group_name: function (value) {
+                if (value == "") {
+                    return "请输入会员组名称";
+                }
+            }
+        });
+
+        $('.formCheckAll').click(function(){
+            var child = $('.role-list-form').find('input');
+            /* 自动选中子节点 */
+            child.each(function(index, item) {
+                item.checked = true;
+            });
+            form.render('checkbox');
+        });
+        $('.formCheckOther').click(function(){
+            var child = $('.role-list-form').find('input');
+            /* 自动选中子节点 */
+            child.each(function(index, item) {
+                item.checked = (item.checked  ? false : true);
+            });
+            form.render('checkbox');
+        });
+    });
+
+</script>
+
+</body>
+</html>

+ 56 - 0
application/admin/view/images/index.html

@@ -0,0 +1,56 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <div class="my-btn-box lh30" >
+        <div class="layui-btn-group fl">
+            <a data-href="{:url('del')}" class="layui-btn layui-btn-primary j-page-btns confirm"><i class="layui-icon">&#xe640;</i>删除</a>
+        </div>
+        <div class="page-filter fr" >
+
+        </div>
+    </div>
+
+    <form class="layui-form " method="post" id="pageListForm">
+    <table class="layui-table mt10">
+        <thead>
+        <tr>
+            <th><input type="checkbox" lay-skin="primary" lay-filter="allChoose">文件名</th>
+            <th width="200">文件大小</th>
+            <th width="200">修改时间</th>
+        </tr>
+        </thead>
+
+        {if condition="$ischild eq 1"}
+        <tr><td colspan="3"><a href="{:url('images/index',['path'=>$uppath])}">...返回上级目录</a></td></tr>
+        {/if}
+
+            {volist name="files" id="vo"}
+            <tr>
+                {if condition="$vo.isfile eq 1"}
+                <th><input type="checkbox" name="ids[]" value=".{$vo.path}" class="layui-checkbox checkbox-ids" lay-skin="primary"> <a href="{$vo.path}" target="_blank">{$vo.name}</a></th>
+                <td>{$vo.size}</td>
+                <td>{$vo.time|mac_day=color}</td>
+                {else}
+                <th><a href="{:url('images/index',['path'=>$vo.path])}">{$vo.name}</a></th>
+                <td></td>
+                <td></td>
+                {/if}
+            </tr>
+            {/volist}
+        </tbody>
+        <tfoot>
+            <tr><td colspan="3">本目录下共有<b class="red">{$num_path}</b>个目录,<b class="red">{$num_file}</b>个文件,占用<b class="red">{$sum_size}</b>空间</td></tr>
+        </tfoot>
+    </table>
+    </form>
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+<script type="text/javascript">
+
+    layui.use(['element', 'layer'], function() {
+
+
+    });
+</script>
+</body>
+</html>

+ 75 - 0
application/admin/view/images/opt.html

@@ -0,0 +1,75 @@
+{include file="../../../application/admin/view/public/head" /}
+<div class="page-container p10">
+
+    <form class="layui-form " method="post" action="{:url('sync')}">
+        <input type="hidden" name="tab" value="{$tab}">
+        <fieldset class="layui-elem-field">
+            <legend>同步范围</legend>
+            <div class="layui-field-box">
+                <div class="layui-form-item">
+                        <div class="layui-input-inline" style="width: 110px;">
+                            <input type="radio" checked value="1" name="range" title="全部数据">
+                        </div>
+                        <div class="layui-input-inline" style="width: 110px;">
+                            <input type="radio" value="2" name="range" title="数据日期">
+                        </div>
+                        <div class="layui-input-inline" style="width: 100px;">
+                            <input type="text" name="date" required  placeholder="" autocomplete="off" class="layui-input" value="{:date('Y-m-d')}">
+                        </div>
+                </div>
+            </div>
+        </fieldset>
+
+        <fieldset class="layui-elem-field">
+            <legend>同步选项</legend>
+            <div class="layui-field-box">
+                <div class="layui-form-item">
+                    <div class="layui-input-inline" style="width: 110px;">
+                        <input type="radio"  value="0" name="opt" title="全部">
+                    </div>
+                    <div class="layui-input-inline" style="width: 110px;">
+                        <input type="radio" value="1" name="opt" title="非出错图">
+                    </div>
+                    <div class="layui-input-inline" style="width: 120px;">
+                        <input type="radio" checked value="2" name="opt" title="非当天错图">
+                    </div>
+                    <div class="layui-input-inline" style="width: 110px;">
+                        <input type="radio" value="3" name="opt" title="出错图">
+                    </div>
+                </div>
+            </div>
+        </fieldset>
+
+        <fieldset class="layui-elem-field">
+            <legend>同步字段-同步详情图片时,同步选项参数不起作用!</legend>
+            <div class="layui-field-box">
+                <div class="layui-form-item">
+                    <div class="layui-input-inline" style="width: 110px;">
+                        <input type="radio" checked value="1" name="col" title="主图">
+                    </div>
+                    <div class="layui-input-inline" style="width: 110px;">
+                        <input type="radio" value="2" name="col" title="详情图片">
+                    </div>
+                </div>
+            </div>
+        </fieldset>
+
+        <div class="layui-form-item">
+            <button type="submit" class="layui-btn btn_submit">开始执行</button>
+        </div>
+
+    </form>
+</div>
+{include file="../../../application/admin/view/public/foot" /}
+<script type="text/javascript">
+    layui.use(['element', 'layer'], function() {
+
+    });
+
+    $('.btn_submit').click(function(){
+        $('form').submit();
+    })
+
+</script>
+</body>
+</html>

+ 311 - 0
application/admin/view/index/index.html

@@ -0,0 +1,311 @@
+{include file="../../../application/admin/view/public/head" /}
+
+
+<style type="text/css">
+    .hs-iframe{width:100%;height:100%;}
+    .layui-tab-content {top: 41px; position: absolute; bottom: 0; width: 100%; padding: 0; }
+    .layui-tab-item{height:100%;}
+    .layui-tab-title .layui-this {background-color: #009688; color: #fff; }
+    .layui-tab-title .layui-this:after {border: none; }
+    .layui-tab-title li { border-right: 1px solid #e6e6e6;}
+    .footer{position:fixed;left:0;bottom:0;z-index:998;}
+	
+
+
+</style>
+<div class="layui-layout layui-layout-admin">
+    <div class="layui-header header-top">
+	
+	<div class="top-logo">超级控制台</div>
+	<ul class="layout-right" lay-filter="">	
+		 <li class="nav-item">
+			<a href="__ROOT__/" target="_blank"><i class="layui-icon layui-icon-home size-14"></i></a>
+	     </li> 
+		 <li class="nav-item ">
+			   <a href="{:url('index/clear')}" class="j-ajax " refresh="yes"><i class="layui-icon layui-icon-delete size-16"></i></a>
+		 </li>
+		 <li class="nav-item">
+			   <a href="javascript:;" id="admin_name">
+                   <i class="layui-icon layui-icon-app  size-14"></i>
+			   </a>
+			 
+		 </li>
+	</ul>	
+		
+	</div>
+
+	<div class="layui-header">
+	    <div class="fl header-logo">超级控制台</div>
+		<div class="fl header-fold topLevelMenus"><a href="javascript:;" title="打开/关闭左侧导航" class="aicon ai-caidan" id="foldSwitch"><i class="layui-icon">&#xe65f;</i></a></div>
+		 <a href="javascript:;" class=" site-tree-mobile layui-mobile layui-show-xs-block layui-hide-lg"><i class="layui-icon layui-icon-spread-left size-20"></i></a>
+	    <div class="bottom-nav">	
+		  <ul class="layui-nav fl nobg main-nav " >
+            {volist name="menus" id="vo"}
+            {if condition="($i eq 1)"}
+               <li class="layui-nav-item layui-this main-nav mob-nav" data-i="{$i}">
+                {else /}
+               <li class="layui-nav-item main-nav mob-nav">
+                {/if}
+                <a href="javascript:;" data-i="{$i}">{$vo['name']}</a>
+			  </li>
+             {/volist}
+           </ul>
+			<ul class="layui-nav layui-layout-right" lay-filter="">
+				 <li class="layui-nav-item layui-hide-xs">
+					<a href="javascript:void(0);">{$Think.cookie.admin_name}&nbsp;&nbsp;</a>
+					<dl class="layui-nav-child">
+						<dd><a href="__ROOT__/" target="_blank">网站首页</a></dd>
+						<dd><a href="javascript:void(0);" id="lockScreen">锁屏操作</a></dd>
+						<dd><a href="{:url('index/logout')}">退出登陆</a></dd>
+					</dl>
+				</li>
+				<li class="layui-nav-item layui-hide-xs">
+                <a href="javascript:void(0);" >缓存&nbsp;&nbsp;</a>
+                <dl class="layui-nav-child">
+                    <dd><a href="{:url('index/clear')}" class="j-ajax" refresh="yes">清理缓存</a></dd>
+                </dl>
+            </li>
+			</ul>
+		</div>
+	</div>
+ 
+	<div class="nav-item-ul">
+	  <div class="">
+		  <ul class="layui-nav">
+			  <li class="layui-nav-item"><a href="__ROOT__/" target="_blank">网站首页</a></li>
+			  <li class="layui-nav-item"><a href="javascript:void(0);" id="lockScreen">锁屏操作</a></li>
+			  <li class="layui-nav-item"><a href="{:url('index/clear')}" class="j-ajax" refresh="yes">清理缓存</a></li>
+			  <li class="layui-nav-item"><a href="{:url('index/logout')}">退出登陆</a></li>
+		  </ul>
+		
+	  </div>
+	</div>
+
+    <div class="layui-side layui-bg-black" id="switchNav">
+        <div class="layui-side-scroll navBar" id="navBar">
+            {volist name="menus" id="v"}
+            {if condition="($i eq 1)"}
+            <ul class="layui-nav layui-nav-tree">
+                {else /}
+                <ul class="layui-nav layui-nav-tree" style="display:none;">
+                    {/if}
+                    <li class="layui-nav-item layui-nav-itemed">
+                    <a href="javascript:;"><i class="{$v['icon']}"></i>{$v['name']}<span class="layui-nav-more"></span></a>
+
+                    <dl class="layui-nav-child">
+                        {volist name="v['sub']" id="vv" key="kk"}
+                        <dd>
+                            {if condition="($vv['url'] !=='###')"}
+                            <a class="admin-nav-item" data-id="{$key}{$kk}" href="{$vv['url']}"><i class="{$vv['icon']}"></i> {$vv['name']}</a>
+                            {else}
+                            <hr class="layui-bg-gray">
+                            {/if}
+                        </dd>
+                        {/volist}
+                    </dl>
+                    </li>
+                </ul>
+                {/volist}
+        </div>
+    </div>
+    <div class="site-tree-mobile layui-hide">
+        <i class="layui-icon"></i>
+    </div>
+    <div class="site-mobile-shade"></div>
+
+    <div class="layui-body" id="switchBody">
+        <div class="layui-tab mag0" id="top_tabs_box" lay-filter="macTab" lay-allowClose="true">
+            <div class="tab-go-refresh" id="J_refresh"><i class="layui-icon layui-icon-refresh"></i></div>
+            <div class="tab-go-left" id="page-prev"><i class="layui-icon layui-icon-zuozuo"></i></div>
+            <ul class="layui-tab-title top_tab" id="B_history">
+                <li lay-id="111" class="layui-this">欢迎页面</li>
+            </ul>
+            <div class="tab-right">
+                <div class="tab-go-right" id="page-next"><i class="layui-icon layui-icon-youyou"></i></div>
+                <ul class="layui-nav closeBox">
+                    <li class="layui-nav-item" >
+                        <a href="javascript:;">操作</a>
+                        <dl class="layui-nav-child">
+                            <dd><a href="javascript:;" class="closePageAll">&nbsp;关闭全部</a></dd>
+                            <dd><a href="javascript:;" class="closePageOther">&nbsp;关闭其他</a></dd>
+                        </dl>
+                    </li>
+                </ul>
+            </div>
+            <div class="layui-tab-content">
+                <div class="layui-tab-item layui-show">
+                    <iframe lay-id="111" src="{:url('index/welcome')}" width="100%" height="100%" frameborder="0" scrolling="yes" class="hs-iframe"></iframe>
+                </div>
+            </div>
+
+        </div>
+
+    </div>
+
+    <div class="layui-footer footer">
+        <div class="fl"></div>
+        <div class="fr"> © MacCMS All Rights Reserved.</div>
+    </div>
+</div>
+
+{include file="../../../application/admin/view/public/foot" /}
+<!--请在下方写此页面业务相关的脚本-->
+<script>
+    window.localStorage.clear();
+    var LAYUI_OFFSET = 60;
+	
+	$('#admin_name').click(function(){
+		 $('body').toggleClass('drawer-body-right');
+	})
+</script>
+
+<script type="text/javascript">
+    layui.use(['element', 'layer'], function() {
+        var $ = layui.jquery, element = layui.element, layer = layui.layer;
+        $('.layui-tab-content').height($(window).height() - 145);
+        var tab = {
+            add: function(title, url, id) {
+                element.tabAdd('macTab', {
+                        title: title,
+                        content: '<iframe width="100%" height="100%" lay-id="'+id+'" frameborder="0" src="'+url+'" scrolling="yes" class="x-iframe"></iframe>',
+                        id: id
+            });
+            }, change: function(id) {
+                element.tabChange('macTab', id);
+            }
+        };
+        $('.admin-nav-item').click(function(event) {
+            var that = $(this);
+            var id = that.attr('data-id');
+            if ($('iframe[lay-id="'+id+'"]')[0]) {
+                tab.change(id);
+                event.stopPropagation();
+                $("iframe[lay-id='"+id+"']")[0].contentWindow.location.reload(true);//切换后刷新框架
+                return false;
+            }
+            if ($('iframe').length == 10) {
+                layer.msg('最多可打开10个标签页');
+                return false;
+            }
+            that.css({color:'#fff'});
+            tab.add(that.text(), that.attr('href'), that.attr('data-id'));
+            tab.change(that.attr('data-id'));
+            event.stopPropagation();
+            return false;
+        });
+        $(document).on('click', '.layui-tab-close', function() {
+            $('.layui-nav-child a[data-id="'+$(this).parent('li').attr('lay-id')+'"]').css({color:'rgba(255,255,255,.7)'});
+        });
+
+
+        //显示顶部导航时作位置判断,点击左边菜单、上一tab、下一tab时公用
+        function showTab(li) {
+            if (li.length) {
+                var ul = $('#B_history'),
+                    li_offset = li.offset(),
+                    li_width = li.outerWidth(true),
+                    next_left = $('#page-next').offset().left, //右边按钮的界限位置
+                    prev_right = $('#page-prev').offset().left + $('#page-prev').outerWidth(true); //左边按钮的界限位置
+                if (li_offset.left + li_width > next_left) { //如果将要移动的元素在不可见的右边,则需要移动
+                    var distance = li_offset.left + li_width - next_left; //计算当前父元素的右边距离,算出右移多少像素
+                    ul.animate({
+                        left: '-=' + distance
+                    }, 200, 'swing');
+                } else if (li_offset.left < prev_right) { //如果将要移动的元素在不可见的左边,则需要移动
+                    var distance = prev_right - li_offset.left; //计算当前父元素的左边距离,算出左移多少像素
+                    ul.animate({
+                        left: '+=' + distance
+                    }, 200, 'swing');
+                }
+                li.trigger('click');
+            }
+        }
+
+        //上一个选项卡
+        $('#page-prev').click(function(e) {
+            e.preventDefault();
+            e.stopPropagation();
+            var ul = $('#B_history'),
+                current = ul.find('.layui-this'),
+                li = current.prev('li');
+            showTab(li);
+        });
+
+
+        //下一个选项卡
+        $('#page-next').click(function(e) {
+            e.preventDefault();
+            e.stopPropagation();
+            var ul = $('#B_history'),
+                current = ul.find('.layui-this'),
+                li = current.next('li');
+            showTab(li);
+        });
+
+        //刷新
+        $('#J_refresh').click(function(e) {
+            e.preventDefault();
+            e.stopPropagation();
+            var index = layer.load();
+            var id = $('#B_history .layui-this').attr('lay-id'),
+                iframe = $("iframe[lay-id='"+id+"']")[0];
+            if (iframe.contentWindow) {
+                iframe.contentWindow.location.reload(true);
+                layer.close(index);
+            }
+        });
+
+        //关闭全部选项卡
+        $(".closePageAll").on("click", function() {
+            if ($("#B_history li").length > 1) {
+                $("#B_history li").each(function() {
+                    data_id = $(this).attr('lay-id');
+                    if (data_id != '' && data_id != '111') {
+                        element.tabDelete("macTab", data_id);
+                        $("iframe[lay-id='"+data_id+"']").remove(); //移除iframe页面
+                    }
+                })
+
+            } else {
+                layer.msg("没有可以关闭的窗口了@_@");
+            }
+        });
+        //关闭其他选项卡
+        $(".closePageOther").on("click", function() {
+            if ($("#B_history li").length > 1) {
+                var cid = $('#B_history .layui-this').attr('lay-id');
+                $("#B_history li").each(function() {
+                    data_id = $(this).attr('lay-id');
+                    if (data_id != '' && data_id != '111' && data_id != cid) {
+                        element.tabDelete("macTab", data_id);
+                        $("iframe[lay-id='"+data_id+"']").remove(); //移除iframe页面
+                    }
+                })
+
+            } else {
+                layer.msg("没有可以关闭的窗口了@_@");
+            }
+        });
+
+        $('.mob-nav').on("click", function() {
+            $('.site-tree-mobile').click();
+        });
+        //手机设备的简单适配
+        var treeMobile = $('.site-tree-mobile'),
+            shadeMobile = $('.site-mobile-shade')
+        treeMobile.on('click', function() {
+            $('body').addClass('site-mobile');
+            $('.Menus-winner').removeClass('topLevelMenus');//解决top导航
+            $('.Menus-winner').addClass('topLevelMenus-winner');//解决top导航
+
+        });
+        shadeMobile.on('click', function() {
+            $('body').removeClass('site-mobile');
+            $('.Menus-winner').addClass('topLevelMenus');//解决top导航
+        });
+
+    });
+</script>
+
+</body>
+</html>

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini