Your Name 5 months ago
parent
commit
08abcc9437

+ 216
- 0
application/api/controller/Mapbuild.php View File

@@ -0,0 +1,216 @@
1
+<?php
2
+/**
3
+ * 易优CMS
4
+ * ============================================================================
5
+ * 版权所有 2016-2028 海南赞赞网络科技有限公司,并保留所有权利。
6
+ * 网站地址: http://www.eyoucms.com
7
+ * ----------------------------------------------------------------------------
8
+ * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷.
9
+ * ============================================================================
10
+ * Author: 小虎哥 <1105415366@qq.com>
11
+ * Date: 2018-4-3
12
+ */
13
+
14
+namespace app\api\controller;
15
+
16
+use \think\Db;
17
+use Overtrue\Pinyin\Pinyin;
18
+use app\api\logic\Sqldata;
19
+
20
+class Mapbuild extends Base
21
+{
22
+    /*
23
+     * 初始化操作
24
+     */
25
+    
26
+    public function _initialize() {
27
+        parent::_initialize();
28
+        session('user'); // 哪里用到 session_id() , 哪个文件就加上这行代码
29
+    }
30
+
31
+
32
+    /*
33
+    * 地图url分组
34
+    * https://www.zc10000.com/api/mapbuild/catIndex
35
+    */
36
+    public function catIndex()
37
+    {
38
+
39
+        $data = [
40
+            '主页',
41
+            '申报资讯列表页',
42
+            '申报资讯详情页',
43
+            '评审政策列表页',
44
+            '评审政策详情页',
45
+            '评审政策 区域 列表页',
46
+            '评审政策 区域 列表页 分页',
47
+            '评审政策 区域 详情页',
48
+            '业绩材料列表页',
49
+            '业绩材料详情页',
50
+            '标签页列表页',
51
+            '标签页列表页分页'
52
+        ];
53
+        foreach ($data as $key => $row){
54
+            $insert['gid'] = $key;
55
+            $insert['name'] = $row;
56
+            $one = Db::name('all_name')->where('gid','=',$key)->find();
57
+            if(!empty($one)){
58
+                Db::name('all_name')->where('gid','=',$key)->update($insert);
59
+            }else{
60
+                Db::name('all_name')->insert($insert);
61
+            }
62
+        }
63
+        /*
64
+         * 查询sql
65
+         *
66
+         */
67
+        $sql = "select a.group_id,(SELECT b.name FROM ey_all_name b WHERE b.gid = a.group_id) AS group_name,a.url, date_format(a.update_time,'%Y-%m-%d %H:%i:%s') AS 更新时间, CASE 
68
+        WHEN a.is_del = 0 THEN ''
69
+        ELSE '文档已删除'
70
+    END AS 是否删除,CASE 
71
+        WHEN a.is_null = 0 THEN ''
72
+        ELSE '列表数据为空'
73
+    END AS 列表是否为空,CASE 
74
+        WHEN a.is_arcrank = 0 THEN ''
75
+        ELSE '文档审核中'
76
+    END AS 文档是否审核,CASE 
77
+        WHEN a.is_status = 0 THEN ''
78
+        ELSE '屏蔽中'
79
+    END AS 正常或者屏蔽 from ey_all_url a order by a.group_id asc";
80
+
81
+    }
82
+
83
+    /*
84
+     * 生成百度地图
85
+     * https://www.zc10000.com/api/mapbuild/index100?type=xml
86
+     * https://www.zc10000.com/api/mapbuild/index100?type=txt
87
+     * https://www.zc10000.com/api/mapbuild/index100?type=html
88
+     *
89
+     */
90
+    public function index100(){
91
+
92
+        $Sqldata = new Sqldata();
93
+        //$aid = $Sqldata->index();
94
+        //var_dump($aid);die;
95
+
96
+        /*
97
+         * 可对比系统的xml生成
98
+         * 地图文档开头输出
99
+         */
100
+        $type = request()->get('type','xml');
101
+        $data = '';
102
+        switch ($type) {
103
+            case 'xml':
104
+                header('Content-type: text/xml');
105
+                $data = new \XMLWriter();
106
+                $data->openMemory();
107
+                $data->startDocument('1.0', 'UTF-8');
108
+                $data->startElement('urlset');
109
+                $data->writeAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
110
+                $data->writeAttribute('xmlns:mobile', 'http://www.google.com/schemas/sitemap-mobile/1.0');
111
+
112
+                break;
113
+            case 'txt':
114
+                $data = '';
115
+                break;
116
+            case 'html':
117
+                //var_dump("444");
118
+                $data = $Sqldata->gethtml();
119
+                break;
120
+            default:
121
+                // 如果没有匹配的值
122
+        }
123
+
124
+        /*
125
+         * 方法1 获取主页
126
+         */
127
+        $data = $Sqldata->add_1($type,$data);
128
+
129
+
130
+        /*
131
+         * 方法2 生成其他数据
132
+         * 根据具体场景生成 组id
133
+         */
134
+
135
+        //申报资讯列表页
136
+        $list = $Sqldata->get_url_list('zx',1231,12);
137
+        $data = $Sqldata->add_2($type,$data,$list,1,0,'hourly','0.9',0);
138
+
139
+        //申报资讯详情页
140
+        $list = $Sqldata->get_url_detail('zx',1231,2);
141
+        $data = $Sqldata->add_2($type,$data,$list,2,0,'hourly','0.8',0);
142
+
143
+        //评审政策列表页
144
+        $list = $Sqldata->get_url_list('zc',1232,12);
145
+        $data = $Sqldata->add_2($type,$data,$list,3,0,'hourly','0.9',0);
146
+
147
+
148
+
149
+
150
+        //评审政策详情页
151
+        $list = $Sqldata->get_url_detail('zc/',1232,2);
152
+        $data = $Sqldata->add_2($type,$data,$list,4,0,'hourly','0.8',0);
153
+
154
+        //评审政策 区域 列表页
155
+        $list = $Sqldata->get_cat_area_list('zc',1232,12);
156
+        $data = $Sqldata->add_2($type,$data,$list,5,1,'hourly','0.9',1);
157
+
158
+        //评审政策 区域 列表页 分页
159
+        $list = $Sqldata->get_cat_area_list_page('zc',1232,12);
160
+        $data = $Sqldata->add_2($type,$data,$list,6,0,'hourly','0.9',0);
161
+
162
+        //评审政策 区域 详情页
163
+        $list = $Sqldata->get_url_area_detail('zc',1232,2);
164
+        $data = $Sqldata->add_2($type,$data,$list,7,0,'hourly','0.8',0);
165
+
166
+
167
+        //业绩材料列表页
168
+        $list = $Sqldata->get_url_list('cl',1233,12);
169
+        $data = $Sqldata->add_2($type,$data,$list,8,0,'hourly','0.9',0);
170
+
171
+        //业绩材料详情页
172
+        $list = $Sqldata->get_url_detail('cl/',1233,2);
173
+        $data = $Sqldata->add_2($type,$data,$list,9,0,'hourly','0.8',0);
174
+
175
+
176
+        //标签页列表页 不需要标签页主页和分页
177
+        $list = $Sqldata->get_tag_list();
178
+        $data = $Sqldata->add_2($type,$data,$list,10,0,'hourly','0.9',0);
179
+
180
+        //标签页列表页 分页
181
+        $list = $Sqldata->get_tag_list_page('tag',12);
182
+        $data = $Sqldata->add_2($type,$data,$list,11,0,'hourly','0.9',0);
183
+
184
+
185
+        //地图文档结尾输出
186
+        switch ($type) {
187
+            case 'xml':
188
+                // ... 添加其他页面的URL
189
+                $data->endElement();
190
+                $data->endDocument();
191
+                //var_dump($xmlWriter->outputMemory(true));
192
+                file_put_contents('./sitemap.xml', $data->outputMemory(true));
193
+                break;
194
+            case 'txt':
195
+                file_put_contents('./sitemap.txt',$data);
196
+                break;
197
+            case 'html':
198
+
199
+                $data .=  $Sqldata->gethtmlend();
200
+
201
+                //./sitemaps/sitemap.html
202
+                file_put_contents('./sitemap.html',$data);
203
+                break;
204
+            default:
205
+                // 如果没有匹配的值
206
+        }
207
+        return json([]);
208
+    }
209
+
210
+
211
+    /*
212
+     * 以下都是获取链接的方法
213
+     * 有共性 有差异
214
+     */
215
+
216
+}

