浏览代码

底部导航

rkljw 4 月之前
父节点
当前提交
0f19162d2d

+ 1328 - 1279
app/JsonRpc/WebsiteService.php

@@ -1,1280 +1,1329 @@
-<?php
-namespace App\JsonRpc;
-use App\Model\Article;
-use App\Model\Ad;
-use App\Model\Category;
-use App\Model\AdPlace;
-use App\Model\Department;
-use App\Model\District;
-use App\Model\Link;
-use App\Model\LetterOfComplaint;
-use App\Model\TemplateClass;
-use App\Model\Template;
-use App\Model\User;
-use App\Model\WebsiteRole;
-use App\Model\WebsiteRoleUser;
-use App\Model\Website;
-use App\Model\WebsiteColumn;
-use Hyperf\DbConnection\Db;
-use Hyperf\RpcServer\Annotation\RpcService;
-use App\Tools\Result;
-use Carbon\Carbon;
-use App\Model\WebsiteCategory;
-use function PHPUnit\Framework\isNull;
-
-#[RpcService(name: "WebsiteService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
-class WebsiteService implements WebsiteServiceInterface
-{
-    /**
-     * @param string $keyword
-     * @param int $page
-     * @param int $pageSize
-     * @return array
-     */
-    public function getWebsitetList(array $data): array
-    {
-        $where = [];
-        if(isset($data['keyword']) && !empty($data['keyword'])){
-            array_push($where,['website.website_name','like','%'.$data['keyword'].'%']);
-        }
-        if(isset($data['website_column_id']) && !empty($data['website_column_id'])){
-            array_push($where,['website.website_column_id','=',$data['website_column_id']]);
-        }
-        if(isset($data['city_id']) && !empty($data['city_id'])){
-            array_push($where,['website.city_id','=',$data['city_id']]);
-        }
-
-        $result = Website::where($where)
-            ->leftJoin("website_column","website.website_column_id","website_column.id")
-            ->leftJoin("district","district.id","website.city_id")
-            ->select("website.*","website_column.column_name","district.name as city_name")
-            ->limit($data['pageSize'])->offset(($data['page']-1)*$data['pageSize'])->orderBy("website.id","desc")->get();
-
-        $count = Website::where($where)->count();
-        if (empty($result)) {
-            return Result::error("没有数据",0);
-        }
-        $data = [
-            'rows'=>$result->toArray(),
-            'count'=>$count
-        ];
-        return Result::success($data);
-    }
-
-    /**
-     * @param array $data
-     * @return array
-     */
-    public function createWebsite(array $data): array
-    {
-        var_dump("网站数据:",$data);
-        $insertData = [
-            'website_name'=>$data['website_name'],
-            'logo'=>$data['logo']??'',
-            'website_url'=>$data['website_url']??'',
-            'city_id'=>$data['city_id']??0,
-            'website_column_id'=>$data['website_column_id'],
-            'title'=>$data['title']??'',
-            'keywords'=>$data['keywords']??'',
-            'description'=>$data['description']??'',
-            'status'=>$data['status']??0,
-            'website_column_arr_id'=>$data['website_column_arr_id'],
-            'city_arr_id'=>$data['city_arr_id']??[0],
-            'template_id' =>$data['template_id']??0,
-        ];
-        $result = Website::insertGetId($insertData);
-        if(empty($result)){
-            return Result::error("创建失败",0);
-        }else{
-            return Result::success(["id"=>$result]);
-        }
-    }
-
-    /**
-     * @param int $id
-     * @param array $data
-     * @return array
-     */
-    public function updateWebsite(int $id,array $data): array
-    {
-        $insertData = [
-            'website_name'=>$data['website_name'],
-            'logo'=>$data['logo']??'',
-            'website_url'=>$data['website_url']??'',
-            'city_id'=>$data['city_id']??0,
-            'website_column_id'=>$data['website_column_id'],
-            'title'=>$data['title']??'',
-            'keywords'=>$data['keywords']??'',
-            'description'=>$data['description']??'',
-            'status'=>$data['status']??0,
-            'website_column_arr_id'=>$data['website_column_arr_id'],
-            'city_arr_id'=>$data['city_arr_id']??[0],
-            'template_id' =>$data['template_id']??0,
-        ];
-        $result = Website::where('id',$id)->update($insertData);
-        var_dump("更新站点",$result);
-        if(empty($result)){
-            return Result::error("更新失败",0);
-        }else{
-            return Result::success();
-        }
-    }
-
-    /**
-     * @param int $id
-     * @return array
-     */
-    public function delWebsite(int $id): array
-    {
-        $result = Website::where('id',$id )->delete();
-        if(empty($result)){
-            return Result::error("删除失败",0);
-        }else{
-            return Result::success();
-        }
-    }
-
-    /**
-     * @param int $id
-     * @return array
-     */
-    public function getWebsiteInfo(int $id): array
-    {
-
-        $where = [
-            ['website.id','=',$id]
-        ];
-        $result = Website::where($where )
-        ->leftJoin("template","template.id","website.template_id")
-        ->select("website.*","template.template_name","template.template_img")
-        ->first();
-        if(empty($result)){
-            return Result::error("数据不存在",0);
-        }else{
-            return Result::success($result->toArray());
-        }
-
-    }
-
-    /**
-     * 查询所有的站点栏目
-     * @return array
-     */
-    public function getWebsiteColumn(array $data): array
-    {
-        $result = WebsiteColumn::where($data)->get();
-        if(empty($result)){
-            return Result::error("数据不存在",0);
-        }else{
-            return Result::success($result->toArray());
-        }
-
-    }
-
-
-    /**
-     * @param string $keyword
-     * @param int $page
-     * @param int $pageSize
-     * @return array
-     */
-    public function getWebsiteColumnList(array $data):array
-    {
-        $where = [];
-        if(isset($data['keyword']) && $data['keyword']){
-            array_push($where,['website_column.column_name','like','%'.$data['keyword'].'%']);
-        }
-        $result = WebsiteColumn::where($where)
-            ->leftJoin("website_column as wc","website_column.pid","wc.id")
-            ->select("website_column.*","wc.column_name as parent_column_name")
-            ->limit($data['pageSize'])->offset(($data['page']-1)*$data['pageSize'])->get();
-        $count = WebsiteColumn::where($where)->count();
-        if (empty($result)) {
-            return Result::error("没有数据",0);
-        }
-        $data = [
-            'rows'=>$result->toArray(),
-            'count'=>$count
-        ];
-        return Result::success($data);
-    }
-
-    /**
-     * @param array $data
-     * @return array
-     */
-    public function createWebsiteColumn(array $data): array
-    {
-        $insertData = [
-            'column_name'=>$data['column_name'],
-            'pid'=>$data['pid']??'',
-            'column_arr_id'=>$data['column_arr_id']??[0],
-            'sort'=>$data['sort']??0,
-            'remark'=>$data['remark']??'',
-        ];
-        $result = WebsiteColumn::insertGetId($insertData);
-        if(empty($result)){
-            return Result::error("创建失败",0);
-        }else{
-            return Result::success(["id"=>$result]);
-        }
-    }
-
-    /**
-     * @param int $id
-     * @param array $data
-     * @return array
-     */
-    public function updateWebsiteColumn(int $id,array $data): array
-    {
-        $insertData = [
-            'column_name'=>$data['column_name'],
-            'pid'=>$data['pid']??'',
-            'column_arr_id'=>$data['column_arr_id']??[0],
-            'sort'=>$data['sort']??0,
-            'remark'=>$data['remark']??'',
-        ];
-        $result = WebsiteColumn::where('id',$id)->update($insertData);
-        if(empty($result)){
-            return Result::error("更新失败",0);
-        }else{
-            return Result::success();
-        }
-    }
-
-    /**
-     * @param int $id
-     * @return array
-     */
-    public function delWebsiteColumn(int $id): array
-    {
-        $list = WebsiteColumn::where(['pid'=>$id])->get();
-        if($list){
-            return Result::error("存在子网系,不能删除,请先删除子网系",0);
-        }
-        $result = WebsiteColumn::where('id',$id )->delete();
-        if(empty($result)){
-            return Result::error("删除失败",0);
-        }else{
-            return Result::success();
-        }
-    }
-
-    /**
-     * @param string $keyword
-     * @param int $page
-     * @param int $pageSize
-     * @return array
-     */
-    public function getWebsiteRoleList(string $keyword,int $page,int $pageSize,int $websiteId):array
-    {
-        $where = [
-            ['role.role_name','like','%'.$keyword.'%'],
-            ['website_role.website_id','=',$websiteId],
-        ];
-        $result = WebsiteRole::where($where)
-            ->leftJoin("role","role.id","website_role.role_id")
-            ->select("role.*","website_role.type","website_role.role_id","website_role.id as website_role_id","website_role.website_id")
-            ->limit($pageSize)->offset(($page-1)*$pageSize)->get();
-        $count = WebsiteRole::where($where) ->leftJoin("role","role.id","website_role.role_id")->count();
-        if (empty($result)) {
-            return Result::error("没有数据",0);
-        }
-        $data = [
-            'rows'=>$result->toArray(),
-            'count'=>$count
-        ];
-        return Result::success($data);
-    }
-
-
-    /**
-     * @param array $data
-     * @return array
-     */
-    public function createWebsiteRole(array $data): array
-    {
-
-        $insertData = [
-            'website_id'=>$data['website_id'],
-            'role_id'=>$data['role_id']??''
-        ];
-        $info = WebsiteRole::where($insertData)->first();
-        if($info){
-            return Result::error("不能重复添加角色",0);
-        }
-        $insertData['admin_user_id'] = $data['admin_user_id']??'';
-        $insertData['type'] = $data['type']??'';
-        $result = WebsiteRole::insertGetId($insertData);
-        if(empty($result)){
-            return Result::error("创建失败",0);
-        }else{
-            return Result::success(["id"=>$result]);
-        }
-    }
-
-    /**
-     * 暂时用不上
-     * @param int $id
-     * @param array $data
-     * @return array
-     */
-    public function updateWebsiteRole(int $id,array $data): array
-    {
-        $insertData = [
-            'website_id'=>$data['website_id'],
-            'type'=>$data['type']??'',
-        ];
-        $result = WebsiteRole::where('id',$id)->update($insertData);
-        if(empty($result)){
-            return Result::error("更新失败",0);
-        }else{
-            return Result::success();
-        }
-    }
-
-    /**
-     * @param int $id
-     * @return array
-     */
-    public function delWebsiteRole(int $id): array
-    {
-        $result = WebsiteRole::where('id',$id )->delete();
-        if(empty($result)){
-            return Result::error("删除失败",0);
-        }else{
-            return Result::success();
-        }
-    }
-
-
-    /**
-     * @param string $keyword
-     * @param int $page
-     * @param int $pageSize
-     * @return array
-     */
-    public function getWebsiteRoleUserList(string $keyword,int $page,int $pageSize,int $websiteId,int $roleId):array
-    {
-        $where = [
-            ['website_role_user.website_id','=',$websiteId],
-            ['website_role_user.role_id','=',$roleId],
-        ];
-        $count = WebsiteRoleUser::where($where)->count();
-        $where[] =   ['u.user_name','like','%'.$keyword.'%'];
-        $result = WebsiteRoleUser::where($where)
-            ->leftJoin("user as u","website_role_user.user_id","u.id")
-            ->leftJoin("website as w","website_role_user.website_id","u.id")
-            ->leftJoin("role as r","website_role_user.role_id","r.id")
-            ->select("u.*","u.user_name",'w.website_name','r.role_name','website_role_user.id as website_role_user_id','website_role_user.updated_at as user_update_at')
-            ->limit($pageSize)->offset(($page-1)*$pageSize)->get();
-
-        if (empty($result)) {
-            return Result::error("没有数据",0);
-        }
-        $data = [
-            'rows'=>$result->toArray(),
-            'count'=>$count
-        ];
-        return Result::success($data);
-    }
-
-    /**
-     * @param array $data
-     * @return array
-     */
-    public function createWebsiteRoleUser(array $data): array
-    {
-        $insertData = [
-            'website_id'=>$data['website_id'],
-            'user_id'=>$data['user_id']??'',
-        ];
-        $info = WebsiteRoleUser::where($insertData)->first();
-        if($info){
-            return Result::error("不能重复添加角色用户",0);
-        }
-        $insertData['role_id'] = $data['role_id']??'';
-        $insertData['admin_user_id'] = $data['admin_user_id']??'';
-        $insertData['type'] = $data['type']??'';
-        $result = WebsiteRoleUser::insertGetId($insertData);
-        if(empty($result)){
-            return Result::error("创建失败",0);
-        }else{
-            return Result::success(["id"=>$result]);
-        }
-    }
-
-    /**
-     * @param int $id
-     * @param array $data
-     * @return array
-     */
-    public function updateWebsiteRoleUser(int $id,array $data): array
-    {
-        $insertData = [
-            'website_id'=>$data['website_id'],
-            'type'=>$data['type']??'',
-            'type_id'=>$data['type_id']??'',
-            'role_id'=>$data['role_id']??'',
-        ];
-        $result = WebsiteRoleUser::where('id',$id)->update($insertData);
-        if(empty($result)){
-            return Result::error("更新失败",0);
-        }else{
-            return Result::success();
-        }
-    }
-
-    /**
-     * @param int $id
-     * @return array
-     */
-    public function delWebsiteRoleUser(int $id): array
-    {
-        $result = WebsiteRoleUser::where('id',$id )->delete();
-        if(empty($result)){
-            return Result::error("删除失败",0);
-        }else{
-            return Result::success();
-        }
-    }
-
-    /**
-     * 根据域名获取网站 站点id
-     * @param array $data
-     * @return array
-     */
-    public function getWebsiteId(array $data): array
-    {
-        $result = Website::whereJsonContains('website_url',$data['website_url'])->first();
-        if(empty($result)){
-            return Result::error("查询站点失败",0);
-        }else{
-            return Result::success($result);
-        }
-    }
-
-    /**
-     * 查询网站下面的导航
-     * @param array $data
-     * @return array
-     */
-    public function getWebsiteCategory(array $data): array
-    {
-        $where = [
-            'website_id'=>$data['website_id'],
-            'pid'=>0
-        ];
-        $result = WebsiteCategory::where($where)->orderBy('sort','asc')->get();
-        if(empty($result)){
-            return Result::error("查询站点栏目失败",0);
-        }else{
-            return Result::success($result);
-        }
-    }
-
-
-    /**
-     * 查询网站的广告
-     * @param array $data
-     * @return array
-     */
-    public function getWebsiteAdvertisement(array $data): array
-    {
-        $where = [
-            'website_id' => 1,
-            'id' => $data['ad_placeid']
-        ];
-        
-        //查询这个广告位是否存在
-        $ad_place = AdPlace::where($where)->orderBy('id','asc')->first();    
-        
-        var_dump("==========",$ad_place);
-        if(empty($ad_place)){
-            return Result::error("error",0);
-        }else{
-            $adplaceid = $ad_place['id'];
-            //查找有没有广告
-            $ad=Ad::where('pid',$adplaceid['id'])->where('status',1)->orderBy('id','asc')->get();
-            if(empty($ad)){
-                //若没有生效的广告,则显示默认的缩略图
-                $result=$adplaceid;
-                return Result::success($result); 
-            }else{  
-                //查找在生效时间的广告    
-                $today = Carbon::now();             
-                foreach($ad as $i)
-                {
-                    $starttime=Carbon::parse($i['fromtime']);
-                    $endtime=Carbon::parse($i['totime']);
-                    $time=$today->between($starttime,$endtime);
-                    if($time)
-                    {
-                        $result=$i;
-                    }
-                }
-                if(empty($result)){
-                    $result=$ad;
-                    return Result::success($result); 
-                }else{
-                    return Result::success($result); 
-                }
-            }
-                
-        } 
-    }
-
-
-     /**
-     * 
-     * @param array $data
-     * @return array
-     */
-    /**网站行政职能搜索 */
-    public function selectWebsiteDepartment(array $data): array
-    {
-
-        $depart = Department::where('pid',0)->orderBy('id','asc')->limit(10)->get();
-        if(isset($data['keyword']) && !empty($data['keyword'])){
-            $departments= Department::where('name', 'like', '%' . $data['keyword'] . '%')->get();
-            if(empty($departments)){
-                $result['message']="未查询到与此相关职能部门";
-            }else{
-                $count = Department::where('name','like',"%{$data['keyword']}%")->count();
-                $m = [
-                    'department'=>$depart,
-                    'type'=>$departments,
-                    'count'=>$count
-                ]; 
-            }
-            
-            $result['sele'] = $m;
-            return Result::success($result['sele']); 
-            
-        }
-        $result=$depart;
-        return Result::success($result['data']); 
-    }
-
-
-    /**
-     * 
-     * @param array $data
-     * @return array
-     */
-    /**
-     * 搜索地区
-     */
-    public function selectWebsiteArea(array $data): array
-    {
-       
-        $provinces=District::where('pid',0)->where('status',1)->get();
-       
-        if(isset($data['province'])){
-            $province=District::where('pid',0)->where('status',1)->where('id',$data['province'])->orderBy('id')->get();
-            $province=$province->toArray();
-            if(!empty($province)){
-                $citys=District::where('pid',$data['province'])->where('status',1)->orderBy('id')->get();
-                if(!empty($citys) && isset($data['city']) && !empty($data['city'])){
-                    // $province = $province->toArray();
-                    $province_id=[];
-                    foreach($province as $val){
-                        array_push($province_id,$val['id']);
-                    }
-                    // var_dump($province_id);
-                    $city=District::whereIn('pid',$province_id)->where('status',1)->where('id',$data['city'])->orderBy('id')->get();
-                    if(!empty($city)){
-                        $city_id=[];
-                        foreach($city as $val){
-                            array_push($city_id,$val['id']);
-                        }
-                        $regions=District::whereIn('pid',$city_id)->where('status',1)->orderBy('id')->get();
-                       
-                            $result=[
-                                'province' => $province,
-                                'city' => $city,
-                                'region' => $regions
-                            ];
-                    }else{
-                        return Result::error("未查询到此城市",0); 
-                    }
-                }else{
-                    $result=[
-                        'province' => $province,
-                        'city' => $citys,
-                        'region' => null
-                    ];
-                }
-            }else{
-                return Result::error("未查询到此省份",0);
-            }
-        }else{
-            // $keys = array('data');
-           $result =  $provinces;
-        }
-        return Result::success($result);  
-    }
-
-
-    /**
-     * 获取栏目
-     * @param array $data
-     * @return array
-     */
-    public function getWebsiteModelCategory(array $data): array
-    {
-        $website_id=[
-            'website_id' => $data['website_id']
-        ];
-        $placeid=$data['placeid']-1;
-        $pid=[
-            'pid' => $data['pid'],
-        ];
-        $num = $data['num'];
-        
-        $result=WebsiteCategory::where($website_id)->where($pid)->orderBy('sort')->offset($placeid)->limit($num)->get();
-        $result = $result->toArray();
-        if(!empty($result)){
-            return Result::success($result); 
-        }else{
-            return Result::error("本网站暂无栏目",0);
-        }
-
-    }
-
-
-    /**
-     * 获取友情链接
-     * @param array $data
-     * @return array
-     */
-    public function selectWebsiteLinks(array $data): array
-    {
-        $where = [
-            'website_id' => $data['website_id'],
-            'status' => 1,
-            'type' => $data['type']
-        ];
-        $num=$data['num'];
-        $result=Link::where($where)->orderBy('id')->limit($num)->get();
-        if(!empty($result)){
-            return Result::success($result); 
-        }else{
-            return Result::error("本网站暂无此类型友情链接",0);
-        }
-    }
-
-
-    /**
-     * 网站首页数据统计, 管理员
-     * @return void
-     */
-    public function getAdminIndex(array $data): array
-    {
-        var_dump("用户类型:",$data['type_id']);
-         switch ($data['type_id']){
-             case 4:
-                 $result  = Db::select('SELECT  DATE(created_at) AS date,COUNT(*) AS total_count FROM  letter_of_complaint  WHERE  created_at >= CURDATE() - INTERVAL 30 DAY  GROUP BY  DATE(created_at)  ORDER BY  date ASC;');
-                 return Result::success($result);
-                 break;
-             case 10000:
-                 $res = [];
-                 //网站
-                 $res['website']['count'] = 0;
-                 $res['website']['growth_rate'] = 0;
-                 //资讯
-                 $res['article']['count'] = 0;
-                 $res['article']['growth_rate'] = 0;
-                 //导航池
-                 $res['category']['count'] = 0;
-                 $res['category']['growth_rate'] = 0;
-                 //近一月数据
-                 $res['monthArticle']= [];
-                 //用户类型
-                 $res['userType'] = [];
-                 $res['website']['count']  = Website::where([])->count();
-                 $res['article']['count']  = Article::whereNotIn('status',['404'])->count();
-                 $res['category']['count']  = Category::where([])->count();
-                 $res['monthArticle']   = Db::select('SELECT  DATE(created_at) AS date,COUNT(*) AS total_count FROM  article  WHERE  created_at >= CURDATE() - INTERVAL 30 DAY  GROUP BY  DATE(created_at)  ORDER BY  date ASC;');
-                 $res['userType']  = User::where([])->selectRaw("count(*) as counts,type_id")->groupBy('type_id')->get();
-                 return Result::success($res);
-
-         }
-
-         return [];
-    }
-
-    /**
-     * 获取模板类型
-     * @return void
-     */
-    public function getTemplateClass(array $data): array
-    {
-        $where = [];
-        if(isset($data['name']) && $data['name']){
-            array_push($where,['name','like','%'.$data['name'].'%']);
-        }
-        $result = TemplateClass::where($where)->orderBy('sort','asc')->get();
-        if(empty($result)){
-            return Result::error("没有模板类型",0);
-        }else{
-            return Result::success($result);
-        }
-    }
-
-    /**
-     * 添加模板类型
-     * @param
-     * @return void
-     */
-    public function addTemplateClass(array $data): array
-    {
-        $insertData = [
-            'name'=>$data['name']
-        ];
-        $result = TemplateClass::insertGetId($insertData);
-        if(empty($result)){
-            return Result::error("创建失败",0);
-        }else{
-            return Result::success(["id"=>$result]);
-        }
-    }
-
-    /**
-     * 更新模板
-     * @param array $data
-     * @return array
-     */
-    public function upTemplateClass(array $data): array
-    {
-        $where = [
-            'id'=>$data['id']
-        ];
-        $insertData = [
-            'name'=>$data['name']
-        ];
-        $result = TemplateClass::where($where)->update($insertData);
-        if(empty($result)){
-            return Result::error("更新失败",0);
-        }else{
-            return Result::success();
-        }
-    }
-
-    /**
-     * 删除模板
-     * @param array $data
-     * @return array
-     */
-    public function delTemplateClass(array $data): array
-    {
-        $where = [
-            'id'=>$data['id']
-        ];
-
-        $result = TemplateClass::where($where)->delete();
-        if(empty($result)){
-            return Result::error("删除失败",0);
-        }else{
-            return Result::success();
-        }
-    }
-
-    /**
-     * 获取分类下的模板
-     * @param array $data
-     * @return array
-     */
-    public function getTemplate(array $data): array
-    {
-        $page = $data['page'];
-        $pageSize = $data['pageSize'];
-        $where = [];
-        if(isset($data['template_class_id'])  && $data['template_class_id']){
-            array_push($where,['template_class_id','=',$data['template_class_id']]);
-        }
-        $result = Template::where($where)
-            ->limit($pageSize)->offset(($page-1)*$pageSize)->get();
-        $count = Template::where($where)->count();
-        if (empty($result)) {
-            return Result::error("没有数据",0);
-        }
-        $data = [
-            'rows'=>$result->toArray(),
-            'count'=>$count
-        ];
-        return Result::success($data);
-    }
-
-    /**
-     * 创建模板
-     * @param
-     * @return void
-     */
-    public function addTemplate(array $data): array
-    {
-        $insertData = [
-            'template_name'=>$data['template_name'],
-            'template_img'=>json_encode($data['template_img']),
-            'template_class_id'=>$data['template_class_id'],
-        ];
-        $result = Template::insertGetId($insertData);
-        if(empty($result)){
-            return Result::error("创建模板失败",0);
-        }else{
-            return Result::success(["id"=>$result]);
-        }
-    }
-
-    /**
-     * 更新模板
-     * @param array $data
-     * @return array
-     */
-    public function upTemplate(array $data): array
-    {
-        $where = [
-            'id'=>$data['id']
-        ];
-        $insertData = [
-            'template_name'=>$data['template_name'],
-            'template_img'=>json_encode($data['template_img']),
-            'template_class_id'=>$data['template_class_id'],
-        ];
-        $result = Template::where($where)->update($insertData);
-        if(empty($result)){
-            return Result::error("更新模板失败",0);
-        }else{
-            return Result::success();
-        }
-    }
-
-    /**
-     * 删除模板
-     * @param array $data
-     * @return array
-     */
-    public function delTemplate(array $data): array
-    {
-        $where = [
-            'id'=>$data['id']
-        ];
-        $result = Template::where($where)->delete();
-        if(empty($result)){
-            return Result::error("删除模板失败",0);
-        }else{
-            return Result::success();
-        }
-    }
-
-    /**
-     * 搜索网站
-     * @param array $data
-     * @return array
-     */
-    public function websiteList(array $data): array
-    {
-        $where = [];
-        if(isset($data['keyword']) && !empty($data['keyword'])){
-            array_push($where,['website.website_name','like','%'.$data['keyword'].'%']);
-        }
-        $result = Website::where($where)->get();
-        if($result){
-            return Result::success($result);
-        }else{
-            return Result::error("没有网站",0);
-        }
-    }
-
-    public function addWebsiteCategory(array $data): array
-    {
-        $website_id = $data['website_id'];
-        $category_arr_id = $data['category_arr_id'];
-        $categoryList = Category::whereIn('id',$category_arr_id)->get();
-        $categoryListIds = [];
-        if($categoryList){
-            foreach ($categoryList->toArray() as $val){
-                array_push($categoryListIds,$val['id']);
-            }
-        }
-        $arr = [];
-        if($categoryListIds){
-            foreach ($categoryListIds as $v){
-                $ids =  $this->getUnderlingUIds(intval($v));
-                $ids_arr = explode(",", $ids);
-                array_push($arr,$ids_arr);
-            }
-        }
-        $mergedArray = [];
-        foreach ($arr as $subarray) {
-            $mergedArray = array_merge($mergedArray, $subarray);
-        }
-        var_dump("所有:",$arr,$mergedArray);
-        //查询出所有的分类进行分割插入 组装数据
-        $categoryListData = Category::whereIn('id',$mergedArray)->get();
-        $categoryListData = $categoryListData->toArray();
-        $insertData = [];
-        if($categoryListData){
-            foreach ($categoryListData as $key=>$value){
-                $insertData[$key]['website_id'] = $website_id;
-                $insertData[$key]['name'] = $value['name'];
-                $insertData[$key]['sort'] = $value['sort'];
-                $insertData[$key]['pid'] = $value['pid'];
-                $insertData[$key]['pid_arr'] = $value['pid_arr'];
-                $insertData[$key]['seo_title'] = $value['seo_title'];
-                $insertData[$key]['seo_keywords'] = $value['seo_keywords'];
-                $insertData[$key]['seo_description'] = $value['seo_description'];
-                $insertData[$key]['alias'] = $value['name'];
-                $insertData[$key]['category_id'] = $value['id'];
-            }
-        }
-        $result = WebsiteCategory::insert($insertData);
-        var_dump("插入数据状态:",$result);
-        if($result){
-            return Result::success($result);
-        }else{
-            return Result::error("创建失败",0);
-        }
-    }
-
-
-
-    /**
-     * 删除网站导航
-     * @param array $data
-     * @return array
-     */
-    public function delWebsiteCategory(array $data): array
-    {
-        $website_id = $data['website_id']??0;
-        $category_id = $data['category_id']??0;
-        $ids =  $this->getUnderlingUIds(intval($category_id));
-        $ids_arr = explode(",", $ids);
-        $result = WebsiteCategory::where(['website_id'=>$website_id])->whereIn("category_id",$ids_arr)->delete();
-        if($result){
-            return Result::success($result);
-        }else{
-            return Result::error("删除失败",0);
-        }
-    }
-
-    /**
-     * 获取网站导航
-     * @param array $data
-     * @return array
-     */
-    public function getAdminWebsiteCategory(array $data): array
-    {
-        $where = [
-            'website_id'=>$data['website_id'],
-            'pid'=>0
-        ];
-        $result = WebsiteCategory::where($where)->get();
-        if($result){
-            return Result::success($result);
-        }else{
-            return Result::error("查询失败",0);
-        }
-    }
-
-    /**
-     * 更新网站导航
-     * @param array $data
-     * @return array
-     */
-    public function upWebsiteCategory(array $data): array
-    {
-        Db::beginTransaction();
-        try{
-           //合并栏目id
-            $reqIds = array_merge($data['old_category_arr_id'],$data['new_category_arr_id']);
-            //对比old 数组差异化,把差异化的删除
-            $result = WebsiteCategory::where(['website_id'=>$data['website_id'],'pid'=>0])->get();
-            $result = $result->toArray();
-            $categoryIds = [];
-            if($result){
-                foreach ($result as $val){
-                    array_push($categoryIds,$val['category_id']);
-                }
-            }
-            //和原始数据对比取交际
-            $reqidsIntersect = array_intersect($reqIds,$categoryIds);
-            //再取差集 进行对比
-            $differenceIDS =  array_merge(array_diff($reqidsIntersect, $categoryIds),array_diff($categoryIds,$reqidsIntersect));
-            var_dump("差集:",$differenceIDS);
-            $arr_ids = [];
-            if(count($differenceIDS)>0){
-                foreach ($differenceIDS as $vv){
-                    $idV =  $this->getUnderlingUIds(intval($vv));
-                    $ids_arrV = explode(",", $idV);
-                    array_push($arr_ids,$ids_arrV);
-                }
-            }
-           $del_ids = array_reduce($arr_ids, 'array_merge', array());
-            //有差异  删除
-            if(count($del_ids)>0){
-                 WebsiteCategory::where(['website_id'=>$data['website_id']])->whereIn("category_id",$del_ids)->delete();
-            }
-            //传过来的值 和 交际 对比,选出要添加的值 进行插入
-           $insertIDS =  array_merge(array_diff($reqIds, $reqidsIntersect),array_diff($reqidsIntersect,$reqIds));
-            var_dump("要存储的:",$insertIDS);
-            //新的数组重新创建
-            if(count($insertIDS)>0){
-                $arr = [];
-                $categoryListIds = $insertIDS;
-                if($categoryListIds){
-                    foreach ($categoryListIds as $v){
-                        $ids =  $this->getUnderlingUIds(intval($v));
-                        $ids_arr = explode(",", $ids);
-                        array_push($arr,$ids_arr);
-                    }
-                }
-                $mergedArray = [];
-                foreach ($arr as $subarray) {
-                    $mergedArray = array_merge($mergedArray, $subarray);
-                }
-                var_dump("要插入的ID:",$mergedArray);
-                //查询出所有的分类进行分割插入 组装数据
-                $categoryListData = Category::whereIn('id',$mergedArray)->get();
-                $categoryListData = $categoryListData->toArray();
-                $insertData = [];
-                if($categoryListData){
-                    foreach ($categoryListData as $key=>$value){
-                        $insertData[$key]['website_id'] = $data['website_id'];
-                        $insertData[$key]['name'] = $value['name'];
-                        $insertData[$key]['sort'] = $value['sort'];
-                        $insertData[$key]['pid'] = $value['pid'];
-                        $insertData[$key]['pid_arr'] = $value['pid_arr'];
-                        $insertData[$key]['seo_title'] = $value['seo_title'];
-                        $insertData[$key]['seo_keywords'] = $value['seo_keywords'];
-                        $insertData[$key]['seo_description'] = $value['seo_description'];
-                        $insertData[$key]['alias'] = $value['name'];
-                        $insertData[$key]['category_id'] = $value['id'];
-                    }
-                }
-                 WebsiteCategory::insert($insertData);
-
-            }
-            Db::commit();
-        } catch(\Throwable $ex){
-            Db::rollBack();
-            var_dump($ex->getMessage());
-            return Result::error("修改失败",0);
-        }
-
-        return Result::success();
-    }
-
-    /**
-     * 获取网站列表
-     * @param array $data
-     * @return array
-     */
-    public function getWebsiteCategoryList(array $data): array
-    {
-        $where = [];
-        if(isset($data['keyword']) && !empty($data['keyword'])){
-            array_push($where,['website.website_name','like','%'.$data['keyword'].'%']);
-        }
-        if(isset($data['website_column_id']) && !empty($data['website_column_id'])){
-            array_push($where,['website.website_column_id','=',$data['website_column_id']]);
-        }
-        $result = Website::where($where)
-            ->with(["websiteCategory"=>function ($query) {
-                $query->where(['pid'=>0])->select('website_id','name','alias','category_id');
-            }])
-            ->orderBy('created_at','desc')
-            ->limit($data['pageSize'])->offset(($data['page']-1)*$data['pageSize'])
-            ->get();
-
-        $count = Website::where($where)->count();
-        if (empty($result)) {
-            return Result::error("没有数据",0);
-        }
-        $data = [
-            'rows'=>$result->toArray(),
-            'count'=>$count
-        ];
-         if($result){
-             return Result::success($data);
-         }else{
-             return Result::error("查询失败",0);
-         } 
-    }
-
-    /**
-     * 删除网站下的所有导航
-     * @param array $data
-     * @return array
-     */
-    public function delWebsiteAllCategory(array $data): array
-    {
-        $website_id = $data['website_id'];
-        $result = WebsiteCategory::where(['website_id'=>$website_id])->delete();
-        if($result){
-            return Result::success($result);
-        }else{
-            return Result::error("删除失败",0);
-        }
-    }
-
-    /**
-     * 获取网站下的某一个导航
-     * @param array $data
-     * @return array
-     */
-    public function getWebsiteCategoryOnes(array $data): array
-    {
-        $website_id = $data['website_id'];
-        $category_id = $data['category_id'];
-        $result = WebsiteCategory::where(['website_category.website_id'=>$website_id,'website_category.category_id'=>$category_id])
-            ->first();
-        if($result){
-            return Result::success($result);
-        }else{
-            return Result::error("查询失败",0);
-        }
-    }
-
-    /**
-     * 更新网闸下的某一个导航
-     * @param array $data
-     * @return array
-     */
-    public function upWebsiteCategoryones(array $data): array
-    {
-        $where = [
-            'website_id'=>$data['website_id'],
-            'category_id'=>$data['category_id'],
-        ];
-        $result = WebsiteCategory::where($where)->update($data);
-        if($result){
-            return Result::success($result);
-        }else{
-            return Result::error("更新失败",0);
-        }
-    }
-
-    /**
-     * 获取网站下的所有导航(包含子导航)
-     * @param array $data
-     * @return array
-     */
-    public function getWebsiteAllCategory(array $data): array
-    {
-        $where = [];
-        if(isset($data['website_id']) && !empty($data['website_id'])){
-            array_push($where,['website_category.website_id','=',$data['website_id']]);
-        }
-        if(isset($data['name']) && !empty($data['name'])){
-            array_push($where,['website_category.name','like','%'.$data['name'].'%']);
-        }
-        if(isset($data['alias']) && !empty($data['alias'])){
-            array_push($where,['website_category.alias','like','%'.$data['alias'].'%']);
-        }
-        if(isset($data['department_id']) && !empty($data['department_id'])){
-            array_push($where,['category.department_id','=',$data['department_id']]);
-        }
-        if(isset($data['city_id']) && !empty($data['city_id'])){
-            array_push($where,['category.city_id','=',$data['city_id']]);
-        }
-        $result = WebsiteCategory::where($where)
-            ->leftJoin("category",'website_category.category_id','category.id')
-            ->leftJoin("department",'category.department_id','department.id')
-            ->leftJoin("district",'category.city_id','district.id')
-            ->select("website_category.*","department.name as department_name","district.name as city_name")
-            ->limit($data['pageSize'])->offset(($data['page']-1)*$data['pageSize'])
-            ->get();
-
-        $count = WebsiteCategory::where($where)
-            ->leftJoin("category",'website_category.category_id','category.id')
-            ->leftJoin("department",'category.department_id','department.id')
-            ->leftJoin("district",'category.city_id','district.id')
-            ->count();
-        if (empty($result)) {
-            return Result::error("没有数据",0);
-        }
-        $data = [
-            'rows'=>$result->toArray(),
-            'count'=>$count
-        ];
-        if($result){
-            return Result::success($data);
-        }else{
-            return Result::error("查询失败",0);
-        }
-        if($result){
-            return Result::success($result);
-        }else{
-            return Result::error("查询失败",0);
-        }
-    }
-
-    /**
-     * 递归查询数据
-     * @param $id
-     * @param $ids
-     * @return string
-     */
-    public function getUnderlingUIds($id, $ids='')
-    {
-        $back =  Category::where(['pid'=>$id])->get();
-        $back = $back->toArray();
-        if (!empty($back) && is_array($back)) {
-            foreach ($back as $v) {
-                //防止当前人的ID重复去查询,形成恶性循环
-                if ($v['id'] == $id) {
-                    continue;
-                }
-                $back2 =  Category::where(['pid'=>$id])->count('id');
-                if ($back2 > 0) {
-                    $ids = $this->getUnderlingUIds($v['id'],$ids);
-                } else {
-                    $ids .= ','.$v['id'];
-                }
-            }
-        }
-        $ids = $id.','.$ids.',';
-        $ids = str_replace(',,', ",", $ids);
-        $ids = trim($ids, ',');
-        return $ids;
-    }
-
-    /**
-     * 检测网站名称是否重复
-     * @param array $data
-     * @return array
-     */
-    public function checkWebsiteName(array $data): array
-    {
-        if(isset($data['id'])){
-            $data[] = ['id',"!=",$data['id']];
-            unset($data['id']);
-        }
-        $websiteInfo = Website::query()->where($data)->first();
-        if (empty($websiteInfo)) {
-            return Result::error("找不到网站",0);
-        }
-        return Result::success($websiteInfo->toArray());
-    }
-
-    /**
-     * 检测网站url是否重复
-     * @param array $data
-     * @return array
-     */
-    public function checkWebsiteUrl(array $data): array
-    {
-        $whereData = [];
-        if(isset($data['id'])){
-            $whereData = [['id',"!=",$data['id']]];
-            unset($data['id']);
-        }
-        $websiteInfo = Website::query()->where($whereData)->whereJsonContains('website_url', $data['website_url'])->first();
-        if (empty($websiteInfo)) {
-            return Result::error("找不到URL",0);
-        }
-        return Result::success($websiteInfo->toArray());
-    }
-
+<?php
+namespace App\JsonRpc;
+use App\Model\Article;
+use App\Model\Category;
+use App\Model\FooterCategory;
+use App\Model\FooterContent;
+use App\Model\LetterOfComplaint;
+use App\Model\Sector;
+use App\Model\TemplateClass;
+use App\Model\Template;
+use App\Model\User;
+use App\Model\WebsiteRole;
+use App\Model\WebsiteRoleUser;
+use App\Model\Website;
+use App\Model\WebsiteColumn;
+use App\Model\WebsiteTemplate;
+use Hyperf\DbConnection\Db;
+use Hyperf\RpcServer\Annotation\RpcService;
+use App\Tools\Result;
+use App\Model\WebsiteCategory;
+use function PHPUnit\Framework\isNull;
+use App\Model\Component;
+
+#[RpcService(name: "WebsiteService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
+class WebsiteService implements WebsiteServiceInterface
+{
+    /**
+     * @param string $keyword
+     * @param int $page
+     * @param int $pageSize
+     * @return array
+     */
+    public function getWebsitetList(array $data): array
+    {
+        $where = [];
+        if(isset($data['keyword']) && !empty($data['keyword'])){
+            array_push($where,['website.website_name','like','%'.$data['keyword'].'%']);
+        }
+        if(isset($data['website_column_id']) && !empty($data['website_column_id'])){
+            array_push($where,['website.website_column_id','=',$data['website_column_id']]);
+        }
+        if(isset($data['city_id']) && !empty($data['city_id'])){
+            array_push($where,['website.city_id','=',$data['city_id']]);
+        }
+
+        $result = Website::where($where)
+            ->leftJoin("website_column","website.website_column_id","website_column.id")
+            ->leftJoin("district","district.id","website.city_id")
+            ->select("website.*","website_column.column_name","district.name as city_name")
+            ->limit($data['pageSize'])->offset(($data['page']-1)*$data['pageSize'])->orderBy("website.id","desc")->get();
+
+        $count = Website::where($where)->count();
+        if (empty($result)) {
+            return Result::error("没有数据",0);
+        }
+        $data = [
+            'rows'=>$result->toArray(),
+            'count'=>$count
+        ];
+        return Result::success($data);
+    }
+
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function createWebsite(array $data): array
+    {
+        var_dump("网站数据:",$data);
+        $insertData = [
+            'website_name'=>$data['website_name'],
+            'logo'=>$data['logo']??'',
+            'website_url'=>$data['website_url']??'',
+            'city_id'=>$data['city_id']??0,
+            'website_column_id'=>$data['website_column_id'],
+            'title'=>$data['title']??'',
+            'keywords'=>$data['keywords']??'',
+            'description'=>$data['description']??'',
+            'status'=>$data['status']??0,
+            'website_column_arr_id'=>$data['website_column_arr_id'],
+            'city_arr_id'=>$data['city_arr_id']??[0],
+            'template_id' =>$data['template_id']??0,
+        ];
+        $result = Website::insertGetId($insertData);
+        if(empty($result)){
+            return Result::error("创建失败",0);
+        }else{
+            return Result::success(["id"=>$result]);
+        }
+    }
+
+    /**
+     * @param int $id
+     * @param array $data
+     * @return array
+     */
+    public function updateWebsite(int $id,array $data): array
+    {
+        $insertData = [
+            'website_name'=>$data['website_name'],
+            'logo'=>$data['logo']??'',
+            'website_url'=>$data['website_url']??'',
+            'city_id'=>$data['city_id']??0,
+            'website_column_id'=>$data['website_column_id'],
+            'title'=>$data['title']??'',
+            'keywords'=>$data['keywords']??'',
+            'description'=>$data['description']??'',
+            'status'=>$data['status']??0,
+            'website_column_arr_id'=>$data['website_column_arr_id'],
+            'city_arr_id'=>$data['city_arr_id']??[0],
+            'template_id' =>$data['template_id']??0,
+        ];
+        $result = Website::where('id',$id)->update($insertData);
+        var_dump("更新站点",$result);
+        if(empty($result)){
+            return Result::error("更新失败",0);
+        }else{
+            return Result::success();
+        }
+    }
+
+    /**
+     * @param int $id
+     * @return array
+     */
+    public function delWebsite(int $id): array
+    {
+        $result = Website::where('id',$id )->delete();
+        if(empty($result)){
+            return Result::error("删除失败",0);
+        }else{
+            return Result::success();
+        }
+    }
+
+    /**
+     * @param int $id
+     * @return array
+     */
+    public function getWebsiteInfo(int $id): array
+    {
+
+        $where = [
+            ['website.id','=',$id]
+        ];
+        $result = Website::where($where )
+        ->leftJoin("website_template_info","website_template_info.website_id","website.id")
+        ->select("website.*",
+            "website_template_info.template_id",
+            "website_template_info.page_type",
+            "website_template_info.statement",
+            "website_template_info.organizer",
+            "website_template_info.copyright_information",
+            "website_template_info.contact_number",
+            "website_template_info.company_address",
+            "website_template_info.project_logo",
+            "website_template_info.project_name",
+            "website_template_info.project_url",
+            "website_template_info.company_logo",
+            "website_template_info.company_name",
+            "website_template_info.company_url",
+            "website_template_info.record_number",
+            "website_template_info.record_number_url",
+            "website_template_info.icp_number",
+            "website_template_info.icp_number_url",
+            "website_template_info.customer_service_qq",
+            "website_template_info.communications",
+            "website_template_info.status",
+        )
+        ->first();
+        if(empty($result)){
+            return Result::error("数据不存在",0);
+        }else{
+            return Result::success($result->toArray());
+        }
+
+    }
+
+    /**
+     * 查询所有的站点栏目
+     * @return array
+     */
+    public function getWebsiteColumn(array $data): array
+    {
+        $result = WebsiteColumn::where($data)->get();
+        if(empty($result)){
+            return Result::error("数据不存在",0);
+        }else{
+            return Result::success($result->toArray());
+        }
+
+    }
+
+
+    /**
+     * @param string $keyword
+     * @param int $page
+     * @param int $pageSize
+     * @return array
+     */
+    public function getWebsiteColumnList(array $data):array
+    {
+        $where = [];
+        if(isset($data['keyword']) && $data['keyword']){
+            array_push($where,['website_column.column_name','like','%'.$data['keyword'].'%']);
+        }
+        $result = WebsiteColumn::where($where)
+            ->leftJoin("website_column as wc","website_column.pid","wc.id")
+            ->select("website_column.*","wc.column_name as parent_column_name")
+            ->limit($data['pageSize'])->offset(($data['page']-1)*$data['pageSize'])->get();
+        $count = WebsiteColumn::where($where)->count();
+        if (empty($result)) {
+            return Result::error("没有数据",0);
+        }
+        $data = [
+            'rows'=>$result->toArray(),
+            'count'=>$count
+        ];
+        return Result::success($data);
+    }
+
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function createWebsiteColumn(array $data): array
+    {
+        $insertData = [
+            'column_name'=>$data['column_name'],
+            'pid'=>$data['pid']??'',
+            'column_arr_id'=>$data['column_arr_id']??[0],
+            'sort'=>$data['sort']??0,
+            'remark'=>$data['remark']??'',
+        ];
+        $result = WebsiteColumn::insertGetId($insertData);
+        if(empty($result)){
+            return Result::error("创建失败",0);
+        }else{
+            return Result::success(["id"=>$result]);
+        }
+    }
+
+    /**
+     * @param int $id
+     * @param array $data
+     * @return array
+     */
+    public function updateWebsiteColumn(int $id,array $data): array
+    {
+        $insertData = [
+            'column_name'=>$data['column_name'],
+            'pid'=>$data['pid']??'',
+            'column_arr_id'=>$data['column_arr_id']??[0],
+            'sort'=>$data['sort']??0,
+            'remark'=>$data['remark']??'',
+        ];
+        $result = WebsiteColumn::where('id',$id)->update($insertData);
+        if(empty($result)){
+            return Result::error("更新失败",0);
+        }else{
+            return Result::success();
+        }
+    }
+
+    /**
+     * @param int $id
+     * @return array
+     */
+    public function delWebsiteColumn(int $id): array
+    {
+        $list = WebsiteColumn::where(['pid'=>$id])->get();
+        if($list){
+            return Result::error("存在子网系,不能删除,请先删除子网系",0);
+        }
+        $result = WebsiteColumn::where('id',$id )->delete();
+        if(empty($result)){
+            return Result::error("删除失败",0);
+        }else{
+            return Result::success();
+        }
+    }
+
+    /**
+     * @param string $keyword
+     * @param int $page
+     * @param int $pageSize
+     * @return array
+     */
+    public function getWebsiteRoleList(string $keyword,int $page,int $pageSize,int $websiteId):array
+    {
+        $where = [
+            ['role.role_name','like','%'.$keyword.'%'],
+            ['website_role.website_id','=',$websiteId],
+        ];
+        $result = WebsiteRole::where($where)
+            ->leftJoin("role","role.id","website_role.role_id")
+            ->select("role.*","website_role.type","website_role.role_id","website_role.id as website_role_id","website_role.website_id")
+            ->limit($pageSize)->offset(($page-1)*$pageSize)->get();
+        $count = WebsiteRole::where($where) ->leftJoin("role","role.id","website_role.role_id")->count();
+        if (empty($result)) {
+            return Result::error("没有数据",0);
+        }
+        $data = [
+            'rows'=>$result->toArray(),
+            'count'=>$count
+        ];
+        return Result::success($data);
+    }
+
+
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function createWebsiteRole(array $data): array
+    {
+
+        $insertData = [
+            'website_id'=>$data['website_id'],
+            'role_id'=>$data['role_id']??''
+        ];
+        $info = WebsiteRole::where($insertData)->first();
+        if($info){
+            return Result::error("不能重复添加角色",0);
+        }
+        $insertData['admin_user_id'] = $data['admin_user_id']??'';
+        $insertData['type'] = $data['type']??'';
+        $result = WebsiteRole::insertGetId($insertData);
+        if(empty($result)){
+            return Result::error("创建失败",0);
+        }else{
+            return Result::success(["id"=>$result]);
+        }
+    }
+
+    /**
+     * 暂时用不上
+     * @param int $id
+     * @param array $data
+     * @return array
+     */
+    public function updateWebsiteRole(int $id,array $data): array
+    {
+        $insertData = [
+            'website_id'=>$data['website_id'],
+            'type'=>$data['type']??'',
+        ];
+        $result = WebsiteRole::where('id',$id)->update($insertData);
+        if(empty($result)){
+            return Result::error("更新失败",0);
+        }else{
+            return Result::success();
+        }
+    }
+
+    /**
+     * @param int $id
+     * @return array
+     */
+    public function delWebsiteRole(int $id): array
+    {
+        $result = WebsiteRole::where('id',$id )->delete();
+        if(empty($result)){
+            return Result::error("删除失败",0);
+        }else{
+            return Result::success();
+        }
+    }
+
+
+    /**
+     * @param string $keyword
+     * @param int $page
+     * @param int $pageSize
+     * @return array
+     */
+    public function getWebsiteRoleUserList(string $keyword,int $page,int $pageSize,int $websiteId,int $roleId):array
+    {
+        $where = [
+            ['website_role_user.website_id','=',$websiteId],
+            ['website_role_user.role_id','=',$roleId],
+        ];
+        $count = WebsiteRoleUser::where($where)->count();
+        $where[] =   ['u.user_name','like','%'.$keyword.'%'];
+        $result = WebsiteRoleUser::where($where)
+            ->leftJoin("user as u","website_role_user.user_id","u.id")
+            ->leftJoin("website as w","website_role_user.website_id","u.id")
+            ->leftJoin("role as r","website_role_user.role_id","r.id")
+            ->select("u.*","u.user_name",'w.website_name','r.role_name','website_role_user.id as website_role_user_id','website_role_user.updated_at as user_update_at')
+            ->limit($pageSize)->offset(($page-1)*$pageSize)->get();
+
+        if (empty($result)) {
+            return Result::error("没有数据",0);
+        }
+        $data = [
+            'rows'=>$result->toArray(),
+            'count'=>$count
+        ];
+        return Result::success($data);
+    }
+
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function createWebsiteRoleUser(array $data): array
+    {
+        $insertData = [
+            'website_id'=>$data['website_id'],
+            'user_id'=>$data['user_id']??'',
+        ];
+        $info = WebsiteRoleUser::where($insertData)->first();
+        if($info){
+            return Result::error("不能重复添加角色用户",0);
+        }
+        $insertData['role_id'] = $data['role_id']??'';
+        $insertData['admin_user_id'] = $data['admin_user_id']??'';
+        $insertData['type'] = $data['type']??'';
+        $result = WebsiteRoleUser::insertGetId($insertData);
+        if(empty($result)){
+            return Result::error("创建失败",0);
+        }else{
+            return Result::success(["id"=>$result]);
+        }
+    }
+
+    /**
+     * @param int $id
+     * @param array $data
+     * @return array
+     */
+    public function updateWebsiteRoleUser(int $id,array $data): array
+    {
+        $insertData = [
+            'website_id'=>$data['website_id'],
+            'type'=>$data['type']??'',
+            'type_id'=>$data['type_id']??'',
+            'role_id'=>$data['role_id']??'',
+        ];
+        $result = WebsiteRoleUser::where('id',$id)->update($insertData);
+        if(empty($result)){
+            return Result::error("更新失败",0);
+        }else{
+            return Result::success();
+        }
+    }
+
+    /**
+     * @param int $id
+     * @return array
+     */
+    public function delWebsiteRoleUser(int $id): array
+    {
+        $result = WebsiteRoleUser::where('id',$id )->delete();
+        if(empty($result)){
+            return Result::error("删除失败",0);
+        }else{
+            return Result::success();
+        }
+    }
+
+    /**
+     * 根据域名获取网站 站点id
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteId(array $data): array
+    {
+        $result = Website::whereJsonContains('website_url',$data['website_url'])->first();
+        if(empty($result)){
+            return Result::error("查询站点失败",0);
+        }else{
+            return Result::success($result);
+        }
+    }
+
+    /**
+     * 查询网站下面的导航
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteCategory(array $data): array
+    {
+        $where = [
+            'website_id'=>$data['website_id'],
+            'pid'=>0
+        ];
+        $result = WebsiteCategory::where($where)->orderBy('sort','asc')->get();
+        if(empty($result)){
+            return Result::error("查询站点栏目失败",0);
+        }else{
+            return Result::success($result);
+        }
+    }
+
+    /**
+     * 网站首页数据统计, 管理员
+     * @return void
+     */
+    public function getAdminIndex(array $data): array
+    {
+        var_dump("用户类型:",$data['type_id']);
+         switch ($data['type_id']){
+             case 4:
+                 $result  = Db::select('SELECT  DATE(created_at) AS date,COUNT(*) AS total_count FROM  letter_of_complaint  WHERE  created_at >= CURDATE() - INTERVAL 30 DAY  GROUP BY  DATE(created_at)  ORDER BY  date ASC;');
+                 return Result::success($result);
+                 break;
+             case 10000:
+                 $res = [];
+                 //网站
+                 $res['website']['count'] = 0;
+                 $res['website']['growth_rate'] = 0;
+                 //资讯
+                 $res['article']['count'] = 0;
+                 $res['article']['growth_rate'] = 0;
+                 //导航池
+                 $res['category']['count'] = 0;
+                 $res['category']['growth_rate'] = 0;
+                 //近一月数据
+                 $res['monthArticle']= [];
+                 //用户类型
+                 $res['userType'] = [];
+                 $res['website']['count']  = Website::where([])->count();
+                 $res['article']['count']  = Article::whereNotIn('status',['404'])->count();
+                 $res['category']['count']  = Category::where([])->count();
+                 $res['monthArticle']   = Db::select('SELECT  DATE(created_at) AS date,COUNT(*) AS total_count FROM  article  WHERE  created_at >= CURDATE() - INTERVAL 30 DAY  GROUP BY  DATE(created_at)  ORDER BY  date ASC;');
+                 $res['userType']  = User::where([])->selectRaw("count(*) as counts,type_id")->groupBy('type_id')->get();
+                 return Result::success($res);
+
+         }
+
+         return [];
+    }
+
+    /**
+     * 获取模板类型
+     * @return void
+     */
+    public function getTemplateClass(array $data): array
+    {
+        $where = [];
+        if(isset($data['name']) && $data['name']){
+            array_push($where,['name','like','%'.$data['name'].'%']);
+        }
+        $result = TemplateClass::where($where)->orderBy('sort','asc')->get();
+        if(empty($result)){
+            return Result::error("没有模板类型",0);
+        }else{
+            return Result::success($result);
+        }
+    }
+
+    /**
+     * 添加模板类型
+     * @param
+     * @return void
+     */
+    public function addTemplateClass(array $data): array
+    {
+        $insertData = [
+            'name'=>$data['name']
+        ];
+        $result = TemplateClass::insertGetId($insertData);
+        if(empty($result)){
+            return Result::error("创建失败",0);
+        }else{
+            return Result::success(["id"=>$result]);
+        }
+    }
+
+    /**
+     * 更新模板
+     * @param array $data
+     * @return array
+     */
+    public function upTemplateClass(array $data): array
+    {
+        $where = [
+            'id'=>$data['id']
+        ];
+        $insertData = [
+            'name'=>$data['name']
+        ];
+        $result = TemplateClass::where($where)->update($insertData);
+        if(empty($result)){
+            return Result::error("更新失败",0);
+        }else{
+            return Result::success();
+        }
+    }
+
+    /**
+     * 删除模板
+     * @param array $data
+     * @return array
+     */
+    public function delTemplateClass(array $data): array
+    {
+        $where = [
+            'id'=>$data['id']
+        ];
+
+        $result = TemplateClass::where($where)->delete();
+        if(empty($result)){
+            return Result::error("删除失败",0);
+        }else{
+            return Result::success();
+        }
+    }
+
+    /**
+     * 获取分类下的模板
+     * @param array $data
+     * @return array
+     */
+    public function getTemplate(array $data): array
+    {
+        $page = $data['page'];
+        $pageSize = $data['pageSize'];
+        $where = [];
+        if(isset($data['template_class_id'])  && $data['template_class_id']){
+            array_push($where,['template_class_id','=',$data['template_class_id']]);
+        }
+        $result = Template::where($where)
+            ->limit($pageSize)->offset(($page-1)*$pageSize)->get();
+        $count = Template::where($where)->count();
+        if (empty($result)) {
+            return Result::error("没有数据",0);
+        }
+        $data = [
+            'rows'=>$result->toArray(),
+            'count'=>$count
+        ];
+        return Result::success($data);
+    }
+
+    /**
+     * 创建模板
+     * @param
+     * @return void
+     */
+    public function addTemplate(array $data): array
+    {
+        $insertData = [
+            'template_name'=>$data['template_name'],
+            'template_img'=>json_encode($data['template_img']),
+            'template_class_id'=>$data['template_class_id'],
+        ];
+        $result = Template::insertGetId($insertData);
+        if(empty($result)){
+            return Result::error("创建模板失败",0);
+        }else{
+            return Result::success(["id"=>$result]);
+        }
+    }
+
+    /**
+     * 更新模板
+     * @param array $data
+     * @return array
+     */
+    public function upTemplate(array $data): array
+    {
+        $where = [
+            'id'=>$data['id']
+        ];
+        $insertData = [
+            'template_name'=>$data['template_name'],
+            'template_img'=>json_encode($data['template_img']),
+            'template_class_id'=>$data['template_class_id'],
+        ];
+        $result = Template::where($where)->update($insertData);
+        if(empty($result)){
+            return Result::error("更新模板失败",0);
+        }else{
+            return Result::success();
+        }
+    }
+
+    /**
+     * 删除模板
+     * @param array $data
+     * @return array
+     */
+    public function delTemplate(array $data): array
+    {
+        $where = [
+            'id'=>$data['id']
+        ];
+        $result = Template::where($where)->delete();
+        if(empty($result)){
+            return Result::error("删除模板失败",0);
+        }else{
+            return Result::success();
+        }
+    }
+
+    /**
+     * 搜索网站
+     * @param array $data
+     * @return array
+     */
+    public function websiteList(array $data): array
+    {
+        $where = [];
+        if(isset($data['keyword']) && !empty($data['keyword'])){
+            array_push($where,['website.website_name','like','%'.$data['keyword'].'%']);
+        }
+        $result = Website::where($where)->get();
+        if($result){
+            return Result::success($result);
+        }else{
+            return Result::error("没有网站",0);
+        }
+    }
+
+    public function addWebsiteCategory(array $data): array
+    {
+        $website_id = $data['website_id'];
+        $category_arr_id = $data['category_arr_id'];
+        $categoryList = Category::whereIn('id',$category_arr_id)->get();
+        $categoryListIds = [];
+        if($categoryList){
+            foreach ($categoryList->toArray() as $val){
+                array_push($categoryListIds,$val['id']);
+            }
+        }
+        $arr = [];
+        if($categoryListIds){
+            foreach ($categoryListIds as $v){
+                $ids =  $this->getUnderlingUIds(intval($v));
+                $ids_arr = explode(",", $ids);
+                array_push($arr,$ids_arr);
+            }
+        }
+        $mergedArray = [];
+        foreach ($arr as $subarray) {
+            $mergedArray = array_merge($mergedArray, $subarray);
+        }
+        var_dump("所有:",$arr,$mergedArray);
+        //查询出所有的分类进行分割插入 组装数据
+        $categoryListData = Category::whereIn('id',$mergedArray)->get();
+        $categoryListData = $categoryListData->toArray();
+        $insertData = [];
+        if($categoryListData){
+            foreach ($categoryListData as $key=>$value){
+                $insertData[$key]['website_id'] = $website_id;
+                $insertData[$key]['name'] = $value['name'];
+                $insertData[$key]['sort'] = $value['sort'];
+                $insertData[$key]['pid'] = $value['pid'];
+                $insertData[$key]['pid_arr'] = $value['pid_arr'];
+                $insertData[$key]['seo_title'] = $value['seo_title'];
+                $insertData[$key]['seo_keywords'] = $value['seo_keywords'];
+                $insertData[$key]['seo_description'] = $value['seo_description'];
+                $insertData[$key]['alias'] = $value['name'];
+                $insertData[$key]['category_id'] = $value['id'];
+            }
+        }
+        $result = WebsiteCategory::insert($insertData);
+        var_dump("插入数据状态:",$result);
+        if($result){
+            return Result::success($result);
+        }else{
+            return Result::error("创建失败",0);
+        }
+    }
+
+
+
+    /**
+     * 删除网站导航
+     * @param array $data
+     * @return array
+     */
+    public function delWebsiteCategory(array $data): array
+    {
+        $website_id = $data['website_id']??0;
+        $category_id = $data['category_id']??0;
+        $ids =  $this->getUnderlingUIds(intval($category_id));
+        $ids_arr = explode(",", $ids);
+        $result = WebsiteCategory::where(['website_id'=>$website_id])->whereIn("category_id",$ids_arr)->delete();
+        if($result){
+            return Result::success($result);
+        }else{
+            return Result::error("删除失败",0);
+        }
+    }
+
+    /**
+     * 获取网站导航
+     * @param array $data
+     * @return array
+     */
+    public function getAdminWebsiteCategory(array $data): array
+    {
+        $where = [
+            'website_id'=>$data['website_id'],
+            'pid'=>0
+        ];
+        $result = WebsiteCategory::where($where)->get();
+        if($result){
+            return Result::success($result);
+        }else{
+            return Result::error("查询失败",0);
+        }
+    }
+
+    /**
+     * 更新网站导航
+     * @param array $data
+     * @return array
+     */
+    public function upWebsiteCategory(array $data): array
+    {
+        Db::beginTransaction();
+        try{
+           //合并栏目id
+            $reqIds = array_merge($data['old_category_arr_id'],$data['new_category_arr_id']);
+            //对比old 数组差异化,把差异化的删除
+            $result = WebsiteCategory::where(['website_id'=>$data['website_id'],'pid'=>0])->get();
+            $result = $result->toArray();
+            $categoryIds = [];
+            if($result){
+                foreach ($result as $val){
+                    array_push($categoryIds,$val['category_id']);
+                }
+            }
+            //和原始数据对比取交际
+            $reqidsIntersect = array_intersect($reqIds,$categoryIds);
+            //再取差集 进行对比
+            $differenceIDS =  array_merge(array_diff($reqidsIntersect, $categoryIds),array_diff($categoryIds,$reqidsIntersect));
+            var_dump("差集:",$differenceIDS);
+            $arr_ids = [];
+            if(count($differenceIDS)>0){
+                foreach ($differenceIDS as $vv){
+                    $idV =  $this->getUnderlingUIds(intval($vv));
+                    $ids_arrV = explode(",", $idV);
+                    array_push($arr_ids,$ids_arrV);
+                }
+            }
+           $del_ids = array_reduce($arr_ids, 'array_merge', array());
+            //有差异  删除
+            if(count($del_ids)>0){
+                 WebsiteCategory::where(['website_id'=>$data['website_id']])->whereIn("category_id",$del_ids)->delete();
+            }
+            //传过来的值 和 交际 对比,选出要添加的值 进行插入
+           $insertIDS =  array_merge(array_diff($reqIds, $reqidsIntersect),array_diff($reqidsIntersect,$reqIds));
+            var_dump("要存储的:",$insertIDS);
+            //新的数组重新创建
+            if(count($insertIDS)>0){
+                $arr = [];
+                $categoryListIds = $insertIDS;
+                if($categoryListIds){
+                    foreach ($categoryListIds as $v){
+                        $ids =  $this->getUnderlingUIds(intval($v));
+                        $ids_arr = explode(",", $ids);
+                        array_push($arr,$ids_arr);
+                    }
+                }
+                $mergedArray = [];
+                foreach ($arr as $subarray) {
+                    $mergedArray = array_merge($mergedArray, $subarray);
+                }
+                var_dump("要插入的ID:",$mergedArray);
+                //查询出所有的分类进行分割插入 组装数据
+                $categoryListData = Category::whereIn('id',$mergedArray)->get();
+                $categoryListData = $categoryListData->toArray();
+                $insertData = [];
+                if($categoryListData){
+                    foreach ($categoryListData as $key=>$value){
+                        $insertData[$key]['website_id'] = $data['website_id'];
+                        $insertData[$key]['name'] = $value['name'];
+                        $insertData[$key]['sort'] = $value['sort'];
+                        $insertData[$key]['pid'] = $value['pid'];
+                        $insertData[$key]['pid_arr'] = $value['pid_arr'];
+                        $insertData[$key]['seo_title'] = $value['seo_title'];
+                        $insertData[$key]['seo_keywords'] = $value['seo_keywords'];
+                        $insertData[$key]['seo_description'] = $value['seo_description'];
+                        $insertData[$key]['alias'] = $value['name'];
+                        $insertData[$key]['category_id'] = $value['id'];
+                    }
+                }
+                 WebsiteCategory::insert($insertData);
+
+            }
+            Db::commit();
+        } catch(\Throwable $ex){
+            Db::rollBack();
+            var_dump($ex->getMessage());
+            return Result::error("修改失败",0);
+        }
+
+        return Result::success();
+    }
+
+    /**
+     * 获取网站列表
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteCategoryList(array $data): array
+    {
+        $where = [];
+        if(isset($data['keyword']) && !empty($data['keyword'])){
+            array_push($where,['website.website_name','like','%'.$data['keyword'].'%']);
+        }
+        if(isset($data['website_column_id']) && !empty($data['website_column_id'])){
+            array_push($where,['website.website_column_id','=',$data['website_column_id']]);
+        }
+        $result = Website::where($where)
+            ->with(["websiteCategory"=>function ($query) {
+                $query->where(['pid'=>0])->select('website_id','name','alias','category_id');
+            }])
+            ->limit($data['pageSize'])->offset(($data['page']-1)*$data['pageSize'])
+            ->get();
+
+        $count = Website::where($where)->count();
+        if (empty($result)) {
+            return Result::error("没有数据",0);
+        }
+        $data = [
+            'rows'=>$result->toArray(),
+            'count'=>$count
+        ];
+         if($result){
+             return Result::success($data);
+         }else{
+             return Result::error("查询失败",0);
+         } 
+    }
+
+    /**
+     * 删除网站下的所有导航
+     * @param array $data
+     * @return array
+     */
+    public function delWebsiteAllCategory(array $data): array
+    {
+        $website_id = $data['website_id'];
+        $result = WebsiteCategory::where(['website_id'=>$website_id])->delete();
+        if($result){
+            return Result::success($result);
+        }else{
+            return Result::error("删除失败",0);
+        }
+    }
+
+    /**
+     * 获取网站下的某一个导航
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteCategoryOnes(array $data): array
+    {
+        $website_id = $data['website_id'];
+        $category_id = $data['category_id'];
+        $result = WebsiteCategory::where(['website_category.website_id'=>$website_id,'website_category.category_id'=>$category_id])
+            ->first();
+        if($result){
+            return Result::success($result);
+        }else{
+            return Result::error("查询失败",0);
+        }
+    }
+
+    /**
+     * 更新网闸下的某一个导航
+     * @param array $data
+     * @return array
+     */
+    public function upWebsiteCategoryones(array $data): array
+    {
+        $where = [
+            'website_id'=>$data['website_id'],
+            'category_id'=>$data['category_id'],
+        ];
+        $result = WebsiteCategory::where($where)->update($data);
+        if($result){
+            return Result::success($result);
+        }else{
+            return Result::error("更新失败",0);
+        }
+    }
+
+    /**
+     * 获取网站下的所有导航(包含子导航)
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteAllCategory(array $data): array
+    {
+        $where = [];
+        if(isset($data['website_id']) && !empty($data['website_id'])){
+            array_push($where,['website_category.website_id','=',$data['website_id']]);
+        }
+        if(isset($data['name']) && !empty($data['name'])){
+            array_push($where,['website_category.name','like','%'.$data['name'].'%']);
+        }
+        if(isset($data['alias']) && !empty($data['alias'])){
+            array_push($where,['website_category.alias','like','%'.$data['alias'].'%']);
+        }
+        if(isset($data['department_id']) && !empty($data['department_id'])){
+            array_push($where,['category.department_id','=',$data['department_id']]);
+        }
+        if(isset($data['city_id']) && !empty($data['city_id'])){
+            array_push($where,['category.city_id','=',$data['city_id']]);
+        }
+        $result = WebsiteCategory::where($where)
+            ->leftJoin("category",'website_category.category_id','category.id')
+            ->leftJoin("department",'category.department_id','department.id')
+            ->leftJoin("district",'category.city_id','district.id')
+            ->select("website_category.*","department.name as department_name","district.name as city_name")
+            ->limit($data['pageSize'])->offset(($data['page']-1)*$data['pageSize'])
+            ->get();
+
+        $count = WebsiteCategory::where($where)
+            ->leftJoin("category",'website_category.category_id','category.id')
+            ->leftJoin("department",'category.department_id','department.id')
+            ->leftJoin("district",'category.city_id','district.id')
+            ->count();
+        if (empty($result)) {
+            return Result::error("没有数据",0);
+        }
+        $data = [
+            'rows'=>$result->toArray(),
+            'count'=>$count
+        ];
+        if($result){
+            return Result::success($data);
+        }else{
+            return Result::error("查询失败",0);
+        }
+        if($result){
+            return Result::success($result);
+        }else{
+            return Result::error("查询失败",0);
+        }
+    }
+
+    /**
+     * 递归查询数据
+     * @param $id
+     * @param $ids
+     * @return string
+     */
+    public function getUnderlingUIds($id, $ids='')
+    {
+        $back =  Category::where(['pid'=>$id])->get();
+        $back = $back->toArray();
+        if (!empty($back) && is_array($back)) {
+            foreach ($back as $v) {
+                //防止当前人的ID重复去查询,形成恶性循环
+                if ($v['id'] == $id) {
+                    continue;
+                }
+                $back2 =  Category::where(['pid'=>$id])->count('id');
+                if ($back2 > 0) {
+                    $ids = $this->getUnderlingUIds($v['id'],$ids);
+                } else {
+                    $ids .= ','.$v['id'];
+                }
+            }
+        }
+        $ids = $id.','.$ids.',';
+        $ids = str_replace(',,', ",", $ids);
+        $ids = trim($ids, ',');
+        return $ids;
+    }
+
+    /**
+     * 检测网站名称是否重复
+     * @param array $data
+     * @return array
+     */
+    public function checkWebsiteName(array $data): array
+    {
+        if(isset($data['id'])){
+            $data[] = ['id',"!=",$data['id']];
+            unset($data['id']);
+        }
+        $websiteInfo = Website::query()->where($data)->first();
+        if (empty($websiteInfo)) {
+            return Result::error("找不到网站",0);
+        }
+        return Result::success($websiteInfo->toArray());
+    }
+
+    /**
+     * 检测网站url是否重复
+     * @param array $data
+     * @return array
+     */
+    public function checkWebsiteUrl(array $data): array
+    {
+        $whereData = [];
+        if(isset($data['id'])){
+            $whereData = [['id',"!=",$data['id']]];
+            unset($data['id']);
+        }
+        $websiteInfo = Website::query()->where($whereData)->whereJsonContains('website_url', $data['website_url'])->first();
+        if (empty($websiteInfo)) {
+            return Result::error("找不到URL",0);
+        }
+        return Result::success($websiteInfo->toArray());
+    }
+
+    /**
+     * 风格下的板块
+     * @return void
+     */
+    public function templateSectorList(array $data): array
+    {
+        $where = [
+            'template_id'=>$data['template_id']
+        ];
+        $result = Sector::where($where)->whereJsonContains("page_type",$data['page_type'])
+            ->limit($data['pageSize'])->offset(($data['page']-1)*$data['pageSize'])
+            ->get();
+
+        $count = Sector::where($where)->count();
+        if (empty($result)) {
+            return Result::error("没有数据",0);
+        }
+        $data = [
+            'rows'=>$result->toArray(),
+            'count'=>$count
+        ];
+        if (empty($result)) {
+            return Result::error("没有数据",0);
+        }
+        return Result::success($data);
+    }
+
+    /**
+     * 板块下的组件
+     * @param array $data
+     * @return array
+     */
+    public function sectorComponentList(array $data): array
+    {
+        $where = [
+            'template_id'=>$data['template_id'],
+            'sector_id'=>$data['sector_id'],
+        ];
+        $result = Component::where($where)
+            ->select("*")
+            ->limit($data['pageSize'])->offset(($data['page']-1)*$data['pageSize'])
+            ->get();
+
+        $count = Component::where($where)->count();
+        if (empty($result)) {
+            return Result::error("没有数据",0);
+        }
+        $data = [
+            'rows'=>$result->toArray(),
+            'count'=>$count
+        ];
+        if (empty($result)) {
+            return Result::error("没有数据",0);
+        }
+        return Result::success($data);
+    }
+
+    /**
+     * 获取模板内容
+     * @return void
+     */
+    public function getWebsiteTemplateInfo(array $data): array
+    {
+        $wehre = [
+            "website_id" =>$data['website_id']
+        ];
+        $result =  WebsiteTemplate::where($wehre)->first();
+        if($result){
+            return Result::success($result);
+        }else{
+            return Result::error("没有数据",0);
+        }
+    }
+
+    /**
+     * 保存网站模板
+     * @param array $data
+     * @return array
+     */
+    public function addWebsiteTemplate(array $data): array
+    {
+        var_dump("接收参数:",$data['template_data']);
+        $result =  WebsiteTemplate::updateOrInsert(['website_id'=>$data['website_id']],['template_data'=>json_encode($data['template_data'])]);
+        if($result){
+            return Result::success($result);
+        }else{
+            return Result::error("创建失败",0);
+        }
+    }
+
+    /**
+     * 预览网站首页模板数据
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteTemplateData(array $data): array
+    {
+        $wehre = [
+            "website_id" =>$data['website_id']
+        ];
+        $result =  WebsiteTemplate::where($wehre)->first();
+
+        if($result){
+            $templateData = json_decode($result['template_data'],true);
+//            var_dump("数据:",$templateData[1]);
+            $templateData[1] = $this->getNewsList($templateData[1]);
+
+            return Result::success($templateData);
+        }else{
+            return Result::error("没有数据",0);
+        }
+    }
+
+    /**
+     * 获取数据
+     * @return void
+     */
+    public function getNewsList(array $data): array
+    {
+        if($data){
+            foreach ($data as $key=>$val){
+                if($val){
+                    foreach ($val['data'] as $k=>$item){
+                        if($item['isReturn'] && intval($item['isReturn'])==1){
+                            $imgList = [];
+                            if($item['data']['imgNum'] && intval($item['data']['imgNum'])>0){
+                                $imgList =  Article::where('imgurl',"!=","")
+                                            ->where('catid',$item['data']['category_id'])
+                                            ->select($item['data']['selectField'])
+                                            ->orderBy("created_at","desc")
+                                            ->offset(0)
+                                            ->limit(intval($item['data']['imgNum']))
+                                            ->get();
+                                $imgList = $imgList->toArray();
+                                $listIds = [];
+                                if ($imgList){
+                                    $listIds = array_column($imgList, 'id');
+                                }
+                                $dataList = Article::whereNotIn('id',$listIds)
+                                     ->where('catid',$item['data']['category_id'])
+                                    ->select($item['data']['selectField'])
+                                    ->orderBy("created_at","desc")
+                                    ->offset(0)
+                                    ->limit(intval($item['data']['pageSize'])-intval($item['data']['imgNum']))
+                                    ->get();
+                                $dataList = $dataList->toArray();
+                                var_dump("图片列表:",$imgList,"数据列表:",$dataList);
+                                $datas = array_merge($imgList,$dataList);
+//                                return $datas;
+                                var_dump("合并列表:",$datas);
+                                $data[$key]['data'][$k]['dataList'] = $datas;
+                            }else{
+                                $dataList = Article::where('catid',$item['data']['category_id'])
+                                    ->select($item['data']['selectField'])
+                                    ->orderBy("created_at","desc")
+                                    ->offset(0)
+                                    ->limit(intval($item['data']['pageSize']))
+                                    ->get();
+                                $dataList = $dataList->toArray();
+                                var_dump("数据列表:",$dataList);
+                            }
+                        }
+                    }
+                }
+
+            }
+        }
+        return $data;
+    }
+
+    /**
+     * 获取底部导航列表
+     * @param array $data
+     * @return array
+     */
+    public function getFooterCategoryList(array $data): array
+    {
+        $where = [
+            "website_id"=>$data['website_id']
+        ];
+       $result =  FooterCategory::where($where)->get();
+       if($result){
+               return Result::success($result);
+       }else{
+           return Result::error("没有数据");
+       }
+    }
+
+    //获取底部导航内容列表
+    public function getFooterContentList(array $data): array
+    {
+        $where = [
+            "fcat_id"=>$data['fcat_id'],
+        ];
+        switch (intval($data['type'])){
+            case 0:
+                $result =  FooterContent::where($where)->first();
+                break;
+            case 1:
+                $result =  FooterContent::where($where)->get();
+                break;
+        }
+        if($result){
+            return Result::success($result);
+        }else{
+            return Result::error("没有数据");
+        }
+    }
+    //获取底部导航内容详情
+    public function getFooterContentInfo(array $data): array
+    {
+        $where = [
+            "id"=>$data['content_id']
+        ];
+        $result =  FooterContent::where($where)->first();
+        if($result){
+            return Result::success($result);
+        }else{
+            return Result::error("没有数据");
+        }
+    }
+
 }

+ 8 - 13
app/JsonRpc/WebsiteServiceInterface.php

@@ -45,21 +45,8 @@ interface WebsiteServiceInterface
     public function updateWebsiteRoleUser(int $id,array $data): array;
     public function delWebsiteRoleUser(int $id): array;
     public function getWebsiteId(array $data): array;
-
     public function getWebsiteCategory(array $data): array;
 
-    public function getWebsiteAdvertisement(array $data): array;
-    
-    public function selectWebsiteDepartment(array $data): array;
-
-
-    public function selectWebsiteArea(array $data): array;
-
-    public function getWebsiteModelCategory(array $data): array;
-
-    public function selectWebsiteLinks(array $data): array;
-
-
     public function getAdminIndex(array $data): array;
     public function getTemplateClass(array $data): array;
     public function addTemplateClass(array $data): array;
@@ -80,5 +67,13 @@ interface WebsiteServiceInterface
     public function getWebsiteCategoryOnes(array $data): array;
     public function upWebsiteCategoryones(array $data): array;
     public function getWebsiteAllCategory(array $data): array;
+    public function templateSectorList(array $data): array;
+    public function sectorComponentList(array $data): array;
+    public function getWebsiteTemplateInfo(array $data): array;
+    public function addWebsiteTemplate(array $data): array;
+    public function getWebsiteTemplateData(array $data): array;
+    public function getFooterCategoryList(array $data): array;
+    public function getFooterContentList(array $data): array;
+    public function getFooterContentInfo(array $data): array;
 
 }

