application/app/controller/Index.php

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
namespace app\app\controller;

use think\facade\Request;

use app\common\controller\CommonApp;
use app\common\service\Weixin;
use app\common\service\Template;

use app\common\model\ArticleCategory;
use app\common\model\Article;
use app\common\model\Product;
use app\common\model\ProductCategory;
use app\common\model\Store;
use app\common\model\Coupon;
use app\common\model\WeixinShare;

/**
 * 微信主页
 */
class Index extends CommonApp
{
	public function Index()
	{

        //普通游客或普通会员用户
        
        //如没有缓存创造全局缓存
        $Template = new Template();
        if(!($Template->indxTemplateCache('get'))){
            $Template->indxTemplateCache('create');//创建缓存
        }
        //读取缓存
        $cache = $Template->indxTemplateCache('get');

        $this->assign('cache',$cache);

        //判断页面是否关注
        $wxSubscribe = 0;//是否关注
        if($this->userWxInfo){
            $fansInfo = $this->userWxInfo;
            if($fansInfo['is_subscribe'] == 1)$wxSubscribe = 1;
        }

        $this->assign('wxSubscribe', $wxSubscribe);

        $time = time();
        
        //优惠券
        if(isset($cache['golbal']['coupon']['list']) && $cache['golbal']['coupon']['list']){
            $couponList = explode(',',$cache['golbal']['coupon']['list']);
            $couponIndex = array();
            foreach ($couponList as $key => $value) {

                $whereCoupon = array();
                $whereCoupon[] = array('total_num', '>', 0);
                $whereCoupon[] = array('limit_num', '>', 0);
                $whereCoupon[] = array('add_time', '<', $time);
                $whereCoupon[] = array('expire_time', '>', $time);
                $whereCoupon[] = array('status', '=', 1);
后面还有 49 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。