+ 577
- 0
application/api/logic/Sqldata.php View File

@@ -0,0 +1,577 @@
1
+<?php
2
+/**
3
+ * 易优CMS
4
+ * ============================================================================
5
+ * 版权所有 2016-2028 海南赞赞网络科技有限公司,并保留所有权利。
6
+ * 网站地址: http://www.eyoucms.com
7
+ * ----------------------------------------------------------------------------
8
+ * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷.
9
+ * ============================================================================
10
+ * Author: 小虎哥 <1105415366@qq.com>
11
+ * Date: 2018-4-3
12
+ */
13
+
14
+namespace app\api\logic;
15
+
16
+use think\Model;
17
+use think\Db;
18
+
19
+/**
20
+ * 逻辑定义
21
+ * Class CatsLogic
22
+ * @package api\Logic
23
+ */
24
+class Sqldata extends Model
25
+{
26
+    public function index(){
27
+        return "4444";
28
+    }
29
+
30
+
31
+
32
+
33
+    /*
34
+     * url 进行入库操作 统计
35
+     */
36
+    public function unsetHandle($list=[],$group_id=0,$type='xml'){
37
+        if($type == 'txt') {
38
+            $temp = [];
39
+            foreach ($list as $k => $value) {
40
+                $data = [];
41
+                $update_data = [];
42
+                if (strpos($value, 'is_del') !== false) {
43
+                    $data['is_del'] = 1;
44
+                    $update_data['is_del'] = 1;
45
+                } else {
46
+                    $data['is_del'] = 0;
47
+                    $update_data['is_del'] = 0;
48
+                }
49
+                if (strpos($value, 'is_arcrank') !== false) {
50
+                    $data['is_arcrank'] = 1;
51
+                    $update_data['is_arcrank'] = 1;
52
+                } else {
53
+                    $data['is_arcrank'] = 0;
54
+                    $update_data['is_arcrank'] = 0;
55
+                }
56
+
57
+                if (strpos($value, 'is_status') !== false) {
58
+                    $data['is_status'] = 1;
59
+                    $update_data['is_status'] = 1;
60
+                } else {
61
+                    $data['is_status'] = 0;
62
+                    $update_data['is_status'] = 0;
63
+                }
64
+                if (strpos($value, 'list_is_null') !== false) {
65
+                    $data['is_null'] = 1;
66
+                    $update_data['is_null'] = 1;
67
+                    //列表页为空 也要加入地图
68
+                    $new_url = explode('---', $value);
69
+                    $new_url = $new_url[0];
70
+                    $temp[] = $new_url;
71
+                } else {
72
+                    $data['is_null'] = 0;
73
+                    $update_data['is_null'] = 0;
74
+                }
75
+
76
+                if (strpos($value, '---') !== false) {
77
+                    $new_url = explode('---', $value);
78
+                    $new_url = $new_url[0];
79
+                } else {
80
+                    $new_url = $value;
81
+                    //其他url加入地图
82
+                    $temp[] = $value;
83
+                }
84
+                $one = Db::name('all_url')->where(['url' => $new_url])->find();
85
+                if (empty($one)) {
86
+                    $data['group_id'] = $group_id;
87
+                    $data['url'] = $new_url;
88
+                    $data['update_time'] = time();
89
+                    $data['add_time'] = time();
90
+                    Db::name('all_url')->insert($data);
91
+                } else {
92
+                    $update_data['update_time'] = time();
93
+                    $update_data['group_id'] = $group_id;
94
+                    Db::name('all_url')->where(['url' => $new_url])->update($update_data);
95
+                }
96
+            }
97
+            return $temp;
98
+        }else{
99
+            return $list;
100
+        }
101
+    }
102
+
103
+
104
+    /*
105
+     * 重复生成 xml 对象数据
106
+     */
107
+    public function buildXml($xmlWriter,$value,$time,$mod="hourly",$level="1.0")
108
+    {
109
+        /*
110
+         * 循环 start
111
+         */
112
+        // 添加你网站的URL
113
+        $xmlWriter->startElement('url');
114
+        $xmlWriter->writeElement('loc', $value);
115
+        $xmlWriter->writeElement('lastmod', $time);
116
+        $xmlWriter->writeElement('changefreq', $mod);
117
+        //always hourly daily weekly monthly yearly never
118
+        $xmlWriter->writeElement('priority', $level); //优先级 0.0到1.0之间
119
+
120
+        $xmlWriter->startElement('mobile:mobile');
121
+        $xmlWriter->writeAttribute('type', 'htmladapt');
122
+        //<mobile:mobile type="pc,mobile"/>
123
+        //<mobile:mobile/> :移动网页
124
+        //<mobile:mobile type="mobile"/> :移动网页
125
+        //<mobile:mobile type="htmladapt"/>:代码适配
126
+        $xmlWriter->endElement();
127
+        $xmlWriter->endElement();
128
+        /*
129
+         * 循环 end
130
+         */
131
+        return $xmlWriter;
132
+    }
133
+
134
+    public function gethtml(){
135
+
136
+        return '
137
+            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
138
+            <html xmlns="http://www.w3.org/1999/xhtml">
139
+            <head>
140
+            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
141
+            <meta charset="UTF-8">
142
+            <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
143
+            <meta name="renderer" content="webkit">
144
+            <meta name="force-rendering" content="webkit">
145
+            <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
146
+            <meta name="applicable-device" content="pc,mobile">
147
+            <meta name="author" content="order by ">
148
+            <title>职称E家_网站地图</title>
149
+            </head>
150
+            <style>
151
+            * {
152
+                margin: 0px;
153
+                padding: 0px;
154
+            }
155
+            a {
156
+                color: grey;
157
+                text-decoration: none;
158
+            }
159
+            h1 a {
160
+                color: Black;
161
+            }
162
+            h1 {
163
+                font-size: 15px;
164
+                display: block;
165
+                max-width: 1200px;
166
+                margin: 0 auto;
167
+                border: 1px solid #eee;
168
+                padding: 10px;
169
+                color: Black;
170
+            }
171
+            h2 {
172
+                color: Black;
173
+                font-size: 16px;
174
+                margin-bottom: 10px;
175
+            }
176
+            a:hover {
177
+                color: Black;
178
+                text-decoration: underline;
179
+            }
180
+            .content {
181
+                max-width: 1200px;
182
+                border: 1px solid #eee;
183
+                margin: 0 auto;
184
+                padding: 10px;
185
+                margin-top: 10px;
186
+                color: #999;
187
+                overflow: hidden;
188
+            }
189
+            li {
190
+                text-indent: 20px;
191
+                list-style: disc;
192
+            }
193
+            .content li {
194
+                width: 285px;
195
+                text-indent: 5px;
196
+                float: left;
197
+                list-style: none;
198
+                height: 30px;
199
+            }
200
+            .content li a {
201
+                display: block;
202
+                height: 25px;
203
+                overflow: hidden;
204
+            }
205
+            </style>
206
+            <body>
207
+            <h1>
208
+                <a href="https://www.zc10000.com/">职称E家</a>
209
+            </h1>
210
+            
211
+            <div class="content">
212
+              <h2>分类</h2>
213
+              <ul>';
214
+
215
+    }
216
+
217
+    public function gethtmlend(){
218
+
219
+        $taglist = Db::name('archives')->where(['typeid'=>371,'status'=>1,'is_del'=>0])->select();
220
+        $html = '';
221
+        foreach($taglist as $k=>$v){
222
+            $html .= '<li><a target="_blank" href="https://www.zc10000.com/tag'.$v['number'].'">'.$v['title'].'</a></li>';
223
+        }
224
+        return '
225
+                    <div class="content">
226
+                        <h2>最新tags</h2>
227
+                        <ul>
228
+                                    '.$html.'
229
+                                </ul>
230
+                    </div>
231
+                    
232
+                    </body>
233
+                    </html>';
234
+    }
235
+
236
+    public function add_1($type,$data){
237
+
238
+        $list = [
239
+            'https://www.zc10000.com', //主页
240
+            'https://www.zc10000.com/zx', //栏目 + 分页 + 详情
241
+            'https://www.zc10000.com/zc', //栏目 + 分页 + 详情
242
+            'https://www.zc10000.com/cl', //栏目 + 分页 + 详情
243
+            'https://www.zc10000.com/cp', //栏目 + 分页 + 详情
244
+            //'https://www.zc10000.com/area', //区域 + 省级主页 + 城市主页 + 结合栏目
245
+            'https://www.zc10000.com/taglist', //标签 + 结合栏目 + 结合区域
246
+        ];
247
+        $html_a = ['职称E家','申报资讯','评审政策','业绩材料','一键测评','标签列表'];
248
+        $list = $this->unsetHandle($list,0,$type);
249
+
250
+
251
+        switch ($type) {
252
+            case 'xml':
253
+                foreach ($list as $k=>$value){
254
+                    $data = $this->buildXml($data,$value,date('Y-m-d',time()));
255
+                }
256
+
257
+                break;
258
+            case 'txt':
259
+                foreach ($list as $k=>$value){
260
+                    $data .= $value."\r\n";
261
+                }
262
+
263
+                break;
264
+            case 'html':
265
+                foreach ($list as $k=>$value){
266
+                    $data .= '<li><a target="_blank" href="'.$value.'">'.$html_a[$k].'</a></li>';
267
+                }
268
+                $data .= "</ul></div>";
269
+                break;
270
+            default:
271
+                // 如果没有匹配的值
272
+        }
273
+
274
+        return $data;
275
+    }
276
+
277
+    public function add_2($type,$data,$list,$groupid,$is_html,$hourly,$level,$htmldata){
278
+        $list_1 = $this->unsetHandle($list,$groupid,$type);
279
+        //$list = array_merge($list,$list_1);
280
+        switch ($type) {
281
+            case 'xml':
282
+                foreach ($list_1 as $k=>$value){
283
+                    $data = $this->buildXml($data,$value,date('Y-m-d',time()),$hourly,$level);
284
+                }
285
+                break;
286
+            case 'txt':
287
+                foreach ($list_1 as $k=>$value){
288
+                    $data .= $value."\r\n";
289
+                }
290
+                break;
291
+            case 'html':
292
+                //html 需要 name
293
+                //需要的时候再 独立场景处理即可
294
+                if((int)$is_html === 1){
295
+
296
+                    if((int)$htmldata === 1){
297
+                        $one_data = $this->gethtml_1($data,$list);
298
+                        $data = $data.$one_data;
299
+                    }
300
+
301
+                }
302
+                break;
303
+            default:
304
+                // 如果没有匹配的值
305
+        }
306
+        return $data;
307
+    }
308
+
309
+    public function gethtml_1($data,$list){
310
+        $data = '<div class="content"><h2>评审政策区域分类</h2><ul>';
311
+        //dump($list_1);die;
312
+        foreach ($list as $k=>$value){
313
+            $value1 = explode('/',$value);
314
+            $value2 = end($value1);
315
+            $name = Db::name('citysite')->where('domain','=',$value2)->value('name');
316
+            $data .= '<li><a target="_blank" href="'.$value.'">'.$name.'职称</a></li>';
317
+        }
318
+        $data .= '</ul></div>';
319
+        return $data;
320
+    }
321
+
322
+    /*
323
+     * 无区域 主页或列表页
324
+     * 已手动填写 根据业务场景 固定数量
325
+     * 例如 /
326
+     * 栏目 /zx
327
+     * 标签 /taglist
328
+     * 区域 /area
329
+     *
330
+     * 其他 结合序列号 生成所有url 分层级 tree列表
331
+     * 对于xml更新优先级 主页1.0 列表页0.9 详情页0.8
332
+     *
333
+     * 具体路由规则根据变量自由组合
334
+     * 有些是主域名或二级域名开头
335
+     * 不同规则组合结果不同
336
+     */
337
+
338
+    /*
339
+     * 无区域 栏目列表页 分页
340
+     * /zx-2
341
+     * 具体路由规则根据变量自由组合
342
+     */
343
+    public function get_url_list($str="zx",$typeid=1231,$pasize=12)
344
+    {
345
+        $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0])->count();
346
+
347
+        $desc = '';
348
+        if((int)$list === 0){
349
+            $list = 1; //假设有一条数据
350
+            $desc = '---(list_is_null)';
351
+        }
352
+
353
+        $page = ceil($list/$pasize);
354
+        $url = [];
355
+        for ($i=2;$i<=$page;$i++){
356
+            $url[] = 'https://www.zc10000.com/'.$str.'-'.$i.$desc;
357
+        }
358
+        return $url;
359
+    }
360
+
361
+    /*
362
+     * 无区域 文档详情链接
363
+     * /zx/1
364
+     * 具体路由规则根据变量自由组合
365
+     */
366
+    public function get_url_detail($str="zclw/lunwen",$typeid=116,$ty=4)
367
+    {
368
+        $list_1 = Db::name('seo_number')->where(['type'=>$ty,'tid'=>$typeid,'is_del'=>0,'area_id'=>0])->select();
369
+        foreach ($list_1 as $key=>$item) {
370
+            //判断文档是否已删除
371
+            $op = Db::name('archives')->where(['aid'=>$item['aid']])->find();
372
+            $desc = '';
373
+            if((int)$op['is_del'] === 1){
374
+                $desc .= '---ID: '.$item['aid']."(is_del)";
375
+            }
376
+            if((int)$op['arcrank'] === 1){
377
+                $desc .= '---ID: '.$item['aid']."(is_arcrank)";
378
+            }
379
+            if((int)$op['status'] === 0){
380
+                $desc .= '---ID: '.$item['aid']."(is_status)";
381
+            }
382
+            $url[] = 'https://www.zc10000.com/'.$str.$item['number'].$desc;
383
+        }
384
+        return $url;
385
+    }
386
+
387
+
388
+    /*
389
+     * 纯区域分页 (如果细分到区县 数量多就存在)
390
+     * /area-2
391
+     */
392
+
393
+    /*
394
+     * 纯具体区域主页
395
+     * /guangdong
396
+     */
397
+
398
+     /*
399
+      * 纯具体区域 列表页 分页 (显示城市) (不存在)
400
+      * /guangdong-2
401
+     */
402
+
403
+    /*
404
+     * 具体城市主页
405
+     * /guangdong/guangzhou
406
+     * 具体路由规则根据变量自由组合
407
+     */
408
+
409
+    /*
410
+     * 生成栏目结合区域 列表页
411
+     * /zx/guangdong
412
+     * 区域设置多级就继续遍历 /zx/guangdong/guangzhou
413
+     * 具体路由规则根据变量自由组合
414
+     */
415
+    public function get_cat_area_list($str="zhengce",$typeid=115,$pasize=10)
416
+    {
417
+        $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
418
+        $url = [];
419
+        foreach ($area as $index=>$row){
420
+            //城市再遍历一次
421
+            //$collect = Db::name('citysite')->where(['parent_id'=>$row['id']])->select();
422
+            //根据路由规则处理
423
+            $url[] = 'https://www.zc10000.com/'.$str.'/'.$row['domain'];
424
+        }
425
+        return $url;
426
+    }
427
+
428
+
429
+    /*
430
+     * 生成栏目区域 列表页 分页
431
+     * /zx/guangdong-2
432
+     * 区域设置多级就继续遍历 /zx/guangdong/guangzhou-2
433
+     * 具体路由规则根据变量自由组合
434
+     */
435
+    public function get_cat_area_list_page($str="zhengce",$typeid=115,$pasize=10)
436
+    {
437
+        $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
438
+        $url = [];
439
+        foreach ($area as $index=>$row){
440
+            //$collect = Db::name('citysite')->where(['parent_id'=>$row['id']])->select();
441
+            //foreach ($collect as $key=>$item){
442
+                //seo_number 并没有这个字段 arcrank  假设没有 先不管了
443
+                $list = Db::name('archives')->where([
444
+                        'typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'area_tag_id'=>$row['id']
445
+                    ])->count();
446
+
447
+                $desc = '';
448
+                if((int)$list === 0){
449
+                    $list = 1; //假设有一条数据
450
+                    $desc = '---list_is_null)';
451
+                }
452
+                $page = ceil($list/$pasize);
453
+                for ($i=2;$i<=$page;$i++){
454
+                    $url[] = 'https://www.zc10000.com/'.$str.'/'.$row['domain'].'-'.$i.$desc;
455
+                }
456
+            //}
457
+        }
458
+        return $url;
459
+    }
460
+
461
+
462
+
463
+    /*
464
+     * 纯标签列表页 分页
465
+     * /taglist-2
466
+     * 具体路由规则根据变量自由组合
467
+     */
468
+
469
+    /*
470
+     * 纯具体标签列表页
471
+     * /tag1200
472
+     * 具体路由规则根据变量自由组合
473
+     */
474
+    public function get_tag_list(){
475
+        $taglist = Db::name('archives')->where(['typeid'=>371,'status'=>1,'is_del'=>0])->select();
476
+        $url = [];
477
+        foreach ($taglist as $index=>$row){
478
+            //城市再遍历一次
479
+            //$collect = Db::name('citysite')->where(['parent_id'=>$row['id']])->select();
480
+            //根据路由规则处理
481
+            $url[] = 'https://www.zc10000.com/tag'.$row['number'];
482
+        }
483
+        return $url;
484
+    }
485
+
486
+
487
+    /*
488
+     * 纯标签列表页 分页
489
+     * /tag1200-2
490
+     * 具体路由规则根据变量自由组合
491
+     */
492
+    public function get_tag_list_page($str,$pasize){
493
+        $taglist = Db::name('archives')->where(['typeid'=>371,'status'=>1,'is_del'=>0])->select();
494
+        $url = [];
495
+        foreach ($taglist as $index=>$row){
496
+            //$collect = Db::name('citysite')->where(['parent_id'=>$row['id']])->select();
497
+            //foreach ($collect as $key=>$item){
498
+            //seo_number 并没有这个字段 arcrank  假设没有 先不管了
499
+            $list = Db::name('archives')->where([
500
+                    'status'=>1,'is_del'=>0,'arcrank'=>0,'area_tag_id'=>$row['aid']
501
+                ])->where('typeid','in','1231,1232,1233')->count();
502
+
503
+            $desc = '';
504
+            if((int)$list === 0){
505
+                $list = 1; //假设有一条数据
506
+                $desc = '---list_is_null)';
507
+            }
508
+            $page = ceil($list/$pasize);
509
+            for ($i=2;$i<=$page;$i++){
510
+                $url[] = 'https://www.zc10000.com/'.$str.$row['number'].'-'.$i.$desc;
511
+            }
512
+            //}
513
+        }
514
+        return $url;
515
+    }
516
+
517
+    /*
518
+     * 生成栏目标签 列表页 (无区域)
519
+     * /zx/tag1200
520
+     * 具体路由规则根据变量自由组合
521
+     */
522
+
523
+    /*
524
+     * 生成栏目标签 列表页 分页 (无区域)
525
+     * /zx/tag1200-2
526
+     * 具体路由规则根据变量自由组合
527
+     */
528
+
529
+    /*
530
+     * 生成栏目区域+标签 列表页
531
+     * /zx/guangdong/tag1200
532
+     * 区域设置多级就继续遍历 /zx/guangdong/guangzhou/tag1200
533
+     * 具体路由规则根据变量自由组合
534
+     */
535
+
536
+    /*
537
+     * 生成栏目区域+标签 列表页 分页
538
+     * /zx/guangdong/tag1200-2
539
+     * 区域设置多级就继续遍历 /zx/guangdong/guangzhou/tag1200-2
540
+     * 具体路由规则根据变量自由组合
541
+     */
542
+
543
+    /*
544
+     * 带区域 栏目详情页  (详情页跟标签无关)
545
+     * /zx/guangdong/3
546
+     * 区域设置多级就继续遍历 /zx/guangdong/guangzhou/3
547
+     * 具体路由规则根据变量自由组合
548
+     */
549
+
550
+    public function get_url_area_detail($str="zhengce/cms",$typeid=115,$ty=2,$area_id=0,$city_id=0)
551
+    {
552
+        $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
553
+        $url = [];
554
+        foreach ($area as $index=>$row){
555
+            $list_1 = Db::name('seo_number')->where([
556
+                    'type'=>$ty,'tid'=>$typeid,'is_del'=>0,"area_id"=>$row['id'],"city_id"=>$city_id
557
+                ])->select();
558
+            foreach ($list_1 as $key=>$item) {
559
+                //判断文档是否已删除
560
+                $op = Db::name('archives')->where(['aid'=>$item['aid']])->find();
561
+                $desc = '';
562
+                if((int)$op['is_del'] === 1){
563
+                    $desc .= '---ID: '.$item['aid']."(is_del)";
564
+                }
565
+                if((int)$op['arcrank'] === 1){
566
+                    $desc .= '---ID: '.$item['aid']."(is_arcrank)";
567
+                }
568
+                if((int)$op['status'] === 0){
569
+                    $desc .= '---ID: '.$item['aid']."(is_status)";
570
+                }
571
+                $url[] = 'https://www.zc10000.com/'.$str.'/'.$row['domain'].'/'.$item['number'].$desc;
572
+            }
573
+        }
574
+        return $url;
575
+    }
576
+
577
+}