+ 27 - 0
app/Model/FooterCategory.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class FooterCategory extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'footer_category';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 27 - 0
app/Model/FooterContent.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class FooterContent extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'footer_content';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 0 - 11
app/Model/Sector.php

@@ -24,14 +24,3 @@ class Sector extends Model
      */
     protected array $casts = ['id' => 'integer', 'template_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
 }
-
-/**
- * @property int $id 
- * @property int $template_id 
- * @property string $sector_name 
- * @property string $sector_code 
- * @property string $page_type 
- * @property string $sector_img 
- * @property \Carbon\Carbon $created_at 
- * @property \Carbon\Carbon $updated_at 
- */

+ 1 - 0
app/Model/WebsiteTemplate.php

@@ -25,3 +25,4 @@ class WebsiteTemplate extends Model
      */
     protected array $casts = [];
 }
+

+ 49 - 44
config/autoload/databases.php

@@ -1,44 +1,49 @@
-<?php
-
-declare(strict_types=1);
-/**
- * This file is part of Hyperf.
- *
- * @link     https://www.hyperf.io
- * @document https://hyperf.wiki
- * @contact  group@hyperf.io
- * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
- */
-use function Hyperf\Support\env;
-
-return [
-    'default' => [
-        'driver' => env('DB_DRIVER', 'mysql'),
-        'host' => env('DB_HOST', 'localhost'),
-        'database' => env('DB_DATABASE', 'hyperf'),
-        'port' => env('DB_PORT', 3306),
-        'username' => env('DB_USERNAME', 'root'),
-        'password' => env('DB_PASSWORD', ''),
-        'charset' => env('DB_CHARSET', 'utf8'),
-        'collation' => env('DB_COLLATION', 'utf8_unicode_ci'),
-        'prefix' => env('DB_PREFIX', ''),
-        'pool' => [
-            'min_connections' => 1,
-            'max_connections' => 10,
-            'connect_timeout' => 10.0,
-            'wait_timeout' => 3.0,
-            'heartbeat' => -1,
-            'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60),
-        ],
-        'variables' => [
-            'time_zone' => '+08:00', // 设置MySQL连接的时区
-        ],
-        'commands' => [
-            'gen:model' => [
-                'path' => 'app/Model',
-                'force_casts' => true,
-                'inheritance' => 'Model',
-            ],
-        ],
-    ],
-];
+<?php
+
+declare(strict_types=1);
+/**
+ * This file is part of Hyperf.
+ *
+ * @link     https://www.hyperf.io
+ * @document https://hyperf.wiki
+ * @contact  group@hyperf.io
+ * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
+ */
+use function Hyperf\Support\env;
+
+return [
+    'default' => [
+        'driver' => env('DB_DRIVER', 'mysql'),
+        'host' => env('DB_HOST', 'localhost'),
+        'database' => env('DB_DATABASE', 'hyperf'),
+        'port' => env('DB_PORT', 3306),
+        'username' => env('DB_USERNAME', 'root'),
+        'password' => env('DB_PASSWORD', ''),
+        'charset' => env('DB_CHARSET', 'utf8'),
+        'collation' => env('DB_COLLATION', 'utf8_unicode_ci'),
+        'prefix' => env('DB_PREFIX', ''),
+        'logger' => [
+            'enabled' => true,
+            'name' => 'mysql',
+            'level' => 'debug',
+        ],
+        'pool' => [
+            'min_connections' => 1,
+            'max_connections' => 10,
+            'connect_timeout' => 10.0,
+            'wait_timeout' => 3.0,
+            'heartbeat' => -1,
+            'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60),
+        ],
+        'variables' => [
+            'time_zone' => '+08:00', // 设置MySQL连接的时区
+        ],
+        'commands' => [
+            'gen:model' => [
+                'path' => 'app/Model',
+                'force_casts' => true,
+                'inheritance' => 'Model',
+            ],
+        ],
+    ],
+];

