mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]添加粉丝标签模块
This commit is contained in:
parent
ddeeec6b56
commit
1d6d24eb9d
79
application/wechat/controller/Tags.php
Normal file
79
application/wechat/controller/Tags.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | Think.Admin
|
||||
// +----------------------------------------------------------------------
|
||||
// | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网站: http://think.ctolog.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | 开源协议 ( https://mit-license.org )
|
||||
// +----------------------------------------------------------------------
|
||||
// | github开源项目:https://github.com/zoujingli/Think.Admin
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\wechat\controller;
|
||||
|
||||
use controller\BasicAdmin;
|
||||
use service\LogService;
|
||||
use service\WechatService;
|
||||
use think\Db;
|
||||
|
||||
/**
|
||||
* 微信粉丝标签管理
|
||||
* Class Tags
|
||||
* @package app\wechat\controller
|
||||
* @author Anyon <zoujingli@qq.com>
|
||||
* @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('同步获取粉丝标签失败,请稍候再试!');
|
||||
}
|
||||
|
||||
}
|
79
application/wechat/view/tags.index.html
Normal file
79
application/wechat/view/tags.index.html
Normal file
@ -0,0 +1,79 @@
|
||||
{extend name='extra@admin/content' /}
|
||||
|
||||
{block name="button"}
|
||||
<div class="nowrap pull-right" style="margin-top:10px">
|
||||
<button data-load="{:url('add')}" class='layui-btn layui-btn-small'><i class='fa fa-referer'></i> 添加标签</button>
|
||||
<button data-load="{:url('sync')}" class='layui-btn layui-btn-small'><i class='fa fa-plus-square-o'></i> 同步标签</button>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{block name="content"}
|
||||
|
||||
<!-- 表单搜索 开始 -->
|
||||
<form class="animated form-search" action="__SELF__" onsubmit="return false" method="get">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-3">
|
||||
<div class="form-group">
|
||||
<input type="text" name="name" value="{$Think.get.name|default=''}" placeholder="标签" class="input-sm form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-1">
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-sm btn-white"><i class="fa fa-search"></i> 搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<!-- 表单搜索 结束 -->
|
||||
|
||||
<form onsubmit="return false;" data-auto="" method="POST">
|
||||
<input type="hidden" value="resort" name="action"/>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='list-table-check-td'>
|
||||
<input data-none-auto="" data-check-target='.list-check-box' type='checkbox'/>
|
||||
</th>
|
||||
<th class='text-center'>ID</th>
|
||||
<th class='text-center'>标签</th>
|
||||
<th class='text-center'>类型</th>
|
||||
<th class='text-center'>粉丝数</th>
|
||||
<th class='text-center'>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $list as $key=>$vo}
|
||||
<tr>
|
||||
<td class='list-table-check-td'>
|
||||
<input class="list-check-box" value='{$vo.id}' type='checkbox'/>
|
||||
</td>
|
||||
<td class='text-center'>{$vo.id|default='0'}</td>
|
||||
<td class='text-center'>{$vo.name|default=''}</td>
|
||||
<td class='text-center'>{$vo.id<100 ? "系统标签" : "自定义标签"}</td>
|
||||
<td class='text-center'>{$vo.count|default=''}</td>
|
||||
<td class='text-center nowrap'>
|
||||
{if auth("$classuri/edit")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-modal='{:url("$classuri/edit")}?id={$vo.id}' href="javascript:void(0)">编辑</a>
|
||||
{/if}
|
||||
{if auth("$classuri/del")}
|
||||
<span class="text-explode">|</span>
|
||||
{if $vo.id >= 100}
|
||||
<a data-update="{$vo.id}" data-field='delete' data-action='{:url("$classuri/del")}' href="javascript:void(0)">删除</a>
|
||||
{else}
|
||||
<a href="javascript:void(0)" style="color:#999">删除</a>
|
||||
{/if}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{if isset($page)}<p>{$page}</p>{/if}
|
||||
</form>
|
||||
{/block}
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit25f262128a8b880e0632e899b112c332::getLoader();
|
||||
return ComposerAutoloaderInitf3ef7a459e4b29cdf35865d01f6cf929::getLoader();
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -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;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user