+ 86
- 79
sitemap.html
File diff suppressed because it is too large
View File


+ 134
- 0
sitemap.txt View File

@@ -0,0 +1,134 @@
1
+https://www.zc10000.com
2
+https://www.zc10000.com/zx
3
+https://www.zc10000.com/zc
4
+https://www.zc10000.com/cl
5
+https://www.zc10000.com/cp
6
+https://www.zc10000.com/taglist
7
+https://www.zc10000.com/zx1
8
+https://www.zc10000.com/zx2
9
+https://www.zc10000.com/zx3
10
+https://www.zc10000.com/zx4
11
+https://www.zc10000.com/zc-2
12
+https://www.zc10000.com/zc-3
13
+https://www.zc10000.com/zc-4
14
+https://www.zc10000.com/zc-5
15
+https://www.zc10000.com/zc-6
16
+https://www.zc10000.com/zc/1
17
+https://www.zc10000.com/zc/guangdong
18
+https://www.zc10000.com/zc/fujian
19
+https://www.zc10000.com/zc/sx
20
+https://www.zc10000.com/zc/yunnan
21
+https://www.zc10000.com/zc/sichuan
22
+https://www.zc10000.com/zc/zhongqing
23
+https://www.zc10000.com/zc/hainan
24
+https://www.zc10000.com/zc/guangxi
25
+https://www.zc10000.com/zc/hunan
26
+https://www.zc10000.com/zc/hubei
27
+https://www.zc10000.com/zc/henan
28
+https://www.zc10000.com/zc/shandong
29
+https://www.zc10000.com/zc/jiangxi
30
+https://www.zc10000.com/zc/anhui
31
+https://www.zc10000.com/zc/jiangsu
32
+https://www.zc10000.com/zc/shanghai
33
+https://www.zc10000.com/zc/heilongjiang
34
+https://www.zc10000.com/zc/jilin
35
+https://www.zc10000.com/zc/liaoning
36
+https://www.zc10000.com/zc/shanxi
37
+https://www.zc10000.com/zc/hebei
38
+https://www.zc10000.com/zc/tianjin
39
+https://www.zc10000.com/zc/zhejiang
40
+https://www.zc10000.com/zc/guizhou
41
+https://www.zc10000.com/zc/namenggu
42
+https://www.zc10000.com/zc/beijing
43
+https://www.zc10000.com/zc/gansu
44
+https://www.zc10000.com/zc/qinghai
45
+https://www.zc10000.com/zc/ningxia
46
+https://www.zc10000.com/zc/guangdong/1
47
+https://www.zc10000.com/zc/guangdong/2
48
+https://www.zc10000.com/zc/guangdong/3
49
+https://www.zc10000.com/zc/guangdong/4
50
+https://www.zc10000.com/zc/guangdong/5
51
+https://www.zc10000.com/zc/sx/1
52
+https://www.zc10000.com/zc/sx/2
53
+https://www.zc10000.com/zc/sx/3
54
+https://www.zc10000.com/zc/sichuan/1
55
+https://www.zc10000.com/zc/sichuan/2
56
+https://www.zc10000.com/zc/hainan/1
57
+https://www.zc10000.com/zc/guangxi/1
58
+https://www.zc10000.com/zc/guangxi/2
59
+https://www.zc10000.com/zc/guangxi/3
60
+https://www.zc10000.com/zc/guangxi/4
61
+https://www.zc10000.com/zc/hubei/1
62
+https://www.zc10000.com/zc/hubei/2
63
+https://www.zc10000.com/zc/hubei/3
64
+https://www.zc10000.com/zc/shandong/1
65
+https://www.zc10000.com/zc/shandong/2
66
+https://www.zc10000.com/zc/shandong/3
67
+https://www.zc10000.com/zc/shandong/4
68
+https://www.zc10000.com/zc/jiangxi/1
69
+https://www.zc10000.com/zc/jiangxi/2
70
+https://www.zc10000.com/zc/jiangxi/3
71
+https://www.zc10000.com/zc/anhui/1
72
+https://www.zc10000.com/zc/anhui/2
73
+https://www.zc10000.com/zc/anhui/3
74
+https://www.zc10000.com/zc/shanghai/1
75
+https://www.zc10000.com/zc/shanghai/2
76
+https://www.zc10000.com/zc/shanghai/3
77
+https://www.zc10000.com/zc/shanghai/4
78
+https://www.zc10000.com/zc/heilongjiang/1
79
+https://www.zc10000.com/zc/heilongjiang/2
80
+https://www.zc10000.com/zc/heilongjiang/3
81
+https://www.zc10000.com/zc/liaoning/1
82
+https://www.zc10000.com/zc/liaoning/2
83
+https://www.zc10000.com/zc/liaoning/3
84
+https://www.zc10000.com/zc/shanxi/1
85
+https://www.zc10000.com/zc/shanxi/2
86
+https://www.zc10000.com/zc/shanxi/3
87
+https://www.zc10000.com/zc/tianjin/1
88
+https://www.zc10000.com/zc/tianjin/2
89
+https://www.zc10000.com/zc/tianjin/3
90
+https://www.zc10000.com/zc/guizhou/1
91
+https://www.zc10000.com/zc/guizhou/2
92
+https://www.zc10000.com/zc/guizhou/3
93
+https://www.zc10000.com/zc/namenggu/1
94
+https://www.zc10000.com/zc/namenggu/2
95
+https://www.zc10000.com/zc/namenggu/3
96
+https://www.zc10000.com/zc/beijing/1
97
+https://www.zc10000.com/zc/beijing/2
98
+https://www.zc10000.com/zc/beijing/3
99
+https://www.zc10000.com/zc/gansu/1
100
+https://www.zc10000.com/zc/gansu/2
101
+https://www.zc10000.com/zc/gansu/3
102
+https://www.zc10000.com/zc/qinghai/1
103
+https://www.zc10000.com/zc/qinghai/2
104
+https://www.zc10000.com/zc/qinghai/3
105
+https://www.zc10000.com/zc/ningxia/1
106
+https://www.zc10000.com/zc/ningxia/2
107
+https://www.zc10000.com/zc/ningxia/3
108
+https://www.zc10000.com/cl/1
109
+https://www.zc10000.com/tag1
110
+https://www.zc10000.com/tag2
111
+https://www.zc10000.com/tag3
112
+https://www.zc10000.com/tag4
113
+https://www.zc10000.com/tag5
114
+https://www.zc10000.com/tag6
115
+https://www.zc10000.com/tag7
116
+https://www.zc10000.com/tag8
117
+https://www.zc10000.com/tag9
118
+https://www.zc10000.com/tag10
119
+https://www.zc10000.com/tag11
120
+https://www.zc10000.com/tag12
121
+https://www.zc10000.com/tag13
122
+https://www.zc10000.com/tag14
123
+https://www.zc10000.com/tag15
124
+https://www.zc10000.com/tag16
125
+https://www.zc10000.com/tag17
126
+https://www.zc10000.com/tag18
127
+https://www.zc10000.com/tag19
128
+https://www.zc10000.com/tag20
129
+https://www.zc10000.com/tag21
130
+https://www.zc10000.com/tag22
131
+https://www.zc10000.com/tag23
132
+https://www.zc10000.com/tag24
133
+https://www.zc10000.com/tag25
134
+https://www.zc10000.com/tag26