文件差异内容过多而无法显示
+ 0 - 0
runtime/container/classes.cache


文件差异内容过多而无法显示
+ 0 - 0
runtime/container/scan.cache


+ 1 - 0
runtime/hyperf.pid

@@ -0,0 +1 @@
+86469

+ 0 - 146
runtime/logs/hyperf.log

@@ -1,146 +0,0 @@
-[2024-11-21T07:56:29.674152+00:00] sql.INFO: [87.21] select * from `letter_type` where (`type` = '1') order by `sort` asc [] []
-[2024-11-21T07:56:40.645759+00:00] sql.INFO: [18.18] select * from `letter_type` where (`type` = '1' and `pid` = '14') order by `sort` asc [] []
-[2024-11-21T07:56:56.646094+00:00] sql.INFO: [103.6] insert into `letter_of_complaint` (`title`, `nature`, `nature_level0`, `nature_level1`, `nature_level3`, `name`, `id_card`, `mobile`, `describe`, `like_remark`, `judgment`, `audio_and_video`, `contract`, `qualifications`, `money`, `other`, `user_id`) values ('我测试一条', '5', '14', '29', '113', '1', '1', '15801245755', '111', '111111111', '', '', '', '', '1', '111', '71') [] []
-[2024-11-28T01:38:00.161577+00:00] sql.INFO: [505.08] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:38:00.402600+00:00] sql.INFO: [44.24] select * from `website_category` where (`website_id` = '2' and `pid` = '0') order by `sort` asc [] []
-[2024-11-28T01:38:03.578977+00:00] sql.INFO: [16.63] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:38:04.512336+00:00] sql.INFO: [927.12] select * from `district` where (`pid` = '0') order by `code` asc [] []
-[2024-11-28T01:38:07.885086+00:00] sql.INFO: [17.24] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:40:39.726094+00:00] sql.INFO: [1524.32] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:40:40.100875+00:00] sql.INFO: [224.12] select * from `ad_place` where (`website_id` = '2' and `id` = '9') order by `id` asc limit 1 [] []
-[2024-11-28T01:41:23.315087+00:00] sql.INFO: [70.03] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:41:23.473270+00:00] sql.INFO: [31.53] select * from `ad_place` where (`website_id` = '2' and `id` = '9') order by `id` asc limit 1 [] []
-[2024-11-28T01:42:47.928842+00:00] sql.INFO: [1484.57] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:42:51.907120+00:00] sql.INFO: [1069.46] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:42:52.268668+00:00] sql.INFO: [224.43] select * from `ad_place` where (`website_id` = '2' and `id` = '9') order by `id` asc limit 1 [] []
-[2024-11-28T01:49:01.013202+00:00] sql.INFO: [1283.1] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:49:01.170300+00:00] sql.INFO: [14.96] select * from `ad_place` where (`website_id` = '2' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:49:04.271883+00:00] sql.INFO: [16.56] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:49:04.290363+00:00] sql.INFO: [15.28] select * from `ad_place` where (`website_id` = '2' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:49:05.495068+00:00] sql.INFO: [223.42] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:49:05.513772+00:00] sql.INFO: [14.91] select * from `ad_place` where (`website_id` = '2' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:49:52.837522+00:00] sql.INFO: [279.47] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:49:52.977386+00:00] sql.INFO: [16.04] select * from `ad_place` where (`website_id` = '2' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:50:35.712881+00:00] sql.INFO: [71.86] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:50:35.847787+00:00] sql.INFO: [13.74] select * from `ad_place` where (`website_id` = '2' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:52:12.308412+00:00] sql.INFO: [271.66] select * from `website` where json_contains(`website_url`, '"192.168.1.201:8099"') limit 1 [] []
-[2024-11-28T01:52:12.329929+00:00] sql.INFO: [17.59] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:52:14.327823+00:00] sql.INFO: [17.91] select * from `website` where json_contains(`website_url`, '"192.168.1.201:8099"') limit 1 [] []
-[2024-11-28T01:52:14.349189+00:00] sql.INFO: [17.76] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:52:16.295876+00:00] sql.INFO: [16.63] select * from `website` where json_contains(`website_url`, '"192.168.1.201:8099"') limit 1 [] []
-[2024-11-28T01:52:16.316250+00:00] sql.INFO: [16.9] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:52:18.167563+00:00] sql.INFO: [225.04] select * from `website` where json_contains(`website_url`, '"192.168.1.201:8099"') limit 1 [] []
-[2024-11-28T01:52:18.187064+00:00] sql.INFO: [16.37] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:52:39.903325+00:00] sql.INFO: [16.31] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:52:39.923913+00:00] sql.INFO: [16.99] select * from `ad_place` where (`website_id` = '2' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:53:49.718991+00:00] sql.INFO: [266.1] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:53:50.565766+00:00] sql.INFO: [638.78] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:53:55.727666+00:00] sql.INFO: [15.96] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:53:55.744424+00:00] sql.INFO: [13.79] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:53:57.587596+00:00] sql.INFO: [15.99] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:53:57.606395+00:00] sql.INFO: [15.96] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:53:58.621446+00:00] sql.INFO: [16.07] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:53:58.640887+00:00] sql.INFO: [16.41] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:53:59.578083+00:00] sql.INFO: [15.88] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:53:59.595104+00:00] sql.INFO: [13.88] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:54:24.936013+00:00] sql.INFO: [59.91] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:54:25.105053+00:00] sql.INFO: [24.45] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:55:07.914614+00:00] sql.INFO: [16.04] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:55:07.931981+00:00] sql.INFO: [13.79] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:55:09.077997+00:00] sql.INFO: [15.36] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:55:09.097038+00:00] sql.INFO: [16.32] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:55:10.277696+00:00] sql.INFO: [15.79] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:55:10.504066+00:00] sql.INFO: [223.62] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:55:13.900419+00:00] sql.INFO: [17.08] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:55:13.920098+00:00] sql.INFO: [15.91] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:55:45.661920+00:00] sql.INFO: [15.52] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:55:45.915394+00:00] sql.INFO: [245.36] select * from `district` where (`pid` = '0') order by `code` asc [] []
-[2024-11-28T01:55:49.063192+00:00] sql.INFO: [16.48] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:55:49.153087+00:00] sql.INFO: [81.27] select * from `website_category` where (`website_id` = '2' and `pid` = '0') order by `sort` asc [] []
-[2024-11-28T01:55:51.338904+00:00] sql.INFO: [17.38] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:55:51.357837+00:00] sql.INFO: [15.97] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:56:06.427043+00:00] sql.INFO: [16.86] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:56:06.655254+00:00] sql.INFO: [224.89] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T01:56:17.376475+00:00] sql.INFO: [225.42] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:56:17.399789+00:00] sql.INFO: [17.19] select * from `department` where `pid` = '0' order by `id` asc limit 10 [] []
-[2024-11-28T01:56:17.442491+00:00] sql.INFO: [39.98] select * from `department` where `name` like '%科学%' [] []
-[2024-11-28T01:56:17.458072+00:00] sql.INFO: [14.11] select count(*) as aggregate from `department` where `name` like '%科学%' [] []
-[2024-11-28T01:56:21.661030+00:00] sql.INFO: [16.01] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T01:56:21.752369+00:00] sql.INFO: [88.45] select * from `district` where `pid` = '0' and `status` = '1' [] []
-[2024-11-28T01:56:21.785055+00:00] sql.INFO: [15.79] select * from `district` where `pid` = '0' and `status` = '1' and `id` = '2' order by `id` asc [] []
-[2024-11-28T01:56:22.074762+00:00] sql.INFO: [288.74] select * from `district` where `pid` = '2' and `status` = '1' order by `id` asc [] []
-[2024-11-28T01:56:22.311663+00:00] sql.INFO: [225.14] select * from `district` where `pid` in ('2') and `status` = '1' and `id` = '53' order by `id` asc [] []
-[2024-11-28T01:56:22.604141+00:00] sql.INFO: [291.06] select * from `district` where `pid` in ('53') and `status` = '1' order by `id` asc [] []
-[2024-11-28T01:56:26.722889+00:00] sql.INFO: [16.11] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:00:12.535457+00:00] sql.INFO: [53.3] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:01:29.334610+00:00] sql.INFO: [56.54] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:01:34.758446+00:00] sql.INFO: [16.79] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:01:40.135160+00:00] sql.INFO: [640.45] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:01:40.161958+00:00] sql.INFO: [22.93] select * from `website_category` where (`website_id` = '2' and `pid` = '0') order by `sort` asc [] []
-[2024-11-28T02:01:43.385253+00:00] sql.INFO: [15.75] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:01:43.439557+00:00] sql.INFO: [51.12] select * from `district` where (`pid` = '0') order by `code` asc [] []
-[2024-11-28T02:02:37.953182+00:00] sql.INFO: [431.93] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:02:38.056059+00:00] sql.INFO: [99.15] select * from `district` where (`pid` = '0') order by `code` asc [] []
-[2024-11-28T02:02:40.754039+00:00] sql.INFO: [224.04] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:02:40.990755+00:00] sql.INFO: [232.27] select * from `website_category` where (`website_id` = '2' and `pid` = '0') order by `sort` asc [] []
-[2024-11-28T02:02:43.955818+00:00] sql.INFO: [223.17] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:02:44.598790+00:00] sql.INFO: [639.78] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T02:02:47.650081+00:00] sql.INFO: [16.73] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:02:47.666970+00:00] sql.INFO: [13.6] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T02:03:19.268994+00:00] sql.INFO: [222.2] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:03:19.285433+00:00] sql.INFO: [13.46] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T02:03:20.388224+00:00] sql.INFO: [15.74] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:03:20.406509+00:00] sql.INFO: [15.52] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T02:03:21.478354+00:00] sql.INFO: [15.84] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:03:21.708813+00:00] sql.INFO: [226.54] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T02:03:22.774153+00:00] sql.INFO: [16.82] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:03:22.793012+00:00] sql.INFO: [16.03] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T02:03:23.811215+00:00] sql.INFO: [16.02] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:03:23.829915+00:00] sql.INFO: [15.74] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T02:03:58.998814+00:00] sql.INFO: [2073.63] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:03:59.150198+00:00] sql.INFO: [17.13] select * from `ad_place` where (`website_id` = '1' and `id` = '15') order by `id` asc limit 1 [] []
-[2024-11-28T02:04:33.559437+00:00] sql.INFO: [15.91] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:04:33.582284+00:00] sql.INFO: [17.08] select * from `department` where `pid` = '0' order by `id` asc limit 10 [] []
-[2024-11-28T02:04:33.600529+00:00] sql.INFO: [14.87] select * from `department` where `name` like '%科学%' [] []
-[2024-11-28T02:04:33.827392+00:00] sql.INFO: [225.37] select count(*) as aggregate from `department` where `name` like '%科学%' [] []
-[2024-11-28T02:04:37.862472+00:00] sql.INFO: [18.28] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:04:38.155702+00:00] sql.INFO: [285.93] select * from `link` where (`website_id` = '2' and `status` = '1' and `type` = '3') order by `id` asc limit 3 [] []
-[2024-11-28T02:05:40.975368+00:00] sql.INFO: [685.33] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:05:40.994913+00:00] sql.INFO: [16.46] select * from `link` where (`website_id` = '2' and `status` = '1' and `type` = '1') order by `id` asc limit 3 [] []
-[2024-11-28T02:05:44.236568+00:00] sql.INFO: [17.6] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:05:51.649117+00:00] sql.INFO: [16.71] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:07:25.255279+00:00] sql.INFO: [58.39] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:07:37.341162+00:00] sql.INFO: [16.47] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:07:38.652720+00:00] sql.INFO: [16.36] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:07:52.290935+00:00] sql.INFO: [16.54] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:12:09.455781+00:00] sql.INFO: [269.46] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:12:11.624760+00:00] sql.INFO: [17.04] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:12:16.799880+00:00] sql.INFO: [224.97] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:12:29.743543+00:00] sql.INFO: [16.05] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:12:29.769117+00:00] sql.INFO: [17.52] select * from `link` where (`website_id` = '2' and `status` = '1' and `type` = '1') order by `id` asc limit 3 [] []
-[2024-11-28T02:12:32.324156+00:00] sql.INFO: [18.09] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:12:32.347942+00:00] sql.INFO: [17.66] select * from `website_category` where (`website_id` = '2') and (`pid` = '1') order by `sort` asc limit 3 offset 0 [] []
-[2024-11-28T02:12:45.148977+00:00] sql.INFO: [16.13] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:12:45.169914+00:00] sql.INFO: [17.47] select * from `website_category` where (`website_id` = '2') and (`pid` = '3') order by `sort` asc limit 3 offset 0 [] []
-[2024-11-28T02:12:50.060508+00:00] sql.INFO: [17.11] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:12:50.081000+00:00] sql.INFO: [17.24] select * from `website_category` where (`website_id` = '2') and (`pid` = '2') order by `sort` asc limit 3 offset 0 [] []
-[2024-11-28T02:13:30.175165+00:00] sql.INFO: [16.1] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:13:30.195925+00:00] sql.INFO: [17.88] select * from `website_category` where (`website_id` = '2') and (`pid` = '0') order by `sort` asc limit 3 offset 0 [] []
-[2024-11-28T02:13:34.185546+00:00] sql.INFO: [17.56] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:13:40.477873+00:00] sql.INFO: [16.93] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:16:32.035846+00:00] sql.INFO: [59.96] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:16:50.995275+00:00] sql.INFO: [17.22] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:19:52.917283+00:00] sql.INFO: [679.38] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:19:53.241958+00:00] sql.INFO: [318.14] select * from `district` where `pid` = '0' and `status` = '1' [] []
-[2024-11-28T02:19:53.271120+00:00] sql.INFO: [15.65] select * from `district` where `pid` = '0' and `status` = '1' and `id` = '2' order by `id` asc [] []
-[2024-11-28T02:19:53.353847+00:00] sql.INFO: [81.78] select * from `district` where `pid` = '2' and `status` = '1' order by `id` asc [] []
-[2024-11-28T02:19:53.379426+00:00] sql.INFO: [14.78] select * from `district` where `pid` in ('2') and `status` = '1' and `id` = '53' order by `id` asc [] []
-[2024-11-28T02:19:53.462369+00:00] sql.INFO: [81.73] select * from `district` where `pid` in ('53') and `status` = '1' order by `id` asc [] []
-[2024-11-28T02:20:03.890355+00:00] sql.INFO: [225.12] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:20:22.950459+00:00] sql.INFO: [17.58] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:20:34.355486+00:00] sql.INFO: [17.91] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:21:27.835856+00:00] sql.INFO: [17.66] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:22:53.413452+00:00] sql.INFO: [893.19] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:23:19.170649+00:00] sql.INFO: [16.83] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:23:24.420422+00:00] sql.INFO: [16.75] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []
-[2024-11-28T02:23:29.173111+00:00] sql.INFO: [15.96] select * from `website` where json_contains(`website_url`, '"localhost:3000"') limit 1 [] []

