application/index/controller/ShopDetail.php

(开头部分) 4KB

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

<?php
namespace app\index\controller;
use app\index\model\ShopSpace;
use app\index\model\GoodsSpace;
use app\index\model\CommontSpace;


class ShopDetail extends Base
{
    public function index()
    {
       $shop_status=$this->check_shop_status() ;
       if($shop_status !=2){return $this->fetch('ajax/tip', ['info'=>'该商店未营业']); }
       if(request()->param('id')){
        $ShopSpace = ShopSpace::get(['id' => request()->param('id')]);
        }
          if(request()->param('shop_uid')){
         $ShopSpace = ShopSpace::get(['shop_uid' => request()->param('shop_uid')]);
          }
        $ShopSpace->saw_num+=1;
        $ShopSpace->save();
        
          $arr = array(1, 2, 3, 4, 5);
        $this->assign('arr', $arr);
        
        $deal_avg_quality = CommontSpace::where(['commont_type' => 1, 'goods_uid' =>$ShopSpace['shop_uid'], "buy_method" => 3])->avg("quality");
        $deal_avg_service = CommontSpace::where(['commont_type' => 1, 'goods_uid' => $ShopSpace['shop_uid'], "buy_method" => 3])->avg("service");
        $deal_avg_speed = CommontSpace::where(['commont_type' => 1, 'goods_uid' => $ShopSpace['shop_uid'], "buy_method" => 3])->avg("speed");
         
       $deal_good_commont_num=CommontSpace::where(['commont_type' => 1,'commont_radio'=>1,'goods_uid' =>$ShopSpace['shop_uid'],"buy_method" => 3 ])->count();
         $deal_normal_commont_num=CommontSpace::where(['commont_type' => 1,'commont_radio'=>2,'goods_uid' =>$ShopSpace['shop_uid'],"buy_method" => 3])->count();
          $deal_bad_commont_num=CommontSpace::where(['commont_type' => 1,'commont_radio'=>3,'goods_uid' =>$ShopSpace['shop_uid'],"buy_method" => 3 ])->count();
         //商品 好评差评
         $goods_good_commont_num=CommontSpace::where(['commont_type' => 1,'commont_radio'=>1,'goods_uid' =>$ShopSpace['shop_uid']])->where('buy_method', 'null')->count();
         $goods_normal_commont_num=CommontSpace::where(['commont_type' => 1,'commont_radio'=>2,'goods_uid' =>$ShopSpace['shop_uid']])->where('buy_method', 'null')->count();
          $goods_bad_commont_num=CommontSpace::where(['commont_type' => 1,'commont_radio'=>3,'goods_uid' =>$ShopSpace['shop_uid']])->where('buy_method', 'null')->count();
       
          //商品 星级评分
          $goods_avg_quality=CommontSpace::where(['commont_type' => 1,'goods_uid' =>$ShopSpace['shop_uid']])->where('buy_method', 'null')->avg("quality");
         $goods_avg_service=CommontSpace::where(['commont_type' => 1,'goods_uid' =>$ShopSpace['shop_uid']])->where('buy_method', 'null')->avg("service");
          $goods_avg_speed=CommontSpace::where(['commont_type' => 1,'goods_uid' =>$ShopSpace['shop_uid']])->where('buy_method', 'null')->avg("speed");
//        ShopSpace::where(['shop_uid' => $feed_uid])->update(['deal_avg_total' => $deal_avg_total]);
        
        //          获得该店铺其他商品 开始   
       $goodslist_old = GoodsSpace::where(['pub_uid' => $ShopSpace['shop_uid'],'goods_status' => 2] )->order('update_time', 'asc')->select();
        foreach ($goodslist_old as $value) {
           $value['arr_pic']=explode(",", $value['pic']);
           $goodslist[]= $value;
        }
        $this->assign('goodslist', $goodslist);
      //          获得该店铺其他商品 结束    
        if($ShopSpace['pic']){
          $arr_pic=explode(",", $ShopSpace['pic']);
       } 
    
        $this->assign('deal_good_commont_num', $deal_good_commont_num);
            $this->assign('deal_normal_commont_num', $deal_normal_commont_num);
                $this->assign('deal_bad_commont_num', $deal_bad_commont_num);
       $this->assign('deal_avg_quality', $deal_avg_quality);
       $this->assign('deal_avg_service', $deal_avg_service);
后面还有 28 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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