+ 2
- 0
sitemap.xml
File diff suppressed because it is too large
View File


+ 7
- 3
template/pc/common/include/footer.htm View File

@@ -8,12 +8,14 @@
8 8
                     <p style="line-height: 20px;font-size: 13px;">
9 9
 
10 10
                         <p>{eyou:global name='web_attr_24' /}</p>
11
-                        <p> <a target="_self"  href="https://beian.miit.gov.cn/">{eyou:global name='web_attr_22' /}</a>
11
+                        <p> <a target="_self" rel="nofollow" href="https://beian.miit.gov.cn/">{eyou:global name='web_attr_22' /}</a>
12 12
                             &nbsp;{eyou:global name='web_attr_21' /} &nbsp;</p>
13 13
                         <p>
14 14
 
15 15
                         <!--Copyright © 2015-2024 版权所有 职称E家   All Rights Reserved-->
16
-                        <a href="javascript:;" target="_self">sitemap</a></p>
16
+                            <a href="https://www.zc10000.com/sitemap.html" target="_self">sitemap-html</a>
17
+                            <a href="https://www.zc10000.com/sitemap.xml" target="_self">sitemap-xml</a>
18
+                            <a href="https://www.zc10000.com/sitemap.txt" target="_self">sitemap-txt</a>
17 19
 