+ 6 - 0
vendor/composer/autoload_classmap.php

@@ -24,12 +24,16 @@ return array(
     'App\\Model\\Article' => $baseDir . '/app/Model/Article.php',
     'App\\Model\\ArticleData' => $baseDir . '/app/Model/ArticleData.php',
     'App\\Model\\Category' => $baseDir . '/app/Model/Category.php',
+    'App\\Model\\Component' => $baseDir . '/app/Model/Component.php',
     'App\\Model\\Department' => $baseDir . '/app/Model/Department.php',
     'App\\Model\\District' => $baseDir . '/app/Model/District.php',
+    'App\\Model\\FooterCategory' => $baseDir . '/app/Model/FooterCategory.php',
+    'App\\Model\\FooterContent' => $baseDir . '/app/Model/FooterContent.php',
     'App\\Model\\LetterOfComplaint' => $baseDir . '/app/Model/LetterOfComplaint.php',
     'App\\Model\\LetterType' => $baseDir . '/app/Model/LetterType.php',
     'App\\Model\\Link' => $baseDir . '/app/Model/Link.php',
     'App\\Model\\Model' => $baseDir . '/app/Model/Model.php',
+    'App\\Model\\Sector' => $baseDir . '/app/Model/Sector.php',
     'App\\Model\\Template' => $baseDir . '/app/Model/Template.php',
     'App\\Model\\TemplateClass' => $baseDir . '/app/Model/TemplateClass.php',
     'App\\Model\\User' => $baseDir . '/app/Model/User.php',
@@ -39,6 +43,8 @@ return array(
     'App\\Model\\WebsiteColumn' => $baseDir . '/app/Model/WebsiteColumn.php',
     'App\\Model\\WebsiteRole' => $baseDir . '/app/Model/WebsiteRole.php',
     'App\\Model\\WebsiteRoleUser' => $baseDir . '/app/Model/WebsiteRoleUser.php',
+    'App\\Model\\WebsiteTemplate' => $baseDir . '/app/Model/WebsiteTemplate.php',
+    'App\\Model\\WebsiteTemplateInfo' => $baseDir . '/app/Model/WebsiteTemplateInfo.php',
     'App\\Tools\\Result' => $baseDir . '/app/Tools/Result.php',
     'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
     'CURLStringFile' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php',

+ 6 - 0
vendor/composer/autoload_static.php

@@ -713,12 +713,16 @@ class ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654
         'App\\Model\\Article' => __DIR__ . '/../..' . '/app/Model/Article.php',
         'App\\Model\\ArticleData' => __DIR__ . '/../..' . '/app/Model/ArticleData.php',
         'App\\Model\\Category' => __DIR__ . '/../..' . '/app/Model/Category.php',
+        'App\\Model\\Component' => __DIR__ . '/../..' . '/app/Model/Component.php',
         'App\\Model\\Department' => __DIR__ . '/../..' . '/app/Model/Department.php',
         'App\\Model\\District' => __DIR__ . '/../..' . '/app/Model/District.php',
+        'App\\Model\\FooterCategory' => __DIR__ . '/../..' . '/app/Model/FooterCategory.php',
+        'App\\Model\\FooterContent' => __DIR__ . '/../..' . '/app/Model/FooterContent.php',
         'App\\Model\\LetterOfComplaint' => __DIR__ . '/../..' . '/app/Model/LetterOfComplaint.php',
         'App\\Model\\LetterType' => __DIR__ . '/../..' . '/app/Model/LetterType.php',
         'App\\Model\\Link' => __DIR__ . '/../..' . '/app/Model/Link.php',
         'App\\Model\\Model' => __DIR__ . '/../..' . '/app/Model/Model.php',
+        'App\\Model\\Sector' => __DIR__ . '/../..' . '/app/Model/Sector.php',
         'App\\Model\\Template' => __DIR__ . '/../..' . '/app/Model/Template.php',
         'App\\Model\\TemplateClass' => __DIR__ . '/../..' . '/app/Model/TemplateClass.php',
         'App\\Model\\User' => __DIR__ . '/../..' . '/app/Model/User.php',
@@ -728,6 +732,8 @@ class ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654
         'App\\Model\\WebsiteColumn' => __DIR__ . '/../..' . '/app/Model/WebsiteColumn.php',
         'App\\Model\\WebsiteRole' => __DIR__ . '/../..' . '/app/Model/WebsiteRole.php',
         'App\\Model\\WebsiteRoleUser' => __DIR__ . '/../..' . '/app/Model/WebsiteRoleUser.php',
+        'App\\Model\\WebsiteTemplate' => __DIR__ . '/../..' . '/app/Model/WebsiteTemplate.php',
+        'App\\Model\\WebsiteTemplateInfo' => __DIR__ . '/../..' . '/app/Model/WebsiteTemplateInfo.php',
         'App\\Tools\\Result' => __DIR__ . '/../..' . '/app/Tools/Result.php',
         'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
         'CURLStringFile' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php',

+ 2 - 2
vendor/composer/installed.php

@@ -3,7 +3,7 @@
         'name' => 'hyperf/hyperf-skeleton',
         'pretty_version' => 'dev-master',
         'version' => 'dev-master',
-        'reference' => '88364b42f4e1e1105abba7e611fce8b06ad3413c',
+        'reference' => '741286a10b3b1d094e982cae1713014805109b53',
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
@@ -439,7 +439,7 @@
         'hyperf/hyperf-skeleton' => array(
             'pretty_version' => 'dev-master',
             'version' => 'dev-master',
-            'reference' => '88364b42f4e1e1105abba7e611fce8b06ad3413c',
+            'reference' => '741286a10b3b1d094e982cae1713014805109b53',
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),

部分文件因为文件数量过多而无法显示