From 1d6d24eb9deefe8788abe0470e9de6c5a8bf691e Mon Sep 17 00:00:00 2001 From: Anyon Date: Wed, 3 May 2017 11:07:29 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E6=B7=BB=E5=8A=A0=E7=B2=89?= =?UTF-8?q?=E4=B8=9D=E6=A0=87=E7=AD=BE=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/wechat/controller/Tags.php | 79 +++++++++++++++++++++++++ application/wechat/view/tags.index.html | 79 +++++++++++++++++++++++++ composer.json | 64 ++++++++++---------- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 14 ++--- vendor/composer/autoload_static.php | 8 +-- 6 files changed, 202 insertions(+), 44 deletions(-) create mode 100644 application/wechat/controller/Tags.php create mode 100644 application/wechat/view/tags.index.html diff --git a/application/wechat/controller/Tags.php b/application/wechat/controller/Tags.php new file mode 100644 index 000000000..0d0ca3a7a --- /dev/null +++ b/application/wechat/controller/Tags.php @@ -0,0 +1,79 @@ + + * @date 2017/03/27 14:43 + */ +class Tags extends BasicAdmin { + + /** + * 定义当前默认数据表 + * @var string + */ + protected $table = 'WechatFansTags'; + + /** + * 显示粉丝标签列表 + * @return array|string + */ + public function index() { + $this->title = '微信粉丝标签管理'; + $db = Db::name($this->table)->order('id asc'); + $get = $this->request->get(); + foreach (['name'] as $key) { + if (isset($get[$key]) && $get[$key] !== '') { + $db->where($key, 'like', "%{$get[$key]}%"); + } + } + return parent::_list($db); + } + + /** + * 添加粉丝标签 + */ + public function add() { + + } + + /** + * 编辑粉丝标签 + */ + public function edit() { + + } + + /** + * 同步粉丝标签列表 + */ + public function sync() { + Db::name($this->table)->where('1=1')->delete(); + if (WechatService::syncFansTags()) { + LogService::write('微信管理', '同步全部微信粉丝标签成功'); + $this->success('同步获取所有粉丝标签成功!', ''); + } + $this->error('同步获取粉丝标签失败,请稍候再试!'); + } + +} diff --git a/application/wechat/view/tags.index.html b/application/wechat/view/tags.index.html new file mode 100644 index 000000000..c042d12f8 --- /dev/null +++ b/application/wechat/view/tags.index.html @@ -0,0 +1,79 @@ +{extend name='extra@admin/content' /} + +{block name="button"} +
+ + +
+{/block} + +{block name="content"} + + + + + +
+ + + + + + + + + + + + + + {foreach $list as $key=>$vo} + + + + + + + + + {/foreach} + +
+ + ID标签类型粉丝数操作
+ + {$vo.id|default='0'}{$vo.name|default=''}{$vo.id<100 ? "系统标签" : "自定义标签"}{$vo.count|default=''} + {if auth("$classuri/edit")} + | + 编辑 + {/if} + {if auth("$classuri/del")} + | + {if $vo.id >= 100} + 删除 + {else} + 删除 + {/if} + {/if} +
+ {if isset($page)}

{$page}

{/if} +
+{/block} \ No newline at end of file diff --git a/composer.json b/composer.json index a30cae806..7b87e5c3c 100644 --- a/composer.json +++ b/composer.json @@ -1,35 +1,35 @@ { - "name": "topthink/think", - "description": "the new thinkphp framework", - "type": "project", - "keywords": [ - "framework", - "thinkphp", - "ORM" - ], - "homepage": "http://thinkphp.cn/", - "license": "Apache-2.0", - "authors": [ - { - "name": "liu21st", - "email": "liu21st@gmail.com" + "name": "topthink/think", + "description": "the new thinkphp framework", + "type": "project", + "keywords": [ + "framework", + "thinkphp", + "ORM" + ], + "homepage": "http://thinkphp.cn/", + "license": "Apache-2.0", + "authors": [ + { + "name": "liu21st", + "email": "liu21st@gmail.com" + } + ], + "require": { + "php": ">=5.4.0", + "qiniu/php-sdk": "^7.0", + "zoujingli/wechat-php-sdk": "dev-master", + "zoujingli/ip2region": "^1.0", + "topthink/framework": "^5.0", + "topthink/think-captcha": "^1.0", + "topthink/think-mongo": "^1.1", + "topthink/think-queue": "^1.0", + "endroid/qrcode": "^1.9" + }, + "extra": { + "think-path": "thinkphp" + }, + "config": { + "preferred-install": "dist" } - ], - "require": { - "php": ">=5.4.0", - "qiniu/php-sdk": "^7.0", - "zoujingli/wechat-php-sdk": "dev-master", - "zoujingli/ip2region": "^1.0", - "topthink/framework": "^5.0", - "topthink/think-captcha": "^1.0", - "topthink/think-mongo": "^1.1", - "topthink/think-queue": "^1.0", - "endroid/qrcode": "^1.9" - }, - "extra": { - "think-path": "thinkphp" - }, - "config": { - "preferred-install": "dist" - } } diff --git a/vendor/autoload.php b/vendor/autoload.php index 28dfc0407..fc8e44c10 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit25f262128a8b880e0632e899b112c332::getLoader(); +return ComposerAutoloaderInitf3ef7a459e4b29cdf35865d01f6cf929::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 7fe78416a..c421d1d38 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit25f262128a8b880e0632e899b112c332 +class ComposerAutoloaderInitf3ef7a459e4b29cdf35865d01f6cf929 { private static $loader; @@ -19,15 +19,15 @@ class ComposerAutoloaderInit25f262128a8b880e0632e899b112c332 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit25f262128a8b880e0632e899b112c332', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitf3ef7a459e4b29cdf35865d01f6cf929', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit25f262128a8b880e0632e899b112c332', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitf3ef7a459e4b29cdf35865d01f6cf929', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION'); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit25f262128a8b880e0632e899b112c332::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitf3ef7a459e4b29cdf35865d01f6cf929::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -48,19 +48,19 @@ class ComposerAutoloaderInit25f262128a8b880e0632e899b112c332 $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit25f262128a8b880e0632e899b112c332::$files; + $includeFiles = Composer\Autoload\ComposerStaticInitf3ef7a459e4b29cdf35865d01f6cf929::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire25f262128a8b880e0632e899b112c332($fileIdentifier, $file); + composerRequiref3ef7a459e4b29cdf35865d01f6cf929($fileIdentifier, $file); } return $loader; } } -function composerRequire25f262128a8b880e0632e899b112c332($fileIdentifier, $file) +function composerRequiref3ef7a459e4b29cdf35865d01f6cf929($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 07169e401..9fa69c889 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit25f262128a8b880e0632e899b112c332 +class ComposerStaticInitf3ef7a459e4b29cdf35865d01f6cf929 { public static $files = array ( '9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php', @@ -314,9 +314,9 @@ class ComposerStaticInit25f262128a8b880e0632e899b112c332 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit25f262128a8b880e0632e899b112c332::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit25f262128a8b880e0632e899b112c332::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit25f262128a8b880e0632e899b112c332::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitf3ef7a459e4b29cdf35865d01f6cf929::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitf3ef7a459e4b29cdf35865d01f6cf929::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitf3ef7a459e4b29cdf35865d01f6cf929::$classMap; }, null, ClassLoader::class); }