18 20
                     </p>
19 21
                     <img id="light-flogo" class="flogo" src="{eyou:global name='web_attr_31' /}" alt="职称E家LOGO" title="职称E家LOGO">
@@ -29,7 +31,9 @@
29 31
                     <a target="_self" rel="nofollow" href="https://beian.miit.gov.cn/">{eyou:global name='web_attr_22' /}</a>
30 32
                     <br/>Copyright © 2015-2024 版权所有 职称E家   All Rights Reserved
31 33
 
32
-                    <a href="javascript:;" target="_self">sitemap</a>
34
+                    <a href="https://www.zc10000.com/sitemap.html" target="_self">sitemap-html</a>
35
+                    <a href="https://www.zc10000.com/sitemap.xml" target="_self">sitemap-xml</a>
36
+                    <a href="https://www.zc10000.com/sitemap.txt" target="_self">sitemap-txt</a>
33 37
                 </p>
34 38
             </div>
35 39
         {/eyou:if}

+ 11
- 0
template/pc/common/include/top.htm View File

@@ -66,6 +66,17 @@
66 66
     <script src="/template/pc/js/zblogphp.js" type="text/javascript"></script>
67 67
 
68 68
 
69
+    <!--百度统计-->
70
+    <script>
71
+        var _hmt = _hmt || [];
72
+        (function() {
73
+            var hm = document.createElement("script");
74
+            hm.src = "https://hm.baidu.com/hm.js?6639bd38f43c3e51e0d66c52fc580de9";
75
+            var s = document.getElementsByTagName("script")[0];
76
+            s.parentNode.insertBefore(hm, s);
77
+        })();
78
+    </script>
79
+
69 80
 </head>
70 81
 <body>
71 82
 

Loading…
Cancel
Save