12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Bear
- * Date: 2020/2/4
- * Time: 下午12:14
- */
- namespace app\admin\controller\wechat;
- use app\common\controller\Backend;
- use app\common\library\Redis;
- use app\common\service\DesService;
- use app\main\constants\CacheConstants;
- use \think\Config;
- class Toutiao extends Backend
- {
- public function index()
- {
- $token = DesService::instance()->encode($this->auth->id);
- $token = urlencode($token);
- if (!Config::get('site.tturl')) {
- $url = Config::get('site.url_root');
- } else {
- $url = Config::get('site.tturl');
- }
- $url = Config::get('site.scheme') . '://' . $url . "/index/guidewxsubscribe/index?token=$token";
- $new = Redis::instance()->get(CacheConstants::getGuideWxNewCount($this->auth->id));
- $pay = Redis::instance()->get(CacheConstants::getGuideWxPayCount($this->auth->id));
- $this->assign('new', $new > 0 ? $new : 0);
- $this->assign('pay', $pay > 0 ? $pay : 0);
- $this->assign('url', $url);
- return $this->view->fetch();
- }
- }
|