|
@@ -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
|
+}
|