<commit_before><?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 think\Db;

/**
 * 微信文章管理
 * Class Article
 * @package app\wechat\controller
 * @author Anyon <<EMAIL>>
 * @date 2017/03/27 14:43
 */
class Keys extends BasicAdmin {

    protected $table = 'WechatKeys';

    /**
     * 显示关键字列表
     */
    public function index() {
        $this->assign('title', '微信关键字');
        $db = Db::name($this->table)->where('keys', 'not in', ['subscribe', 'default']);
        $this->_list($db);
    }

    /**
     * 列表数据处理
     * @param array $data
     */
    protected function _index_data_filter(&$data) {
        $types = ['keys' => '关键字', 'image' => '图片', 'news' => '图文', 'music' => '音乐', 'text' => '文字', 'video' => '视频', 'voice' => '语音'];
        foreach ($data as &$vo) {
            $vo['type'] = isset($types[$vo['type']]) ? $types[$vo['type']] : $vo['type'];
        }
    }

    /**
     * 添加关键字
     * @return string
     */
    public function add() {
        $this->assign('title', '添加关键字规则');
        return $this->_form($this->table, 'form', 'id');
    }

    /**
     * 编辑关键字
     * @return string
     */
    public function edit() {
        $this->assign('title', '编辑关键字规则');
        return $this->_form($this->table, 'form', 'id');
    }

    public function subscribe() {

    }

    public function defaults() {

    }
}<commit_msg>[更新]微信关键字管理<commit_after><?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\DataService;
use think\Db;

/**
 * 微信文章管理
 * Class Article
 * @package app\wechat\controller
 * @author Anyon <<EMAIL>>
 * @date 2017/03/27 14:43
 */
class Keys extends BasicAdmin {

    protected $table = 'WechatKeys';

    /**
     * 显示关键字列表
     */
    public function index() {
        $this->assign('title', '微信关键字');
        $db = Db::name($this->table)->where('keys', 'not in', ['subscribe', 'default']);
        $this->_list($db);
    }

    /**
     * 列表数据处理
     * @param array $data
     */
    protected function _index_data_filter(&$data) {
        $types = ['keys' => '关键字', 'image' => '图片', 'news' => '图文', 'music' => '音乐', 'text' => '文字', 'video' => '视频', 'voice' => '语音'];
        foreach ($data as &$vo) {
            $vo['type'] = isset($types[$vo['type']]) ? $types[$vo['type']] : $vo['type'];
        }
    }

    /**
     * 添加关键字
     * @return string
     */
    public function add() {
        $this->assign('title', '添加关键字规则');
        return $this->_form($this->table, 'form', 'id');
    }

    /**
     * 编辑关键字
     * @return string
     */
    public function edit() {
        $this->assign('title', '编辑关键字规则');
        return $this->_form($this->table, 'form', 'id');
    }

    /**
     * 删除关键字
     */
    public function del() {
        if (DataService::update($this->table)) {
            $this->success("关键字删除成功！", '');
        }
        $this->error("关键字删除失败，请稍候再试！");
    }

    public function subscribe() {

    }

    public function defaults() {

    }
}
{'fraction_non_alphanumeric': 0.37131492746841366, 'fraction_numerical': 0.009358914365933552, 'mean_word_length': 1.254746835443038, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 44, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6121329', 'n_tokens_mistral': 1381, 'n_tokens_neox': 1421, 'n_words': 226}