No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Other.php 146KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057
  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. namespace app\api\controller;
  14. use \think\Db;
  15. use Overtrue\Pinyin\Pinyin;
  16. class Other extends Base
  17. {
  18. /*
  19. * 初始化操作
  20. */
  21. public function _initialize() {
  22. parent::_initialize();
  23. session('user'); // 哪里用到 session_id() , 哪个文件就加上这行代码
  24. }
  25. /**
  26. * 广告位js
  27. */
  28. public function other_show()
  29. {
  30. $pid = input('pid/d',1);
  31. $row = input('row/d',1);
  32. $where = array(
  33. 'pid'=>$pid,
  34. 'status'=>1,
  35. // 'start_time'=>array('lt', getTime()),
  36. );
  37. $ad = M("ad")->where($where)
  38. // ->where('end_time', ['>', getTime()], ['=', 0], 'or')
  39. ->order("sort_order asc")
  40. ->limit($row)
  41. ->cache(true,EYOUCMS_CACHE_TIME, 'ad') // 如果查询条件有时间字段,一定要去掉这行,避免产生一堆缓存文件
  42. ->select();
  43. foreach ($ad as &$value) {
  44. $value['intro'] = htmlspecialchars_decode($value['intro']);
  45. $value['intro'] = str_replace("\r\n", "", $value['intro']);
  46. $value['intro'] = str_replace("'", "\'", $value['intro']);
  47. }
  48. $this->assign('ad', $ad);
  49. return $this->fetch();
  50. }
  51. /*
  52. * 复制省级分类
  53. */
  54. public function index(){
  55. return false;
  56. $pro_list = Db::table('ey_citysite')->where([
  57. "level" => 1,
  58. "parent_id" => 0,
  59. "topid" => 0,
  60. "status" => 1,
  61. ])->select();
  62. //dump($pro_list);
  63. //循环省份
  64. //1,30,6872,6791,6645,6344,6303,6003,5879,5742,5625,5448,5290,5179,5056,4833,4813,4667,4589,4474,4228,4042,4023,4003,6547,4359,4004,6990,7092,7144,7171
  65. /*foreach ($pro_list as $index=>$item){
  66. echo $item['id'].',';
  67. }*/
  68. //查询所有分类
  69. $cat_list = Db::table('ey_arctype')->where([
  70. 'topid'=>38,
  71. 'parent_id'=>38,
  72. 'type'=>'默认',
  73. 'status' => 1,
  74. 'is_del' => 0,
  75. 'area_id' => 1
  76. ])->select();
  77. $pid = '6344,6303,6003,5879,5742,5625,5448,5290,5179,5056,4833,4813,4667,4589,4474,4228,4042,4023,4003,6547,4359,4004,6990,7092,7144,7171';
  78. $pid = explode(',',$pid);
  79. //var_dump($pid);die;
  80. foreach ($pid as $index=>$item) {
  81. foreach ($cat_list as $key => $row) {
  82. //echo $row['id'].$row['typename'].'-';
  83. unset($row['id']);
  84. $row['area_id'] = $item;
  85. $row['dirname'] = $row['dirname'] . rand(1, 99999) . 'a' . rand(1, 99999);
  86. //插入表
  87. $res = Db::name('arctype')->insert($row);
  88. echo $res;
  89. }
  90. echo '<br>';
  91. }
  92. exit;
  93. }
  94. /*
  95. * 复制产品分类
  96. */
  97. public function index2(){
  98. return false;
  99. /*$pro_list = Db::table('ey_citysite')->where([
  100. "level" => 1,
  101. "parent_id" => 0,
  102. "topid" => 0,
  103. "status" => 1,
  104. ])->select();*/
  105. //dump($pro_list);
  106. //循环省份
  107. //1,30,6872,6791,6645,6344,6303,6003,5879,5742,5625,5448,5290,5179,5056,4833,4813,4667,4589,4474,4228,4042,4023,4003,6547,4359,4004,6990,7092,7144,7171
  108. /*foreach ($pro_list as $index=>$item){
  109. echo $item['id'].',';
  110. }*/
  111. //$pid = '6872,6791,6645,6344,6303,6003,5879,5742,5625,5448,5290,5179,5056,4833,4813,4667';
  112. $pid = '4589,4474,4228,4042,4023,4003,6547,4359,4004,6990,7092,7144,7171';
  113. $pid = explode(',',$pid);
  114. //var_dump($pid);die;
  115. foreach ($pid as $in=>$id) {
  116. $area_id = $id;
  117. //查询某区域所有分类
  118. $cat_list = Db::table('ey_arctype')->where([
  119. 'topid' => 38,
  120. 'parent_id' => 38,
  121. 'type' => '默认',
  122. 'status' => 1,
  123. 'is_del' => 0,
  124. 'area_id' => $area_id
  125. ])->order('id asc')->select();
  126. //dump($cat_list);die;
  127. $i = 1;
  128. foreach ($cat_list as $index => $item) {
  129. //查询对应广东地区的哪个分类
  130. $cat = Db::table('ey_arctype')->where([
  131. 'topid' => 38,
  132. 'parent_id' => 38,
  133. 'type' => '默认',
  134. 'status' => 1,
  135. 'is_del' => 0,
  136. 'area_id' => 1,
  137. 'typename' => $item['typename']
  138. ])->find();
  139. //echo $cat['typename'];
  140. //查询广东地区对应所有产品
  141. $pro_list = Db::table('ey_arctype')->where([
  142. 'topid' => 38,
  143. 'parent_id' => $cat['id'],
  144. 'type' => '产品',
  145. 'status' => 1,
  146. 'is_del' => 0,
  147. 'area_id' => 1 //广东
  148. ])->select();
  149. foreach ($pro_list as $key => $row) {
  150. //echo $row['id'].$row['typename'].'-';
  151. unset($row['id']);
  152. $row['area_id'] = $area_id; //区域id
  153. $row['parent_id'] = (int)$item['id']; //更改上级id
  154. $row['dirname'] = $row['dirname'] . rand(1, 99999) . 'a' . rand(1, 99999);
  155. //插入表
  156. $res = Db::name('arctype')->insert($row);
  157. $i = $i + $res;
  158. echo $i;
  159. }
  160. echo '<br>';
  161. }
  162. }
  163. exit;
  164. }
  165. /*
  166. * 处理员网站
  167. * https://www.zc10000.com/api/other/index3?page=1
  168. */
  169. public function index3(){
  170. return false;
  171. $page = $_GET['page']?$_GET['page']:1;
  172. $pagesize = 50; //每次处理50条
  173. //查询文章
  174. $list = Db::table('ey_web_ur')
  175. ->where('to_tid','=',0)
  176. ->order('id asc')
  177. ->paginate($pagesize)->toArray();
  178. //dump($list);die;
  179. foreach($list['data'] as $index=>$row){
  180. //构建新数据
  181. //启动事务
  182. // 启动事务
  183. Db::startTrans();
  184. try {
  185. /*业务*/
  186. $run = 0;
  187. $one = Db::table('ey_archives_before')
  188. ->where(['aid'=>$row['aid']])->find();
  189. //dump($row);die;
  190. if(!empty($one)){
  191. unset($one['aid']);
  192. //1,2,4 对应 115/68,69,70,80,92 对应 111 / 8对应118 /其他对应 117
  193. $tid = (int)$one['typeid'];
  194. if($tid === 1 || $tid === 2 || $tid === 4){
  195. $typeid = 115;
  196. $url = '/zhengce/cms';
  197. }else if($tid === 68 || $tid === 69 || $tid === 70 || $tid === 80 || $tid === 92){
  198. $typeid = 111;
  199. $url = '/wthz';
  200. }else if($tid === 8){
  201. $typeid = 118;
  202. $url = '/zcsb';
  203. }else{
  204. $typeid = 117;
  205. $url = '/gonglve';
  206. }
  207. $one['typeid'] = $typeid;
  208. $one['channel'] = 103;
  209. //把one新插入栏目
  210. $new_aid = Db::name('archives')->insertGetId($one);
  211. //处理附表
  212. $two = Db::table('ey_article_content_b')
  213. ->where('aid','=',$row['aid'])
  214. ->find();
  215. if(!empty($two)){
  216. unset($two['id']);
  217. unset($two['aid']);
  218. $two['aid'] = $new_aid; //新的aid
  219. $two['content_5'] = $two['content'];
  220. $two['content_ey_m'] = $two['content_ey_m'];
  221. unset($two['content']);
  222. unset($two['content_ey_m']);
  223. $two['downname'] = $two['filename'];
  224. $two['down'] = $two['file'];
  225. unset($two['file']);
  226. unset($two['filename']);
  227. $res = Db::name('zczygz_content')->insertGetId($two);
  228. if($res > 0){
  229. //插入ey_web_ur
  230. $data = [
  231. 'to_tid' => $typeid,
  232. 'to_aid' => $new_aid,
  233. 'to_url' => $url.$new_aid,
  234. ];
  235. //var_dump($data);
  236. $res_c = Db::name('web_ur')
  237. ->where('id','=',$row['id'])->update($data);
  238. //var_dump($res_c);die;
  239. if($res_c === 0){
  240. //必须更新成功
  241. Db::rollback();
  242. $run = 1;
  243. }
  244. }else{
  245. //必须更新成功
  246. Db::rollback();
  247. $run = 1;
  248. }
  249. }else{
  250. //
  251. Db::rollback();
  252. $run = 1;
  253. }
  254. }
  255. if($run === 0){
  256. // 提交事务
  257. Db::commit();
  258. }
  259. } catch (\Exception $e) {
  260. // 回滚事务
  261. Db::rollback();
  262. }
  263. echo $row['id'];
  264. if($run === 0){
  265. echo "-ok";
  266. }else{
  267. echo "-fail";
  268. }
  269. echo '<br>';
  270. }
  271. }
  272. /*
  273. * 处理所有城市 有些省份 数据库没了 不管了
  274. * https://www.zc10000.com/api/other/index4
  275. */
  276. public function index4(){
  277. $list = Db::name('citysite')
  278. ->where(['level'=>1])
  279. ->order('id asc')
  280. ->select();
  281. //var_dump($list);
  282. foreach ($list as $index => $item){
  283. echo 'https://www.zc10000.com/api/other/index6?aid='.$item['id'].'<br/>';
  284. /*$one = Db::name('seo_number')->where([
  285. "type" => 3,
  286. "aid" => $item['id'],
  287. 'is_del' => 0,
  288. ])->find();
  289. if(!empty($one)) {
  290. if((int)$one['is_del'] === 0){
  291. $desc = '正常';
  292. }else{
  293. $desc = '原记录已删除';
  294. }
  295. echo $item['name'].'-已存在-'.$desc.'-序号为:'.$one['number'].'<br/>';
  296. }else{
  297. $data = [
  298. 'type' => 3,
  299. 'tid' => 0,
  300. 'aid' => $item['id'],
  301. 'number' => $index + 1,
  302. 'is_del' => 0,
  303. 'area_id' => 0,
  304. 'topid' => 0,
  305. 'parentid' => 0
  306. ];
  307. $res = Db::name('seo_number')->insert($data);
  308. echo $item['name'].'-新增成功'.$res.'<br/>';
  309. }*/
  310. }
  311. }
  312. /*
  313. * 处理产品大类 其实就是栏目 二级
  314. * 后台禁用掉 编辑时 重选区域 这样 会造成 排序混乱 对应的序列号不对
  315. * https://www.zc10000.com/api/other/index5
  316. * https://www.zc10000.com/id2
  317. */
  318. public function index5(){
  319. $list = Db::name('arctype')
  320. //'is_del'=>0
  321. ->where([
  322. 'topid'=>38,'parent_id'=>38,
  323. ])
  324. ->order('area_id asc,add_time asc') //按新增时间排序 按id asc 不准确
  325. ->select();
  326. //var_dump($list);
  327. $temp_id = 0;
  328. foreach ($list as $index => $item){
  329. //计算
  330. if($temp_id !== (int)$item['area_id']){
  331. $temp_id = (int)$item['area_id'];
  332. $num = 1; //重置为1
  333. echo "<hr/>";
  334. }
  335. /*echo '区域id:'.$item['area_id'].'-'.$item['typename'].'-序号:'.$num.'<br/>';
  336. $num++;*/
  337. echo '区域id:'.$item['area_id'].'-';
  338. $one = Db::name('seo_number')->where([
  339. "type" => 1, //产品类型
  340. "aid" => $item['id'], //实际的ID
  341. "tid" => $item['parent_id'], //属于哪个栏目的
  342. //'is_del' => 0,
  343. 'area_id' => $item['area_id'],
  344. 'topid' => $item['topid'],
  345. 'parentid' => $item['parent_id']
  346. ])->find();
  347. if(!empty($one)) {
  348. if((int)$one['number'] === $num){
  349. $desc = '-序列号正常';
  350. }else{
  351. $desc = '-<font style="color:red;">序列号不正常</font>';
  352. }
  353. if($item['is_del'] === 1){
  354. echo '<font style="color:blue;">序号:'.$num.'-'.$item['typename'].'-已存在序列表-原记录已删除-'.$desc.'</font><br/>';
  355. }else{
  356. echo '序号:'.$num.'-'.$item['typename'].'-已存在序列表-原记录正常'.$desc.'<br/>';
  357. }
  358. //不管是更新还是新增 存在记录就加1
  359. $num++;
  360. }else{
  361. //判断是否已删除,已删除不加入
  362. if((int)$item['is_del'] === 0){
  363. $data = [
  364. "type" => 1, //产品类型
  365. "aid" => $item['id'], //实际的ID
  366. "tid" => $item['parent_id'], //属于哪个栏目的
  367. 'is_del' => 0,
  368. 'area_id' => $item['area_id'],
  369. 'topid' => $item['topid'],
  370. 'parentid' => $item['parent_id'],
  371. 'number' => $num
  372. ];
  373. $res = Db::name('seo_number')->insert($data);
  374. echo '序号:'.$num.'-'.$item['typename'].'-不存在序列表且原记录正常,新增成功'.$res.'<br/>';
  375. //不管是更新还是新增 增加记录就加1
  376. $num++;
  377. }else{
  378. echo '<font style="color:green;">'.$item['typename'].'-不存在序列表且原记录已删除,不新增</font><br/>';
  379. }
  380. }
  381. }
  382. }
  383. /*
  384. * 处理产品三类id
  385. * 后台没有移动功能(以后也不能移动) 还好 只能在三级下面 进行 增加删除 不影响排序
  386. * 不过缺少 add_time 字段写入 需要修改原先的curd
  387. * https://www.zc10000.com/id2/sid1
  388. *
  389. * https://www.zc10000.com/api/other/index6?aid=1
  390. https://www.zc10000.com/api/other/index6?aid=30
  391. https://www.zc10000.com/api/other/index6?aid=4003
  392. https://www.zc10000.com/api/other/index6?aid=4004
  393. https://www.zc10000.com/api/other/index6?aid=4023
  394. https://www.zc10000.com/api/other/index6?aid=4042
  395. https://www.zc10000.com/api/other/index6?aid=4228
  396. https://www.zc10000.com/api/other/index6?aid=4359
  397. https://www.zc10000.com/api/other/index6?aid=4474
  398. https://www.zc10000.com/api/other/index6?aid=4589
  399. https://www.zc10000.com/api/other/index6?aid=4667
  400. https://www.zc10000.com/api/other/index6?aid=4813
  401. https://www.zc10000.com/api/other/index6?aid=4833
  402. https://www.zc10000.com/api/other/index6?aid=5056
  403. https://www.zc10000.com/api/other/index6?aid=5179
  404. https://www.zc10000.com/api/other/index6?aid=5290
  405. https://www.zc10000.com/api/other/index6?aid=5448
  406. https://www.zc10000.com/api/other/index6?aid=5625
  407. https://www.zc10000.com/api/other/index6?aid=5742
  408. https://www.zc10000.com/api/other/index6?aid=5879
  409. https://www.zc10000.com/api/other/index6?aid=6003
  410. https://www.zc10000.com/api/other/index6?aid=6303
  411. https://www.zc10000.com/api/other/index6?aid=6344
  412. https://www.zc10000.com/api/other/index6?aid=6547
  413. https://www.zc10000.com/api/other/index6?aid=6645
  414. https://www.zc10000.com/api/other/index6?aid=6791
  415. https://www.zc10000.com/api/other/index6?aid=6872
  416. https://www.zc10000.com/api/other/index6?aid=6990
  417. https://www.zc10000.com/api/other/index6?aid=7092
  418. https://www.zc10000.com/api/other/index6?aid=7144
  419. https://www.zc10000.com/api/other/index6?aid=7171
  420. */
  421. /*
  422. * 级别 不参与序列号 那是等级
  423. */
  424. public function index6(){
  425. $area_id = request()->get('aid',1);
  426. //按区域调用
  427. $catList = Db::name('arctype')
  428. //'is_del'=>0
  429. ->where([
  430. 'topid'=>38,'parent_id'=>38,'area_id'=> $area_id
  431. ])
  432. ->order('area_id asc,add_time asc') //按新增时间排序 按id asc 不准确
  433. ->select();
  434. //循环二级大类
  435. foreach ($catList as $key => $row) {
  436. //查询三级小类
  437. $list = Db::name('arctype_cat')->where([
  438. "parent_id" => $row['id'],
  439. "topid" => 38,
  440. //"is_del" => 0
  441. ])->select();
  442. //var_dump($list);
  443. $num = 1; //重置为1
  444. echo "<hr/>";
  445. foreach ($list as $index => $item){
  446. /*if((int)$item['is_del'] === 1){
  447. $desc = '<font style="color:red;">原文档记录已删除</font>';
  448. }else{
  449. $desc = '原文档记录正常';
  450. }
  451. echo '区域id:'.$row['area_id'].'-上级ID:'.$item['parent_id'].'-名称:'.$item['typename'].'-序号:'.$num.'-'.$desc.'<br/>';
  452. $num++;*/
  453. echo '区域id:'.$row['area_id'].'-';
  454. $one = Db::name('seo_number')->where([
  455. "type" => 1, //产品类型
  456. "aid" => $item['id'], //实际的ID
  457. "tid" => $item['parent_id'], //属于哪个栏目的
  458. //'is_del' => 0,
  459. //'area_id' => $row['area_id'], //没有这个条件
  460. 'topid' => $item['topid'],
  461. 'parentid' => $item['parent_id']
  462. ])->find();
  463. if(!empty($one)) {
  464. if((int)$one['number'] === $num){
  465. $desc = '-序列号正常';
  466. }else{
  467. $desc = '-<font style="color:red;">序列号不正常</font>';
  468. }
  469. if($item['is_del'] === 1){
  470. echo '<font style="color:blue;">序号:'.$num.'-'.'-上级ID:'.$item['parent_id'].'-名称:'.$item['typename'].'-已存在序列表-原记录已删除-'.$desc.'</font><br/>';
  471. }else{
  472. echo '序号:'.$num.'-'.'-上级ID:'.$item['parent_id'].'-名称:'.$item['typename'].'-已存在序列表-原记录正常'.$desc.'<br/>';
  473. }
  474. //不管是更新还是新增 存在记录就加1
  475. $num++;
  476. }else{
  477. //判断是否已删除,已删除不加入
  478. if((int)$item['is_del'] === 0){
  479. $data = [
  480. "type" => 1, //产品类型
  481. "aid" => $item['id'], //实际的ID
  482. "tid" => $item['parent_id'], //属于哪个栏目的 非38
  483. 'is_del' => 0,
  484. //'area_id' => $item['area_id'],
  485. 'topid' => $item['topid'], //还是38
  486. 'parentid' => $item['parent_id'],
  487. 'number' => $num
  488. ];
  489. $res = Db::name('seo_number')->insert($data);
  490. echo '序号:'.$num.'-'.'-上级ID:'.$item['parent_id'].'-名称:'.$item['typename'].'-不存在序列表且原记录正常,新增成功'.$res.'<br/>';
  491. //不管是更新还是新增 增加记录就加1
  492. $num++;
  493. }else{
  494. echo '<font style="color:green;">'.$item['typename'].'-不存在序列表且原记录已删除,不新增</font><br/>';
  495. }
  496. }
  497. }
  498. }
  499. }
  500. /*
  501. * 处理期刊 或者 是以后的其他文章栏目 都可以
  502. * 主要前提是 没有区域 只按发布时间排序就可以
  503. * https://www.zc10000.com/api/other/index7
  504. */
  505. public function index7(){
  506. //查询所有期刊
  507. $list = Db::name('archives')
  508. ->where('typeid','in',[116,123])
  509. ->order('add_time asc')
  510. ->select();
  511. //var_dump($list);
  512. $num = 1;
  513. foreach ($list as $index => $item){
  514. $one = Db::name('seo_number')->where([
  515. "type" => 4,
  516. "aid" => $item['aid'], //实际的文档aid
  517. //'is_del' => 0, //目前都是未删除
  518. ])->find();
  519. if(!empty($one)) {
  520. if((int)$one['number'] === $num){
  521. $ks = '序号正常';
  522. }else{
  523. $ks = '<font style="color:red;">序号不正常</font>';
  524. }
  525. if((int)$item['is_del'] === 0){
  526. $desc = '(原记录正常)';
  527. }else{
  528. $desc = '<font style="color:green;">(原记录已删除)</font>';
  529. }
  530. echo '文档ID:'.$item['aid'].'-'.$item['title'].'-已存在-'.$desc.'-序号为:'.$one['number'].'-'.$ks.'<br/>';
  531. $num++;
  532. }else{
  533. if((int)$item['is_del'] === 0){
  534. $data = [
  535. 'type' => 4,
  536. 'tid' => $item['typeid'],
  537. 'aid' => $item['aid'],
  538. 'number' => $num,
  539. 'is_del' => 0,
  540. //'area_id' => 0, //非栏目
  541. //'topid' => 0, //非栏目
  542. //'parentid' => 0 //非栏目
  543. ];
  544. $res = Db::name('seo_number')->insert($data);
  545. echo $item['title'].'-新增成功'.$res.'-序号为:'.$num.'<br/>';
  546. $num++;
  547. }else {
  548. echo '<font color="blue">文档ID:'.$item['aid'].'-'.$item['title'].'-原记录已删除-不新增-且不存在序号记录表</font><br/>';
  549. }
  550. }
  551. }
  552. }
  553. /*
  554. * 论文参考
  555. * https://www.zc10000.com/api/other/index8
  556. * 主要前提是 没有区域 只按发布时间排序就可以
  557. */
  558. public function index8(){
  559. //查询所有期刊 参考
  560. $list = Db::name('archives')
  561. ->where('typeid','in',[127,128])
  562. ->order('add_time asc')
  563. ->select();
  564. //var_dump($list);
  565. $num = 1;
  566. foreach ($list as $index => $item){
  567. $one = Db::name('seo_number')->where([
  568. "type" => 4,
  569. "aid" => $item['aid'], //实际的文档aid
  570. //'is_del' => 0, //目前都是未删除
  571. ])->find();
  572. if(!empty($one)) {
  573. if((int)$one['number'] === $num){
  574. $ks = '序号正常';
  575. }else{
  576. $ks = '<font style="color:red;">序号不正常</font>';
  577. }
  578. if((int)$item['is_del'] === 0){
  579. $desc = '(原记录正常)';
  580. }else{
  581. $desc = '<font style="color:green;">(原记录已删除)</font>';
  582. }
  583. echo '文档ID:'.$item['aid'].'-'.$item['title'].'-已存在-'.$desc.'-序号为:'.$one['number'].'-'.$ks.'<br/>';
  584. $num++;
  585. }else{
  586. if((int)$item['is_del'] === 0){
  587. $data = [
  588. 'type' => 4,
  589. 'tid' => $item['typeid'],
  590. 'aid' => $item['aid'],
  591. 'number' => $num,
  592. 'is_del' => 0,
  593. //'area_id' => 0, //非栏目
  594. //'topid' => 0, //非栏目
  595. //'parentid' => 0 //非栏目
  596. ];
  597. $res = Db::name('seo_number')->insert($data);
  598. echo $item['title'].'-新增成功'.$res.'-序号为:'.$num.'<br/>';
  599. $num++;
  600. }else {
  601. echo '<font color="blue">文档ID:'.$item['aid'].'-'.$item['title'].'-原记录已删除-不新增-且不存在序号记录表</font><br/>';
  602. }
  603. }
  604. }
  605. }
  606. /*
  607. * 处理文档 注意有省级区分
  608. * 发布时候可以不选 区域
  609. * 但是编辑时,不能重选区域,会造成序号混乱
  610. * https://www.zc10000.com/api/other/index9?tid=126 政策指引
  611. * https://www.zc10000.com/api/other/index9?tid=825 政策文件
  612. * https://www.zc10000.com/api/other/index9?tid=826 参考文件
  613. */
  614. public function index9(){
  615. $tid = request()->get('tid',0);
  616. if((int)$tid === 0){
  617. echo "不存在文档栏目id";
  618. return false;
  619. }
  620. //查询所有指定 栏目id 的文档
  621. $list = Db::name('archives')
  622. ->where('typeid','=',$tid)
  623. ->order('province_id asc,add_time asc') //按照省份进行排序
  624. ->select();
  625. //var_dump($list);
  626. $temp_id = 0;
  627. foreach ($list as $index => $item){
  628. if((int)$item['province_id'] > 0) {
  629. if ($temp_id !== (int)$item['province_id']) {
  630. $temp_id = (int)$item['province_id'];
  631. $num = 1; //重置为1
  632. echo "<hr/>";
  633. }
  634. }else{
  635. //只输出一次
  636. if($index === 0){
  637. $num = 1; //重置为1
  638. echo "<hr/>";
  639. }
  640. }
  641. echo '区域ID:'.$item['province_id'].'-';
  642. $one = Db::name('seo_number')->where([
  643. "type" => 5,
  644. "aid" => $item['aid'], //实际的文档aid
  645. //'is_del' => 0, //目前都是未删除
  646. ])->find();
  647. if(!empty($one)) {
  648. if((int)$one['number'] === $num){
  649. $ks = '序号正常';
  650. }else{
  651. $ks = '<font style="color:red;">序号不正常</font>';
  652. }
  653. if((int)$item['is_del'] === 0){
  654. $desc = '(原记录正常)';
  655. }else{
  656. $desc = '<font style="color:green;">(原记录已删除)</font>';
  657. }
  658. echo '文档ID:'.$item['aid'].'-'.$item['title'].'-已存在-'.$desc.'-序号为:'.$one['number'].'-'.$ks.'<br/>';
  659. $num++;
  660. }else{
  661. if((int)$item['is_del'] === 0){
  662. $data = [
  663. 'type' => 5,
  664. 'tid' => $item['typeid'], //写入栏目id
  665. 'aid' => $item['aid'],
  666. 'number' => $num,
  667. 'is_del' => 0,
  668. 'area_id' => (int)$item['province_id'], //按区域
  669. //'topid' => 0, //非栏目
  670. //'parentid' => 0 //非栏目
  671. ];
  672. $res = Db::name('seo_number')->insert($data); //假设都会成功
  673. echo $item['title'].'-新增成功'.$res.'-序号为:'.$num.'<br/>';
  674. $num++;
  675. }else {
  676. echo '<font color="blue">文档ID:'.$item['aid'].'-'.$item['title'].'-原记录已删除-不新增-且不存在序号记录表</font><br/>';
  677. }
  678. }
  679. }
  680. }
  681. /*
  682. * 处理文章 复制期刊 修改type 大体一致 比如案例 常见问题
  683. * 如果有区域性的文章 又得特殊处理 比如评审攻略 -- 目前先忽略这些
  684. * 后续再说
  685. * https://www.zc10000.com/api/other/index10?tid=120 案例
  686. * https://www.zc10000.com/api/other/index10?tid=118 申报
  687. * https://www.zc10000.com/api/other/index10?tid=122 职称相关问题
  688. * https://www.zc10000.com/api/other/index10?tid=111 常见问题汇总 -- 已改为有区域
  689. * https://www.zc10000.com/api/other/index10?tid=133 历年真题题库
  690. * https://www.zc10000.com/api/other/index10?tid=132 答辩问题汇总
  691. * https://www.zc10000.com/api/other/index10?tid=131 防骗指南
  692. * https://www.zc10000.com/api/other/index10?tid=306 职称补贴
  693. * https://www.zc10000.com/api/other/index10?tid=1231 新增 新闻资讯
  694. * https://www.zc10000.com/api/other/index10?tid=1233 新增 业绩材料
  695. * https://www.zc10000.com/api/other/index10?tid=1234 新增 一键测评
  696. */
  697. public function index10(){
  698. $tid = request()->get('tid',0);
  699. if((int)$tid === 0){
  700. echo "不存在文档栏目id";
  701. exit;
  702. }
  703. $tids = ["120","118","122","111","133","132","131","306","1231","1233","1234"];
  704. if(!in_array($tid,$tids)){
  705. echo "不存在允许栏目内";
  706. exit;
  707. }
  708. //查询所有文档 包含已删除的
  709. $list = Db::name('archives')
  710. ->where('typeid','in',[$tid])
  711. ->order('add_time asc')
  712. ->select();
  713. //var_dump($list);
  714. $num = 1;
  715. foreach ($list as $index => $item){
  716. $one = Db::name('seo_number')->where([
  717. "type" => 2,
  718. "aid" => $item['aid'], //实际的文档aid
  719. //'is_del' => 0, //目前都是未删除
  720. ])->find();
  721. if(!empty($one)) {
  722. if((int)$one['number'] === $num){
  723. $ks = '序号正常';
  724. }else{
  725. $ks = '<font style="color:red;">序号不正常</font>';
  726. }
  727. if((int)$item['is_del'] === 0){
  728. $desc = '(原记录正常)';
  729. }else{
  730. $desc = '<font style="color:green;">(原记录已删除)</font>';
  731. }
  732. echo '文档ID:'.$item['aid'].'-'.$item['title'].'-已存在-'.$desc.'-序号为:'.$one['number'].'-'.$ks.'<br/>';
  733. $num++;
  734. }else{
  735. if((int)$item['is_del'] === 0){
  736. $data = [
  737. 'type' => 2,
  738. 'tid' => $item['typeid'], //文档本身的tid
  739. 'aid' => $item['aid'],
  740. 'number' => $num, //根据add_time 顺序
  741. 'is_del' => 0,
  742. //'area_id' => 0, //非栏目
  743. //'topid' => 0, //非栏目
  744. //'parentid' => 0 //非栏目
  745. ];
  746. $res = Db::name('seo_number')->insert($data);
  747. echo $item['title'].'-新增成功'.$res.'-序号为:'.$num.'<br/>';
  748. $num++;
  749. }else {
  750. echo '<font color="blue">文档ID:'.$item['aid'].'-'.$item['title'].'-原记录已删除-不新增-且不存在序号记录表</font><br/>';
  751. }
  752. }
  753. }
  754. }
  755. /*
  756. * area_tag_id
  757. * https://www.zc10000.com/api/other/index10_1?tid=1232 //评审政策
  758. */
  759. public function index10_1(){
  760. $tid = request()->get('tid',0);
  761. if((int)$tid === 0){
  762. echo "不存在文档栏目id";
  763. exit;
  764. }
  765. $tids = ["1232"];
  766. if(!in_array($tid,$tids)){
  767. echo "不存在允许栏目内";
  768. exit;
  769. }
  770. //查询所有指定 栏目id 的文档
  771. $list = Db::name('archives')
  772. ->where('typeid','=',$tid)
  773. //->where('area_tag_id','>',0)
  774. ->order('area_tag_id asc,add_time asc') //按照省份进行排序
  775. ->select();
  776. //var_dump($list);
  777. $temp_id = 0;
  778. $temp_id2 = 0;
  779. foreach ($list as $index => $item){
  780. if((int)$item['area_tag_id'] > 0 && (int)$item['city_id'] === 0) {
  781. //只属于省
  782. if ($temp_id !== (int)$item['area_tag_id']) {
  783. $temp_id = (int)$item['area_tag_id'];
  784. $num = 1; //重置为1
  785. echo "<hr/>";
  786. }
  787. }else if((int)$item['city_id'] > 0){
  788. if ($temp_id2 !== (int)$item['city_id']) {
  789. $temp_id2 = (int)$item['city_id'];
  790. $num = 1; //重置为1
  791. echo "<hr/>";
  792. }
  793. }else{
  794. //只输出一次
  795. if($index === 0){
  796. $num = 1; //重置为1
  797. echo "<hr/>";
  798. }
  799. }
  800. echo '区域省ID:'.$item['area_tag_id'].'-';
  801. if((int)$item['city_id'] > 0){
  802. echo '区域市ID:'.$item['city_id'].'-';
  803. }
  804. //测试排序
  805. //echo '文档ID:'.$item['aid'].'-序号为:'.$num.'<br/>';
  806. //$num++;
  807. $one = Db::name('seo_number')->where([
  808. "type" => 2, //文章
  809. "aid" => $item['aid'], //实际的文档aid 全站唯一的
  810. //'is_del' => 0, //目前都是未删除
  811. ])->find();
  812. if(!empty($one)) {
  813. if((int)$one['number'] === $num){
  814. $ks = '序号正常';
  815. }else{
  816. $ks = '<font style="color:red;">序号不正常</font>-'.$one['number'];
  817. }
  818. if((int)$item['is_del'] === 0){
  819. $desc = '(原记录正常)';
  820. }else{
  821. $desc = '<font style="color:green;">(原记录已删除)</font>';
  822. }
  823. echo '文档ID:'.$item['aid'].'-'.$item['title'].'-已存在-'.$desc.'-序号为:'.$one['number'].'-'.$ks.'<br/>';
  824. $num++;
  825. }else{
  826. if((int)$item['is_del'] === 0){
  827. if((int)$tid === 1232){
  828. //评审政策
  829. $area_id = (int)$item['area_tag_id'];
  830. $city_id = 0;
  831. }else{
  832. $area_id = (int)$item['province_id'];
  833. $city_id = (int)$item['city_id'];
  834. }
  835. $data = [
  836. 'type' => 2,
  837. 'tid' => $item['typeid'], //写入栏目id 攻略或者政策资讯
  838. 'aid' => $item['aid'], //实际文档id
  839. 'number' => $num,
  840. 'is_del' => 0,
  841. 'area_id' => $area_id, //按区域
  842. 'city_id' => $city_id, //按城市
  843. //'topid' => 0, //非栏目
  844. //'parentid' => 0 //非栏目
  845. ];
  846. $res = Db::name('seo_number')->insert($data); //假设都会成功
  847. echo $item['title'].'-新增成功'.$res.'-序号为:'.$num.'<br/>';
  848. $num++;
  849. }else {
  850. echo '<font color="blue">文档ID:'.$item['aid'].'-'.$item['title'].'-原记录已删除-不新增-且不存在序号记录表</font><br/>';
  851. }
  852. }
  853. }
  854. }
  855. /*
  856. * 评审攻略
  857. * https://www.zc10000.com/api/other/index11?tid=117 评审攻略
  858. * https://www.zc10000.com/api/other/index11?tid=115 政策资讯
  859. * https://www.zc10000.com/api/other/index11?tid=111 常见问题解答
  860. *
  861. * 后台编辑 禁用 区域重选
  862. */
  863. public function index11(){
  864. $tid = request()->get('tid',0);
  865. if((int)$tid === 0){
  866. echo "不存在文档栏目id";
  867. exit;
  868. }
  869. $tids = ["117","115","111"];
  870. if(!in_array($tid,$tids)){
  871. echo "不存在允许栏目内";
  872. exit;
  873. }
  874. //查询所有指定 栏目id 的文档
  875. $list = Db::name('archives')
  876. ->where('typeid','=',$tid)
  877. ->order('province_id asc,city_id asc,add_time asc') //按照省份进行排序
  878. ->select();
  879. //var_dump($list);
  880. $temp_id = 0;
  881. $temp_id2 = 0;
  882. foreach ($list as $index => $item){
  883. if((int)$item['province_id'] > 0 && (int)$item['city_id'] === 0) {
  884. //只属于省
  885. if ($temp_id !== (int)$item['province_id']) {
  886. $temp_id = (int)$item['province_id'];
  887. $num = 1; //重置为1
  888. echo "<hr/>";
  889. }
  890. }else if((int)$item['city_id'] > 0){
  891. if ($temp_id2 !== (int)$item['city_id']) {
  892. $temp_id2 = (int)$item['city_id'];
  893. $num = 1; //重置为1
  894. echo "<hr/>";
  895. }
  896. }else{
  897. //只输出一次
  898. if($index === 0){
  899. $num = 1; //重置为1
  900. echo "<hr/>";
  901. }
  902. }
  903. echo '区域省ID:'.$item['province_id'].'-';
  904. if((int)$item['city_id'] > 0){
  905. echo '区域市ID:'.$item['city_id'].'-';
  906. }
  907. //测试排序
  908. //echo '文档ID:'.$item['aid'].'-序号为:'.$num.'<br/>';
  909. //$num++;
  910. $one = Db::name('seo_number')->where([
  911. "type" => 2, //文章
  912. "aid" => $item['aid'], //实际的文档aid 全站唯一的
  913. //'is_del' => 0, //目前都是未删除
  914. ])->find();
  915. if(!empty($one)) {
  916. if((int)$one['number'] === $num){
  917. $ks = '序号正常';
  918. }else{
  919. $ks = '<font style="color:red;">序号不正常</font>-'.$one['number'];
  920. }
  921. if((int)$item['is_del'] === 0){
  922. $desc = '(原记录正常)';
  923. }else{
  924. $desc = '<font style="color:green;">(原记录已删除)</font>';
  925. }
  926. echo '文档ID:'.$item['aid'].'-'.$item['title'].'-已存在-'.$desc.'-序号为:'.$one['number'].'-'.$ks.'<br/>';
  927. $num++;
  928. }else{
  929. if((int)$item['is_del'] === 0){
  930. if((int)$tid === 1232){
  931. //评审政策
  932. $area_id = (int)$item['product_tag_id'];
  933. $city_id = 0;
  934. }else{
  935. $area_id = (int)$item['province_id'];
  936. $city_id = (int)$item['city_id'];
  937. }
  938. $data = [
  939. 'type' => 2,
  940. 'tid' => $item['typeid'], //写入栏目id 攻略或者政策资讯
  941. 'aid' => $item['aid'], //实际文档id
  942. 'number' => $num,
  943. 'is_del' => 0,
  944. 'area_id' => $area_id, //按区域
  945. 'city_id' => $city_id, //按城市
  946. //'topid' => 0, //非栏目
  947. //'parentid' => 0 //非栏目
  948. ];
  949. $res = Db::name('seo_number')->insert($data); //假设都会成功
  950. echo $item['title'].'-新增成功'.$res.'-序号为:'.$num.'<br/>';
  951. $num++;
  952. }else {
  953. echo '<font color="blue">文档ID:'.$item['aid'].'-'.$item['title'].'-原记录已删除-不新增-且不存在序号记录表</font><br/>';
  954. }
  955. }
  956. }
  957. }
  958. /*
  959. * 批量修改图片地址
  960. * https://www.zc10000.com/api/other/index89
  961. */
  962. public function index89(){
  963. $list = Db::name('ad')->select();
  964. foreach ($list as $index=>$item){
  965. if(!empty($item['litpic'])){
  966. if (strpos($item['litpic'], 'zc10000.com') !== false) {
  967. //包含
  968. } else {
  969. if (strpos($item['litpic'], '/uploads/') !== false) {
  970. //包含
  971. $item['litpic'] = 'https://oss.zc10000.com'.$item['litpic'];
  972. $res = Db::name('ad')->update($item);
  973. echo $res.'<br/>';
  974. }else{
  975. }
  976. }
  977. }
  978. }
  979. }
  980. public function index90(){
  981. $list = Db::name('archives')->select();
  982. foreach ($list as $index=>$item){
  983. if(!empty($item['litpic'])){
  984. if (strpos($item['litpic'], 'zc10000.com') !== false) {
  985. //包含
  986. } else {
  987. if (strpos($item['litpic'], '/uploads/') !== false) {
  988. //包含
  989. $item['litpic'] = 'https://oss.zc10000.com'.$item['litpic'];
  990. $res = Db::name('archives')->update($item);
  991. echo $res.'<br/>';
  992. }else{
  993. }
  994. }
  995. }
  996. }
  997. }
  998. public function index91(){
  999. $list = Db::name('arctype')->select();
  1000. foreach ($list as $index=>$item){
  1001. if(!empty($item['litpic'])){
  1002. if (strpos($item['litpic'], 'zc10000.com') !== false) {
  1003. //包含
  1004. } else {
  1005. if (strpos($item['litpic'], '/uploads/') !== false) {
  1006. //包含
  1007. $item['litpic'] = 'https://oss.zc10000.com'.$item['litpic'];
  1008. $res = Db::name('arctype')->update($item);
  1009. echo $res.'<br/>';
  1010. }else{
  1011. }
  1012. }
  1013. }
  1014. }
  1015. }
  1016. public function index92(){
  1017. $list = Db::name('links')->select();
  1018. foreach ($list as $index=>$item){
  1019. if(!empty($item['logo'])){
  1020. if (strpos($item['logo'], 'zc10000.com') !== false) {
  1021. //包含
  1022. } else {
  1023. if (strpos($item['logo'], '/uploads/') !== false) {
  1024. //包含
  1025. $item['logo'] = 'https://oss.zc10000.com'.$item['logo'];
  1026. $res = Db::name('links')->update($item);
  1027. echo $res.'<br/>';
  1028. }else{
  1029. }
  1030. }
  1031. }
  1032. }
  1033. }
  1034. public function index93(){
  1035. $list = Db::name('nav_list')->select();
  1036. foreach ($list as $index=>$item){
  1037. if(!empty($item['nav_pic'])){
  1038. if (strpos($item['nav_pic'], 'zc10000.com') !== false) {
  1039. //包含
  1040. } else {
  1041. if (strpos($item['nav_pic'], '/uploads/') !== false) {
  1042. //包含
  1043. $item['nav_pic'] = 'https://oss.zc10000.com'.$item['nav_pic'];
  1044. $res = Db::name('nav_list')->update($item);
  1045. echo $res.'<br/>';
  1046. }else{
  1047. }
  1048. }
  1049. }
  1050. }
  1051. }
  1052. public function index94(){
  1053. $list = Db::name('uploads')->select();
  1054. foreach ($list as $index=>$item){
  1055. if(!empty($item['image_url'])){
  1056. if (strpos($item['image_url'], 'zc10000.com') !== false) {
  1057. //包含
  1058. } else {
  1059. if (strpos($item['image_url'], '/uploads/') !== false) {
  1060. //包含
  1061. $item['image_url'] = 'https://oss.zc10000.com'.$item['image_url'];
  1062. $res = Db::name('uploads')->update($item);
  1063. echo $res.'<br/>';
  1064. }else{
  1065. }
  1066. }
  1067. }
  1068. }
  1069. }
  1070. public function index95(){
  1071. $list = Db::name('zczygz_content')->select();
  1072. foreach ($list as $index=>$item){
  1073. if(!empty($item['content_5'])){
  1074. ////oss.zc10000.com/uploads/allimg/20240308/1-24030Q95602A4.jpg
  1075. $newStr = str_replace("/uploads/", '//oss.zc10000.com/uploads/', $item['content_5']);
  1076. $newStr = str_replace("//oss.zc10000.com//oss.zc10000.com/uploads/", '//oss.zc10000.com/uploads/', $newStr);
  1077. $item['content_5'] = $newStr;
  1078. $res = Db::name('zczygz_content')->update($item);
  1079. echo $res.'<br/>';
  1080. }
  1081. }
  1082. }
  1083. public function index96(){
  1084. $list = Db::name('zczygz_content')->select();
  1085. foreach ($list as $index=>$item){
  1086. if(!empty($item['down'])){
  1087. if (strpos($item['down'], 'zc10000.com') !== false) {
  1088. //包含
  1089. } else {
  1090. if (strpos($item['down'], '/uploads/') !== false) {
  1091. //包含
  1092. $item['down'] = 'https://oss.zc10000.com'.$item['down'];
  1093. $res = Db::name('zczygz_content')->update($item);
  1094. echo $res.'<br/>';
  1095. }else{
  1096. }
  1097. }
  1098. }
  1099. }
  1100. }
  1101. /*
  1102. * 生成百度地图
  1103. * https://www.zc10000.com/api/other/index100?type=xml
  1104. *
  1105. */
  1106. public function index100(){
  1107. /* if (extension_loaded('xml')) {
  1108. echo "xml extension is loaded";
  1109. } else {
  1110. echo "xml extension is not loaded";
  1111. }*/
  1112. /*// 创建XML根节点
  1113. $xml = new SimpleXMLElement('<?xml version="1.0"?><root></root>');
  1114. // 添加子节点
  1115. $item = $xml->addChild('item');
  1116. $item->addChild('id', 1);
  1117. $item->addChild('name', 'Item Name');
  1118. $item->addChild('price', '$99.99');
  1119. // 保存XML到文件或输出
  1120. $xml->asXML();
  1121. // 输出到浏览器
  1122. header('Content-Type: text/xml');
  1123. echo $xml->asXML();
  1124. // 保存到文件
  1125. $xml->asXML('output.xml');*/
  1126. //ini_set('memory_limit', '1024M'); //无用
  1127. /*
  1128. * 可对比系统的xml生成
  1129. */
  1130. $type = request()->get('type','xml');
  1131. switch ($type) {
  1132. case 'xml':
  1133. header('Content-type: text/xml');
  1134. $xmlWriter = new \XMLWriter();
  1135. $xmlWriter->openMemory();
  1136. $xmlWriter->startDocument('1.0', 'UTF-8');
  1137. $xmlWriter->startElement('urlset');
  1138. $xmlWriter->writeAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
  1139. $xmlWriter->writeAttribute('xmlns:mobile', 'http://www.google.com/schemas/sitemap-mobile/1.0');
  1140. break;
  1141. case 'txt':
  1142. $txt = '';
  1143. break;
  1144. case 'html':
  1145. $html = '
  1146. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  1147. <html xmlns="http://www.w3.org/1999/xhtml">
  1148. <head>
  1149. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  1150. <title>职称网_网站地图</title>
  1151. </head>
  1152. <style>
  1153. * {
  1154. margin: 0px;
  1155. padding: 0px;
  1156. }
  1157. a {
  1158. color: grey;
  1159. text-decoration: none;
  1160. }
  1161. h1 a {
  1162. color: Black;
  1163. }
  1164. h1 {
  1165. font-size: 15px;
  1166. display: block;
  1167. width: 1200px;
  1168. margin: 0 auto;
  1169. border: 1px solid #eee;
  1170. padding: 10px;
  1171. color: Black;
  1172. }
  1173. h2 {
  1174. color: Black;
  1175. font-size: 16px;
  1176. margin-bottom: 10px;
  1177. }
  1178. a:hover {
  1179. color: Black;
  1180. text-decoration: underline;
  1181. }
  1182. .content {
  1183. width: 1200px;
  1184. border: 1px solid #eee;
  1185. margin: 0 auto;
  1186. padding: 10px;
  1187. margin-top: 10px;
  1188. color: #999;
  1189. overflow: hidden;
  1190. }
  1191. li {
  1192. text-indent: 20px;
  1193. list-style: disc;
  1194. }
  1195. .content li {
  1196. width: 285px;
  1197. text-indent: 5px;
  1198. float: left;
  1199. list-style: none;
  1200. height: 30px;
  1201. }
  1202. .content li a {
  1203. display: block;
  1204. height: 25px;
  1205. overflow: hidden;
  1206. }
  1207. </style>
  1208. <body>
  1209. <h1>
  1210. <a href="https://www.zc10000.com/">职称网</a>
  1211. </h1>
  1212. <div class="content">
  1213. <h2>分类</h2>
  1214. <ul>';
  1215. break;
  1216. default:
  1217. // 如果没有匹配的值
  1218. }
  1219. /*
  1220. * 方法1 获取主页
  1221. */
  1222. $list = [
  1223. 'https://www.zc10000.com', //省级主页 + 城市主页
  1224. 'https://www.zc10000.com/zczl', //产品分页 + 产品详情
  1225. 'https://www.zc10000.com/zclw',
  1226. 'https://www.zc10000.com/zccl',
  1227. 'https://www.zc10000.com/zlwd',
  1228. 'https://www.zc10000.com/zcwj',
  1229. 'https://www.zc10000.com/zcdb',
  1230. 'https://www.zc10000.com/zhengce',
  1231. 'https://www.zc10000.com/gonglve',
  1232. 'https://www.zc10000.com/lwck',
  1233. 'https://www.zc10000.com/wthz',
  1234. 'https://www.zc10000.com/anli',
  1235. 'https://www.zc10000.com/zcbt',
  1236. 'https://zczl.zc10000.com',
  1237. ];
  1238. $html_a = ['职称网','职称工种','职称论文','职称材料','通用文件','政策指引','职称答辩','政策资讯','评审攻略','论文参考','常见问题','案例分析','职称补贴','快速评审'];
  1239. $list = $this->unsetHandle($list,0,$type);
  1240. switch ($type) {
  1241. case 'xml':
  1242. foreach ($list as $k=>$value){
  1243. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()));
  1244. }
  1245. break;
  1246. case 'txt':
  1247. foreach ($list as $k=>$value){
  1248. $txt .= $value."\r\n";
  1249. }
  1250. break;
  1251. case 'html':
  1252. foreach ($list as $k=>$value){
  1253. $html .= '<li><a target="_blank" href="'.$value.'">'.$html_a[$k].'</a></li>';
  1254. }
  1255. $html .= "</ul></div>";
  1256. break;
  1257. default:
  1258. // 如果没有匹配的值
  1259. }
  1260. /*
  1261. * 省级主页
  1262. */
  1263. $list_1 = $this->getIndex();
  1264. $list_1 = $this->unsetHandle($list_1,1,$type);
  1265. //$list = array_merge($list,$list_1);
  1266. switch ($type) {
  1267. case 'xml':
  1268. foreach ($list_1 as $k=>$value){
  1269. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()));
  1270. }
  1271. break;
  1272. case 'txt':
  1273. foreach ($list_1 as $k=>$value){
  1274. $txt .= $value."\r\n";
  1275. }
  1276. break;
  1277. case 'html':
  1278. $html .= '<div class="content"><h2>省级站点</h2><ul>';
  1279. //dump($list_1);die;
  1280. foreach ($list_1 as $k=>$value){
  1281. $value1 = explode('.',$value);
  1282. $value2 = explode('//',$value1[0]);
  1283. $name = Db::name('citysite')->where('domain','=',$value2[1])->value('name');
  1284. if(empty($name)){
  1285. if($value == 'https://www.zc10000.com/shandong'){
  1286. $name = '山东';
  1287. $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'站</a></li>';
  1288. }
  1289. }else{
  1290. $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'站</a></li>';
  1291. }
  1292. }
  1293. $html .= '</ul></div>';
  1294. break;
  1295. default:
  1296. // 如果没有匹配的值
  1297. }
  1298. /*
  1299. * 城市主页
  1300. */
  1301. $list_2 = $this->getIndex2();
  1302. //$list = array_merge($list,$list_2);
  1303. $list_2 = $this->unsetHandle($list_2,2,$type);
  1304. switch ($type) {
  1305. case 'xml':
  1306. foreach ($list_2 as $k=>$value){
  1307. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()));
  1308. }
  1309. break;
  1310. case 'txt':
  1311. foreach ($list_2 as $k=>$value){
  1312. $txt .= $value."\r\n";
  1313. }
  1314. break;
  1315. case 'html':
  1316. break;
  1317. default:
  1318. // 如果没有匹配的值
  1319. }
  1320. /*
  1321. * 产品 无区域 主页 已有
  1322. * 产品 无区域 分页
  1323. */
  1324. $list_3 = $this->getIndex3(); //产品分页
  1325. //$list = array_merge($list,$list_3);
  1326. $list_3 = $this->unsetHandle($list_3,3,$type);
  1327. switch ($type) {
  1328. case 'xml':
  1329. foreach ($list_3 as $k=>$value){
  1330. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1331. }
  1332. break;
  1333. case 'txt':
  1334. foreach ($list_3 as $k=>$value){
  1335. $txt .= $value."\r\n";
  1336. }
  1337. break;
  1338. case 'html':
  1339. break;
  1340. default:
  1341. // 如果没有匹配的值
  1342. }
  1343. /*
  1344. * 产品按省级 主页
  1345. */
  1346. $list_4 = $this->getIndex4(); //产品分页
  1347. //$list = array_merge($list,$list_4);
  1348. $list_4 = $this->unsetHandle($list_4,4,$type);
  1349. switch ($type) {
  1350. case 'xml':
  1351. foreach ($list_4 as $k=>$value){
  1352. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1353. }
  1354. break;
  1355. case 'txt':
  1356. foreach ($list_4 as $k=>$value){
  1357. $txt .= $value."\r\n";
  1358. }
  1359. break;
  1360. case 'html':
  1361. $html .= '<div class="content"><h2>职称工种</h2><ul>';
  1362. foreach ($list_4 as $k=>$value){
  1363. $value1 = explode('zczl/jzzc',$value);
  1364. $aid = Db::name('seo_number')->where('number','=',$value1[1])
  1365. ->where('type','=',3)
  1366. ->value('aid');
  1367. $name = Db::name('citysite')->where('id','=',$aid)->value('name');
  1368. if(empty($name)){
  1369. $name = '山东';
  1370. }
  1371. $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'地区</a></li>';
  1372. }
  1373. $html .= '</ul></div>';
  1374. break;
  1375. default:
  1376. // 如果没有匹配的值
  1377. }
  1378. /*
  1379. * 产品按省级 分页
  1380. */
  1381. $list_5 = $this->getIndex5(); //产品分页
  1382. $list_5 = $this->unsetHandle($list_5,5,$type);
  1383. //$list = array_merge($list,$list_5);
  1384. switch ($type) {
  1385. case 'xml':
  1386. foreach ($list_5 as $k=>$value){
  1387. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1388. }
  1389. break;
  1390. case 'txt':
  1391. foreach ($list_5 as $k=>$value){
  1392. $txt .= $value."\r\n";
  1393. }
  1394. break;
  1395. case 'html':
  1396. break;
  1397. default:
  1398. // 如果没有匹配的值
  1399. }
  1400. /*
  1401. * 产品url
  1402. * 按照 /id /idh /id/sid /id/sidh
  1403. */
  1404. $list_6 = $this->getIndex6(); //产品分页
  1405. $list_6 = $this->unsetHandle($list_6,6,$type);
  1406. //$list = array_merge($list,$list_6);
  1407. switch ($type) {
  1408. case 'xml':
  1409. foreach ($list_6 as $k=>$value){
  1410. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  1411. }
  1412. break;
  1413. case 'txt':
  1414. foreach ($list_6 as $k=>$value){
  1415. $txt .= $value."\r\n";
  1416. }
  1417. break;
  1418. case 'html':
  1419. break;
  1420. default:
  1421. // 如果没有匹配的值
  1422. }
  1423. /*
  1424. * 论文主页 已有
  1425. * 论文列表 - 分页
  1426. */
  1427. $list_7 = $this->getIndex7();
  1428. $list_7 = $this->unsetHandle($list_7,7,$type);
  1429. //$list = array_merge($list,$list_7);
  1430. switch ($type) {
  1431. case 'xml':
  1432. foreach ($list_7 as $k=>$value){
  1433. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1434. }
  1435. break;
  1436. case 'txt':
  1437. foreach ($list_7 as $k=>$value){
  1438. $txt .= $value."\r\n";
  1439. }
  1440. break;
  1441. case 'html':
  1442. break;
  1443. default:
  1444. // 如果没有匹配的值
  1445. }
  1446. /*
  1447. * 论文详情
  1448. */
  1449. $list_8 = $this->getIndex8();
  1450. $list_8 = $this->unsetHandle($list_8,8,$type);
  1451. //$list = array_merge($list,$list_8);
  1452. switch ($type) {
  1453. case 'xml':
  1454. foreach ($list_8 as $k=>$value){
  1455. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  1456. }
  1457. break;
  1458. case 'txt':
  1459. foreach ($list_8 as $k=>$value){
  1460. $txt .= $value."\r\n";
  1461. }
  1462. break;
  1463. case 'html':
  1464. break;
  1465. default:
  1466. // 如果没有匹配的值
  1467. }
  1468. /*
  1469. * 主页在最上面
  1470. * 职称材料 无区域 无标签 分页
  1471. */
  1472. /*
  1473. * 职称材料 栏目1
  1474. */
  1475. $list_9 = $this->getIndex9("zccl",126,20);
  1476. $list_9 = $this->unsetHandle($list_9,9,$type);
  1477. //$list = array_merge($list,$list_9);
  1478. switch ($type) {
  1479. case 'xml':
  1480. foreach ($list_9 as $k=>$value){
  1481. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1482. }
  1483. break;
  1484. case 'txt':
  1485. foreach ($list_9 as $k=>$value){
  1486. $txt .= $value."\r\n";
  1487. }
  1488. break;
  1489. case 'html':
  1490. break;
  1491. default:
  1492. // 如果没有匹配的值
  1493. }
  1494. /*
  1495. * 职称材料 只有区域
  1496. * 包含 区域主页 + 分页
  1497. * 包含 伪区域主页 + 分页
  1498. */
  1499. $list_10 = $this->getIndex10("zccl",126,20);
  1500. $list_10 = $this->unsetHandle($list_10,10,$type);
  1501. //$list = array_merge($list,$list_10);
  1502. switch ($type) {
  1503. case 'xml':
  1504. foreach ($list_10 as $k=>$value){
  1505. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1506. }
  1507. break;
  1508. case 'txt':
  1509. foreach ($list_10 as $k=>$value){
  1510. $txt .= $value."\r\n";
  1511. }
  1512. break;
  1513. case 'html':
  1514. $html .= '<div class="content"><h2>职称材料</h2><ul>';
  1515. //dump($list_10);die;
  1516. foreach ($list_10 as $k=>$value){
  1517. $value = str_replace('---list_is_null)','',$value);
  1518. $pos = strpos($value, '-');
  1519. if ($pos !== false) {
  1520. }else{
  1521. $value1 = explode('.',$value);
  1522. $value2 = explode('//',$value1[0]);
  1523. //echo $value2;
  1524. $name = Db::name('citysite')->where('domain','=',$value2[1])->value('name');
  1525. if(empty($name)){
  1526. $name = '山东';
  1527. }
  1528. $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'地区</a></li>';
  1529. }
  1530. }
  1531. $html .= '</ul></div>';
  1532. break;
  1533. default:
  1534. // 如果没有匹配的值
  1535. }
  1536. /*
  1537. * 职称材料 只有标签
  1538. * 包含 标签主页 + 分页
  1539. */
  1540. $list_11 = $this->getIndex11("zccl",126,20);
  1541. $list_11 = $this->unsetHandle($list_11,11,$type);
  1542. //$list = array_merge($list,$list_11);
  1543. switch ($type) {
  1544. case 'xml':
  1545. foreach ($list_11 as $k=>$value){
  1546. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1547. }
  1548. break;
  1549. case 'txt':
  1550. foreach ($list_11 as $k=>$value){
  1551. $txt .= $value."\r\n";
  1552. }
  1553. break;
  1554. case 'html':
  1555. break;
  1556. default:
  1557. // 如果没有匹配的值
  1558. }
  1559. /*
  1560. * 职称材料 同时有 区域+标签
  1561. * 包含主页 + 分页
  1562. */
  1563. $list_12 = $this->getIndex12("zccl",126,20);
  1564. $list_12 = $this->unsetHandle($list_12,12,$type);
  1565. //$list = array_merge($list,$list_12);
  1566. switch ($type) {
  1567. case 'xml':
  1568. foreach ($list_12 as $k=>$value){
  1569. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1570. }
  1571. break;
  1572. case 'txt':
  1573. foreach ($list_12 as $k=>$value){
  1574. $txt .= $value."\r\n";
  1575. }
  1576. break;
  1577. case 'html':
  1578. break;
  1579. default:
  1580. // 如果没有匹配的值
  1581. }
  1582. /*
  1583. * 职称材料 栏目2
  1584. */
  1585. $list_9_1 = $this->getIndex9("zlwd",126,20);
  1586. $list_9_1 = $this->unsetHandle($list_9_1,13,$type);
  1587. //$list = array_merge($list,$list_9_1);
  1588. switch ($type) {
  1589. case 'xml':
  1590. foreach ($list_9_1 as $k=>$value){
  1591. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1592. }
  1593. break;
  1594. case 'txt':
  1595. foreach ($list_9_1 as $k=>$value){
  1596. $txt .= $value."\r\n";
  1597. }
  1598. break;
  1599. case 'html':
  1600. break;
  1601. default:
  1602. // 如果没有匹配的值
  1603. }
  1604. $list_10_1 = $this->getIndex10("zlwd",126,20);
  1605. $list_10_1 = $this->unsetHandle($list_10_1,14,$type);
  1606. //$list = array_merge($list,$list_10_1);
  1607. switch ($type) {
  1608. case 'xml':
  1609. foreach ($list_10_1 as $k=>$value){
  1610. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1611. }
  1612. break;
  1613. case 'txt':
  1614. foreach ($list_10_1 as $k=>$value){
  1615. $txt .= $value."\r\n";
  1616. }
  1617. break;
  1618. case 'html':
  1619. break;
  1620. default:
  1621. // 如果没有匹配的值
  1622. }
  1623. $list_11_1 = $this->getIndex11("zlwd",126,20);
  1624. $list_11_1 = $this->unsetHandle($list_11_1,15,$type);
  1625. //$list = array_merge($list,$list_11_1);
  1626. switch ($type) {
  1627. case 'xml':
  1628. foreach ($list_11_1 as $k=>$value){
  1629. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1630. }
  1631. break;
  1632. case 'txt':
  1633. foreach ($list_11_1 as $k=>$value){
  1634. $txt .= $value."\r\n";
  1635. }
  1636. break;
  1637. case 'html':
  1638. break;
  1639. default:
  1640. // 如果没有匹配的值
  1641. }
  1642. $list_12_1 = $this->getIndex12("zlwd",126,20);
  1643. $list_12_1 = $this->unsetHandle($list_12_1,16,$type);
  1644. //$list = array_merge($list,$list_12_1);
  1645. switch ($type) {
  1646. case 'xml':
  1647. foreach ($list_12_1 as $k=>$value){
  1648. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1649. }
  1650. break;
  1651. case 'txt':
  1652. foreach ($list_12_1 as $k=>$value){
  1653. $txt .= $value."\r\n";
  1654. }
  1655. break;
  1656. case 'html':
  1657. break;
  1658. default:
  1659. // 如果没有匹配的值
  1660. }
  1661. /*
  1662. * 职称材料 栏目3
  1663. */
  1664. $list_9_2 = $this->getIndex9("zcwj",825,20);
  1665. $list_9_2 = $this->unsetHandle($list_9_2,17,$type);
  1666. //$list = array_merge($list,$list_9_2);
  1667. switch ($type) {
  1668. case 'xml':
  1669. foreach ($list_9_2 as $k=>$value){
  1670. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1671. }
  1672. break;
  1673. case 'txt':
  1674. foreach ($list_9_2 as $k=>$value){
  1675. $txt .= $value."\r\n";
  1676. }
  1677. break;
  1678. case 'html':
  1679. break;
  1680. default:
  1681. // 如果没有匹配的值
  1682. }
  1683. $list_10_2 = $this->getIndex10("zcwj",825,20);
  1684. $list_10_2 = $this->unsetHandle($list_10_2,18,$type);
  1685. //$list = array_merge($list,$list_10_2);
  1686. switch ($type) {
  1687. case 'xml':
  1688. foreach ($list_10_2 as $k=>$value){
  1689. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1690. }
  1691. break;
  1692. case 'txt':
  1693. foreach ($list_10_2 as $k=>$value){
  1694. $txt .= $value."\r\n";
  1695. }
  1696. break;
  1697. case 'html':
  1698. break;
  1699. default:
  1700. // 如果没有匹配的值
  1701. }
  1702. $list_11_2 = $this->getIndex11("zcwj",825,20);
  1703. $list_11_2 = $this->unsetHandle($list_11_2,19,$type);
  1704. //$list = array_merge($list,$list_11_2);
  1705. switch ($type) {
  1706. case 'xml':
  1707. foreach ($list_11_2 as $k=>$value){
  1708. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1709. }
  1710. break;
  1711. case 'txt':
  1712. foreach ($list_11_2 as $k=>$value){
  1713. $txt .= $value."\r\n";
  1714. }
  1715. break;
  1716. case 'html':
  1717. break;
  1718. default:
  1719. // 如果没有匹配的值
  1720. }
  1721. $list_12_2 = $this->getIndex12("zcwj",825,20);
  1722. $list_12_2 = $this->unsetHandle($list_12_2,20,$type);
  1723. //$list = array_merge($list,$list_12_2);
  1724. switch ($type) {
  1725. case 'xml':
  1726. foreach ($list_12_2 as $k=>$value){
  1727. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1728. }
  1729. break;
  1730. case 'txt':
  1731. foreach ($list_12_2 as $k=>$value){
  1732. $txt .= $value."\r\n";
  1733. }
  1734. break;
  1735. case 'html':
  1736. break;
  1737. default:
  1738. // 如果没有匹配的值
  1739. }
  1740. /*
  1741. * 补充伪区域 url 加入标签
  1742. */
  1743. $list_11_3 = $this->getIndex11("shandong_zccl",126,20);
  1744. $list_11_3 = $this->unsetHandle($list_11_3,58,$type);
  1745. //$list = array_merge($list,$list_11);
  1746. switch ($type) {
  1747. case 'xml':
  1748. foreach ($list_11_3 as $k=>$value){
  1749. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1750. }
  1751. break;
  1752. case 'txt':
  1753. foreach ($list_11_3 as $k=>$value){
  1754. $txt .= $value."\r\n";
  1755. }
  1756. break;
  1757. case 'html':
  1758. break;
  1759. default:
  1760. // 如果没有匹配的值
  1761. }
  1762. $list_11_4 = $this->getIndex11("shandong_zlwd",126,20);
  1763. $list_11_4 = $this->unsetHandle($list_11_4,59,$type);
  1764. //$list = array_merge($list,$list_11);
  1765. switch ($type) {
  1766. case 'xml':
  1767. foreach ($list_11_4 as $k=>$value){
  1768. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1769. }
  1770. break;
  1771. case 'txt':
  1772. foreach ($list_11_4 as $k=>$value){
  1773. $txt .= $value."\r\n";
  1774. }
  1775. break;
  1776. case 'html':
  1777. break;
  1778. default:
  1779. // 如果没有匹配的值
  1780. }
  1781. $list_11_5 = $this->getIndex11("shandong_zcwj",825,20);
  1782. $list_11_5 = $this->unsetHandle($list_11_5,60,$type);
  1783. //$list = array_merge($list,$list_11);
  1784. switch ($type) {
  1785. case 'xml':
  1786. foreach ($list_11_5 as $k=>$value){
  1787. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1788. }
  1789. break;
  1790. case 'txt':
  1791. foreach ($list_11_5 as $k=>$value){
  1792. $txt .= $value."\r\n";
  1793. }
  1794. break;
  1795. case 'html':
  1796. break;
  1797. default:
  1798. // 如果没有匹配的值
  1799. }
  1800. /*
  1801. * 职称材料 详情页
  1802. */
  1803. $list_13 = $this->getIndex13('zlwd',126);
  1804. $list_13 = $this->unsetHandle($list_13,21,$type);
  1805. //$list = array_merge($list,$list_13);
  1806. switch ($type) {
  1807. case 'xml':
  1808. foreach ($list_13 as $k=>$value){
  1809. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  1810. }
  1811. break;
  1812. case 'txt':
  1813. foreach ($list_13 as $k=>$value){
  1814. $txt .= $value."\r\n";
  1815. }
  1816. break;
  1817. case 'html':
  1818. break;
  1819. default:
  1820. // 如果没有匹配的值
  1821. }
  1822. $list_13_1 = $this->getIndex13('zcwj',825);
  1823. $list_13_1 = $this->unsetHandle($list_13_1,22,$type);
  1824. //$list = array_merge($list,$list_13_1);
  1825. switch ($type) {
  1826. case 'xml':
  1827. foreach ($list_13_1 as $k=>$value){
  1828. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  1829. }
  1830. break;
  1831. case 'txt':
  1832. foreach ($list_13_1 as $k=>$value){
  1833. $txt .= $value."\r\n";
  1834. }
  1835. break;
  1836. case 'html':
  1837. break;
  1838. default:
  1839. // 如果没有匹配的值
  1840. }
  1841. /*
  1842. * 主页在最上面
  1843. * 职称答辩 - 分页
  1844. */
  1845. $list_14 = $this->getIndex7("zcdb",132,12); //列表页
  1846. $list_14 = $this->unsetHandle($list_14,23,$type);
  1847. //$list = array_merge($list,$list_14);
  1848. switch ($type) {
  1849. case 'xml':
  1850. foreach ($list_14 as $k=>$value){
  1851. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1852. }
  1853. break;
  1854. case 'txt':
  1855. foreach ($list_14 as $k=>$value){
  1856. $txt .= $value."\r\n";
  1857. }
  1858. break;
  1859. case 'html':
  1860. break;
  1861. default:
  1862. // 如果没有匹配的值
  1863. }
  1864. $list_15 = $this->getIndex8("zcdb1",132,2); //职称答辩 - 详情页
  1865. $list_15 = $this->unsetHandle($list_15,24,$type);
  1866. //$list = array_merge($list,$list_15);
  1867. switch ($type) {
  1868. case 'xml':
  1869. foreach ($list_15 as $k=>$value){
  1870. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  1871. }
  1872. break;
  1873. case 'txt':
  1874. foreach ($list_15 as $k=>$value){
  1875. $txt .= $value."\r\n";
  1876. }
  1877. break;
  1878. case 'html':
  1879. break;
  1880. default:
  1881. // 如果没有匹配的值
  1882. }
  1883. /*
  1884. *
  1885. */
  1886. $list_14_1 = $this->getIndex11_1("zcdb",132,12); //列表页
  1887. $list_14_1 = $this->unsetHandle($list_14_1,49,$type);
  1888. switch ($type) {
  1889. case 'xml':
  1890. foreach ($list_14_1 as $k=>$value){
  1891. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1892. }
  1893. break;
  1894. case 'txt':
  1895. foreach ($list_14_1 as $k=>$value){
  1896. $txt .= $value."\r\n";
  1897. }
  1898. break;
  1899. case 'html':
  1900. break;
  1901. default:
  1902. // 如果没有匹配的值
  1903. }
  1904. /*
  1905. * 调用政策资讯 主页 最上面
  1906. *
  1907. */
  1908. $list_16_1 = $this->getIndex9("zhengce",115,12); //生成主站域名 分页
  1909. //$list = array_merge($list,$list_16_1);
  1910. $list_16_1 = $this->unsetHandle($list_16_1,25,$type);
  1911. switch ($type) {
  1912. case 'xml':
  1913. foreach ($list_16_1 as $k=>$value){
  1914. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1915. }
  1916. break;
  1917. case 'txt':
  1918. foreach ($list_16_1 as $k=>$value){
  1919. $txt .= $value."\r\n";
  1920. }
  1921. break;
  1922. case 'html':
  1923. break;
  1924. default:
  1925. // 如果没有匹配的值
  1926. }
  1927. $list_16 = $this->getIndex15("zhengce"); //生成二级域名主页(这里 是 所有省级主页)
  1928. //$list = array_merge($list,$list_16);
  1929. $list_16 = $this->unsetHandle($list_16,26,$type);
  1930. switch ($type) {
  1931. case 'xml':
  1932. foreach ($list_16 as $k=>$value){
  1933. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1934. }
  1935. break;
  1936. case 'txt':
  1937. foreach ($list_16 as $k=>$value){
  1938. $txt .= $value."\r\n";
  1939. }
  1940. break;
  1941. case 'html':
  1942. $html .= '<div class="content"><h2>政策资讯</h2><ul>';
  1943. foreach ($list_16 as $k=>$value){
  1944. $pos = strpos($value, '-');
  1945. if ($pos !== false) {
  1946. }else{
  1947. $value1 = explode('.',$value);
  1948. $value2 = explode('//',$value1[0]);
  1949. //echo $value2;
  1950. $name = Db::name('citysite')->where('domain','=',$value2[1])->value('name');
  1951. $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'地区</a></li>';
  1952. }
  1953. }
  1954. $html .= '</ul></div>';
  1955. break;
  1956. default:
  1957. // 如果没有匹配的值
  1958. }
  1959. $list_16_2 = $this->getIndex10("zhengce",115,12); //生成二级域名 分页
  1960. //$list = array_merge($list,$list_16_2);
  1961. $list_16_2 = $this->unsetHandle($list_16_2,27,$type);
  1962. switch ($type) {
  1963. case 'xml':
  1964. foreach ($list_16_2 as $k=>$value){
  1965. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1966. }
  1967. break;
  1968. case 'txt':
  1969. foreach ($list_16_2 as $k=>$value){
  1970. $txt .= $value."\r\n";
  1971. }
  1972. break;
  1973. case 'html':
  1974. break;
  1975. default:
  1976. // 如果没有匹配的值
  1977. }
  1978. $list_16_4 = $this->getIndex16("zhengce"); //生成二级域名 城市二级目录 主页
  1979. //$list = array_merge($list,$list_16_4);
  1980. $list_16_4 = $this->unsetHandle($list_16_4,28,$type);
  1981. switch ($type) {
  1982. case 'xml':
  1983. foreach ($list_16_4 as $k=>$value){
  1984. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  1985. }
  1986. break;
  1987. case 'txt':
  1988. foreach ($list_16_4 as $k=>$value){
  1989. $txt .= $value."\r\n";
  1990. }
  1991. break;
  1992. case 'html':
  1993. break;
  1994. default:
  1995. // 如果没有匹配的值
  1996. }
  1997. $list_16_3 = $this->getIndex14("zhengce",115,12); //生成二级域名城市二级目录 分页
  1998. //$list = array_merge($list,$list_16_3);
  1999. $list_16_3 = $this->unsetHandle($list_16_3,29,$type);
  2000. switch ($type) {
  2001. case 'xml':
  2002. foreach ($list_16_3 as $k=>$value){
  2003. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2004. }
  2005. break;
  2006. case 'txt':
  2007. foreach ($list_16_3 as $k=>$value){
  2008. $txt .= $value."\r\n";
  2009. }
  2010. break;
  2011. case 'html':
  2012. break;
  2013. default:
  2014. // 如果没有匹配的值
  2015. }
  2016. $list_16_5 = $this->getIndex17("zhengce/cms",115,2,0,0); //主站域名 详情
  2017. //$list = array_merge($list,$list_16_5);
  2018. $list_16_5 = $this->unsetHandle($list_16_5,30,$type);
  2019. switch ($type) {
  2020. case 'xml':
  2021. foreach ($list_16_5 as $k=>$value){
  2022. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  2023. }
  2024. break;
  2025. case 'txt':
  2026. foreach ($list_16_5 as $k=>$value){
  2027. $txt .= $value."\r\n";
  2028. }
  2029. break;
  2030. case 'html':
  2031. break;
  2032. default:
  2033. // 如果没有匹配的值
  2034. }
  2035. $list_16_6 = $this->getIndex18("zhengce/cms",115,2,0,0); //省站域名 详情
  2036. //$list = array_merge($list,$list_16_6);
  2037. $list_16_6 = $this->unsetHandle($list_16_6,31,$type);
  2038. switch ($type) {
  2039. case 'xml':
  2040. foreach ($list_16_6 as $k=>$value){
  2041. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  2042. }
  2043. break;
  2044. case 'txt':
  2045. foreach ($list_16_6 as $k=>$value){
  2046. $txt .= $value."\r\n";
  2047. }
  2048. break;
  2049. case 'html':
  2050. break;
  2051. default:
  2052. // 如果没有匹配的值
  2053. }
  2054. $list_16_7 = $this->getIndex19("zhengce/cms",115,2,0,0); //省站域名二级城市目录 详情
  2055. //$list = array_merge($list,$list_16_7);
  2056. $list_16_7 = $this->unsetHandle($list_16_7,32,$type);
  2057. switch ($type) {
  2058. case 'xml':
  2059. foreach ($list_16_7 as $k=>$value){
  2060. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  2061. }
  2062. break;
  2063. case 'txt':
  2064. foreach ($list_16_7 as $k=>$value){
  2065. $txt .= $value."\r\n";
  2066. }
  2067. break;
  2068. case 'html':
  2069. break;
  2070. default:
  2071. // 如果没有匹配的值
  2072. }
  2073. /*
  2074. * 政策资讯 标签 功能 无区域
  2075. */
  2076. $list_16_8 = $this->getIndex11_1("zhengce",115,12); //列表页
  2077. $list_16_8 = $this->unsetHandle($list_16_8,50,$type);
  2078. switch ($type) {
  2079. case 'xml':
  2080. foreach ($list_16_8 as $k=>$value){
  2081. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2082. }
  2083. break;
  2084. case 'txt':
  2085. foreach ($list_16_8 as $k=>$value){
  2086. $txt .= $value."\r\n";
  2087. }
  2088. break;
  2089. case 'html':
  2090. break;
  2091. default:
  2092. // 如果没有匹配的值
  2093. }
  2094. /*
  2095. * 政策资讯 标签 功能 加上区域
  2096. */
  2097. $list_16_9 = $this->getIndex12_1("zhengce",115,12); //列表页
  2098. $list_16_9 = $this->unsetHandle($list_16_9,51,$type);
  2099. switch ($type) {
  2100. case 'xml':
  2101. foreach ($list_16_9 as $k=>$value){
  2102. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2103. }
  2104. break;
  2105. case 'txt':
  2106. foreach ($list_16_9 as $k=>$value){
  2107. $txt .= $value."\r\n";
  2108. }
  2109. break;
  2110. case 'html':
  2111. break;
  2112. default:
  2113. // 如果没有匹配的值
  2114. }
  2115. /*
  2116. * 攻略主页 在最上面
  2117. */
  2118. $list_17_1 = $this->getIndex9("gonglve",117,12); //生成主站域名 分页
  2119. //$list = array_merge($list,$list_17_1);
  2120. $list_17_1 = $this->unsetHandle($list_17_1,33,$type);
  2121. switch ($type) {
  2122. case 'xml':
  2123. foreach ($list_17_1 as $k=>$value){
  2124. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2125. }
  2126. break;
  2127. case 'txt':
  2128. foreach ($list_17_1 as $k=>$value){
  2129. $txt .= $value."\r\n";
  2130. }
  2131. break;
  2132. case 'html':
  2133. break;
  2134. default:
  2135. // 如果没有匹配的值
  2136. }
  2137. $list_17 = $this->getIndex15("gonglve"); //生成二级域名主页
  2138. //$list = array_merge($list,$list_17);
  2139. $list_17 = $this->unsetHandle($list_17,34,$type);
  2140. switch ($type) {
  2141. case 'xml':
  2142. foreach ($list_17 as $k=>$value){
  2143. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2144. }
  2145. break;
  2146. case 'txt':
  2147. foreach ($list_17 as $k=>$value){
  2148. $txt .= $value."\r\n";
  2149. }
  2150. break;
  2151. case 'html':
  2152. $html .= '<div class="content"><h2>评审攻略</h2><ul>';
  2153. foreach ($list_17 as $k=>$value){
  2154. $pos = strpos($value, '-');
  2155. if ($pos !== false) {
  2156. }else{
  2157. $value1 = explode('.',$value);
  2158. $value2 = explode('//',$value1[0]);
  2159. //echo $value2;
  2160. $name = Db::name('citysite')->where('domain','=',$value2[1])->value('name');
  2161. $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'地区</a></li>';
  2162. }
  2163. }
  2164. $html .= '</ul></div>';
  2165. break;
  2166. default:
  2167. // 如果没有匹配的值
  2168. }
  2169. $list_17_2 = $this->getIndex10("gonglve",117,12); //生成二级域名 分页
  2170. //$list = array_merge($list,$list_17_2);
  2171. $list_17_2 = $this->unsetHandle($list_17_2,35,$type);
  2172. switch ($type) {
  2173. case 'xml':
  2174. foreach ($list_17_2 as $k=>$value){
  2175. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2176. }
  2177. break;
  2178. case 'txt':
  2179. foreach ($list_17_2 as $k=>$value){
  2180. $txt .= $value."\r\n";
  2181. }
  2182. break;
  2183. case 'html':
  2184. break;
  2185. default:
  2186. // 如果没有匹配的值
  2187. }
  2188. $list_17_4 = $this->getIndex16("gonglve"); //生成二级域名 城市二级目录 主页
  2189. //$list = array_merge($list,$list_17_4);
  2190. $list_17_4 = $this->unsetHandle($list_17_4,36,$type);
  2191. switch ($type) {
  2192. case 'xml':
  2193. foreach ($list_17_4 as $k=>$value){
  2194. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2195. }
  2196. break;
  2197. case 'txt':
  2198. foreach ($list_17_4 as $k=>$value){
  2199. $txt .= $value."\r\n";
  2200. }
  2201. break;
  2202. case 'html':
  2203. break;
  2204. default:
  2205. // 如果没有匹配的值
  2206. }
  2207. $list_17_3 =$this->getIndex14("gonglve",117,12); //生成二级域名城市二级目录 分页
  2208. //$list = array_merge($list,$list_17_3);
  2209. $list_17_3 = $this->unsetHandle($list_17_3,37,$type);
  2210. switch ($type) {
  2211. case 'xml':
  2212. foreach ($list_17_3 as $k=>$value){
  2213. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2214. }
  2215. break;
  2216. case 'txt':
  2217. foreach ($list_17_3 as $k=>$value){
  2218. $txt .= $value."\r\n";
  2219. }
  2220. break;
  2221. case 'html':
  2222. break;
  2223. default:
  2224. // 如果没有匹配的值
  2225. }
  2226. $list_17_5 = $this->getIndex17("gonglve1-",117,2,0,0); //主站域名 详情
  2227. //$list = array_merge($list,$list_17_5);
  2228. $list_17_5 = $this->unsetHandle($list_17_5,38,$type);
  2229. switch ($type) {
  2230. case 'xml':
  2231. foreach ($list_17_5 as $k=>$value){
  2232. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  2233. }
  2234. break;
  2235. case 'txt':
  2236. foreach ($list_17_5 as $k=>$value){
  2237. $txt .= $value."\r\n";
  2238. }
  2239. break;
  2240. case 'html':
  2241. break;
  2242. default:
  2243. // 如果没有匹配的值
  2244. }
  2245. $list_17_6 = $this->getIndex18("gonglve1-",117,2,0,0); //省站域名 详情
  2246. //$list = array_merge($list,$list_17_6);
  2247. $list_17_6 = $this->unsetHandle($list_17_6,39,$type);
  2248. switch ($type) {
  2249. case 'xml':
  2250. foreach ($list_17_6 as $k=>$value){
  2251. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  2252. }
  2253. break;
  2254. case 'txt':
  2255. foreach ($list_17_6 as $k=>$value){
  2256. $txt .= $value."\r\n";
  2257. }
  2258. break;
  2259. case 'html':
  2260. break;
  2261. default:
  2262. // 如果没有匹配的值
  2263. }
  2264. $list_17_7 = $this->getIndex19("gonglve1-",117,2,0,0); //省站域名 城市二级目录 详情
  2265. //$list = array_merge($list,$list_17_7);
  2266. $list_17_7 = $this->unsetHandle($list_17_7,40,$type);
  2267. switch ($type) {
  2268. case 'xml':
  2269. foreach ($list_17_7 as $k=>$value){
  2270. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  2271. }
  2272. break;
  2273. case 'txt':
  2274. foreach ($list_17_7 as $k=>$value){
  2275. $txt .= $value."\r\n";
  2276. }
  2277. break;
  2278. case 'html':
  2279. break;
  2280. default:
  2281. // 如果没有匹配的值
  2282. }
  2283. /*
  2284. * 评审攻略 标签 功能 无区域
  2285. */
  2286. $list_17_8 = $this->getIndex11_1("gonglve",117,12); //列表页
  2287. $list_17_8 = $this->unsetHandle($list_17_8,52,$type);
  2288. switch ($type) {
  2289. case 'xml':
  2290. foreach ($list_17_8 as $k=>$value){
  2291. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2292. }
  2293. break;
  2294. case 'txt':
  2295. foreach ($list_17_8 as $k=>$value){
  2296. $txt .= $value."\r\n";
  2297. }
  2298. break;
  2299. case 'html':
  2300. break;
  2301. default:
  2302. // 如果没有匹配的值
  2303. }
  2304. /*
  2305. * 政策资讯 标签 功能 加上区域
  2306. */
  2307. $list_17_9 = $this->getIndex12_1("gonglve",117,12); //列表页
  2308. $list_17_9 = $this->unsetHandle($list_17_9,53,$type);
  2309. switch ($type) {
  2310. case 'xml':
  2311. foreach ($list_17_9 as $k=>$value){
  2312. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2313. }
  2314. break;
  2315. case 'txt':
  2316. foreach ($list_17_9 as $k=>$value){
  2317. $txt .= $value."\r\n";
  2318. }
  2319. break;
  2320. case 'html':
  2321. break;
  2322. default:
  2323. // 如果没有匹配的值
  2324. }
  2325. /*
  2326. * 主页在最上面
  2327. * 论文参考 分页
  2328. */
  2329. $list_18 = $this->getIndex7("lwck",127,12); //列表页
  2330. //$list = array_merge($list,$list_18);
  2331. $list_18 = $this->unsetHandle($list_18,41,$type);
  2332. switch ($type) {
  2333. case 'xml':
  2334. foreach ($list_18 as $k=>$value){
  2335. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2336. }
  2337. break;
  2338. case 'txt':
  2339. foreach ($list_18 as $k=>$value){
  2340. $txt .= $value."\r\n";
  2341. }
  2342. break;
  2343. case 'html':
  2344. break;
  2345. default:
  2346. // 如果没有匹配的值
  2347. }
  2348. $list_18_1 = $this->getIndex8("lwck/cankao",127,2); //论文参考 详情页
  2349. //$list = array_merge($list,$list_18_1);
  2350. $list_18_1 = $this->unsetHandle($list_18_1,42,$type);
  2351. switch ($type) {
  2352. case 'xml':
  2353. foreach ($list_18_1 as $k=>$value){
  2354. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  2355. }
  2356. break;
  2357. case 'txt':
  2358. foreach ($list_18_1 as $k=>$value){
  2359. $txt .= $value."\r\n";
  2360. }
  2361. break;
  2362. case 'html':
  2363. break;
  2364. default:
  2365. // 如果没有匹配的值
  2366. }
  2367. /*
  2368. * 论文参考 标签 功能 无区域
  2369. */
  2370. $list_18_2 = $this->getIndex11_1("lwck",127,12); //列表页
  2371. $list_18_2 = $this->unsetHandle($list_18_2,54,$type);
  2372. switch ($type) {
  2373. case 'xml':
  2374. foreach ($list_18_2 as $k=>$value){
  2375. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2376. }
  2377. break;
  2378. case 'txt':
  2379. foreach ($list_18_2 as $k=>$value){
  2380. $txt .= $value."\r\n";
  2381. }
  2382. break;
  2383. case 'html':
  2384. break;
  2385. default:
  2386. // 如果没有匹配的值
  2387. }
  2388. /*
  2389. * 主页在最上面
  2390. * 常见问题 - 分页
  2391. */
  2392. $list_19 = $this->getIndex7("wthz",111,12); //列表页
  2393. //$list = array_merge($list,$list_19);
  2394. $list_19 = $this->unsetHandle($list_19,43,$type);
  2395. switch ($type) {
  2396. case 'xml':
  2397. foreach ($list_19 as $k=>$value){
  2398. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2399. }
  2400. break;
  2401. case 'txt':
  2402. foreach ($list_19 as $k=>$value){
  2403. $txt .= $value."\r\n";
  2404. }
  2405. break;
  2406. case 'html':
  2407. break;
  2408. default:
  2409. // 如果没有匹配的值
  2410. }
  2411. //$list_19_1 = $this->getIndex8("wthz",111,2); //常见问题 - 详情页 添加区域后 改为方法getIndex17
  2412. $list_19_1 = $this->getIndex17("wthz",111,2,0,0); //主站域名 详情
  2413. //$list = array_merge($list,$list_19_1);
  2414. $list_19_1 = $this->unsetHandle($list_19_1,44,$type);
  2415. switch ($type) {
  2416. case 'xml':
  2417. foreach ($list_19_1 as $k=>$value){
  2418. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  2419. }
  2420. break;
  2421. case 'txt':
  2422. foreach ($list_19_1 as $k=>$value){
  2423. $txt .= $value."\r\n";
  2424. }
  2425. break;
  2426. case 'html':
  2427. break;
  2428. default:
  2429. // 如果没有匹配的值
  2430. }
  2431. /*
  2432. * 文章新增 区域 增加部分
  2433. * !+++++++++++++++++++++++++++++++++++++++++
  2434. */
  2435. $list_16_a = $this->getIndex15("wthz"); //生成二级域名主页(这里 是 所有省级主页)
  2436. //$list = array_merge($list,$list_16);
  2437. $list_16_a = $this->unsetHandle($list_16_a,61,$type);
  2438. switch ($type) {
  2439. case 'xml':
  2440. foreach ($list_16_a as $k=>$value){
  2441. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2442. }
  2443. break;
  2444. case 'txt':
  2445. foreach ($list_16_a as $k=>$value){
  2446. $txt .= $value."\r\n";
  2447. }
  2448. break;
  2449. case 'html':
  2450. $html .= '<div class="content"><h2>常见问题</h2><ul>';
  2451. foreach ($list_16_a as $k=>$value){
  2452. $pos = strpos($value, '-');
  2453. if ($pos !== false) {
  2454. }else{
  2455. $value1 = explode('.',$value);
  2456. $value2 = explode('//',$value1[0]);
  2457. //echo $value2;
  2458. $name = Db::name('citysite')->where('domain','=',$value2[1])->value('name');
  2459. $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'地区</a></li>';
  2460. }
  2461. }
  2462. $html .= '</ul></div>';
  2463. break;
  2464. default:
  2465. // 如果没有匹配的值
  2466. }
  2467. $list_16_2_a = $this->getIndex10("wthz",111,12); //生成二级域名 分页
  2468. //$list = array_merge($list,$list_16_2);
  2469. $list_16_2_a = $this->unsetHandle($list_16_2_a,62,$type);
  2470. switch ($type) {
  2471. case 'xml':
  2472. foreach ($list_16_2_a as $k=>$value){
  2473. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2474. }
  2475. break;
  2476. case 'txt':
  2477. foreach ($list_16_2_a as $k=>$value){
  2478. $txt .= $value."\r\n";
  2479. }
  2480. break;
  2481. case 'html':
  2482. break;
  2483. default:
  2484. // 如果没有匹配的值
  2485. }
  2486. $list_16_4_a = $this->getIndex16("wthz"); //生成二级域名 城市二级目录 主页
  2487. //$list = array_merge($list,$list_16_4);
  2488. $list_16_4_a = $this->unsetHandle($list_16_4_a,63,$type);
  2489. switch ($type) {
  2490. case 'xml':
  2491. foreach ($list_16_4_a as $k=>$value){
  2492. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2493. }
  2494. break;
  2495. case 'txt':
  2496. foreach ($list_16_4_a as $k=>$value){
  2497. $txt .= $value."\r\n";
  2498. }
  2499. break;
  2500. case 'html':
  2501. break;
  2502. default:
  2503. // 如果没有匹配的值
  2504. }
  2505. $list_16_3_a = $this->getIndex14("wthz",111,12); //生成二级域名城市二级目录 分页
  2506. //$list = array_merge($list,$list_16_3);
  2507. $list_16_3_a = $this->unsetHandle($list_16_3_a,64,$type);
  2508. switch ($type) {
  2509. case 'xml':
  2510. foreach ($list_16_3_a as $k=>$value){
  2511. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2512. }
  2513. break;
  2514. case 'txt':
  2515. foreach ($list_16_3_a as $k=>$value){
  2516. $txt .= $value."\r\n";
  2517. }
  2518. break;
  2519. case 'html':
  2520. break;
  2521. default:
  2522. // 如果没有匹配的值
  2523. }
  2524. $list_16_6_a = $this->getIndex18("wthz",111,2,0,0); //省站域名 详情
  2525. //$list = array_merge($list,$list_16_6);
  2526. $list_16_6_a = $this->unsetHandle($list_16_6_a,65,$type);
  2527. switch ($type) {
  2528. case 'xml':
  2529. foreach ($list_16_6_a as $k=>$value){
  2530. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  2531. }
  2532. break;
  2533. case 'txt':
  2534. foreach ($list_16_6_a as $k=>$value){
  2535. $txt .= $value."\r\n";
  2536. }
  2537. break;
  2538. case 'html':
  2539. break;
  2540. default:
  2541. // 如果没有匹配的值
  2542. }
  2543. $list_16_7_a = $this->getIndex19("wthz",111,2,0,0); //省站域名二级城市目录 详情
  2544. //$list = array_merge($list,$list_16_7);
  2545. $list_16_7_a = $this->unsetHandle($list_16_7_a,66,$type);
  2546. switch ($type) {
  2547. case 'xml':
  2548. foreach ($list_16_7_a as $k=>$value){
  2549. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  2550. }
  2551. break;
  2552. case 'txt':
  2553. foreach ($list_16_7_a as $k=>$value){
  2554. $txt .= $value."\r\n";
  2555. }
  2556. break;
  2557. case 'html':
  2558. break;
  2559. default:
  2560. // 如果没有匹配的值
  2561. }
  2562. /*
  2563. * 常见问题 标签 功能 无区域
  2564. */
  2565. $list_19_2 = $this->getIndex11_1("wthz",111,12); //列表页
  2566. $list_19_2 = $this->unsetHandle($list_19_2,55,$type);
  2567. switch ($type) {
  2568. case 'xml':
  2569. foreach ($list_19_2 as $k=>$value){
  2570. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2571. }
  2572. break;
  2573. case 'txt':
  2574. foreach ($list_19_2 as $k=>$value){
  2575. $txt .= $value."\r\n";
  2576. }
  2577. break;
  2578. case 'html':
  2579. break;
  2580. default:
  2581. // 如果没有匹配的值
  2582. }
  2583. /**
  2584. * 文章类型 常见问题 标签功能 增加 区域
  2585. */
  2586. /*
  2587. * 政策资讯 标签 功能 加上区域
  2588. */
  2589. $list_16_9_a = $this->getIndex12_1("wthz",111,12); //列表页
  2590. $list_16_9_a = $this->unsetHandle($list_16_9_a,67,$type);
  2591. switch ($type) {
  2592. case 'xml':
  2593. foreach ($list_16_9_a as $k=>$value){
  2594. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2595. }
  2596. break;
  2597. case 'txt':
  2598. foreach ($list_16_9_a as $k=>$value){
  2599. $txt .= $value."\r\n";
  2600. }
  2601. break;
  2602. case 'html':
  2603. break;
  2604. default:
  2605. // 如果没有匹配的值
  2606. }
  2607. /*
  2608. * 主页在最上面
  2609. * 案例 - 分页
  2610. */
  2611. $list_20 = $this->getIndex7("anli",120,12); //列表页
  2612. //$list = array_merge($list,$list_20);
  2613. $list_20 = $this->unsetHandle($list_20,45,$type);
  2614. switch ($type) {
  2615. case 'xml':
  2616. foreach ($list_20 as $k=>$value){
  2617. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2618. }
  2619. break;
  2620. case 'txt':
  2621. foreach ($list_20 as $k=>$value){
  2622. $txt .= $value."\r\n";
  2623. }
  2624. break;
  2625. case 'html':
  2626. break;
  2627. default:
  2628. // 如果没有匹配的值
  2629. }
  2630. $list_20_1 = $this->getIndex8("anli",120,2); //案例 - 详情页
  2631. //$list = array_merge($list,$list_20_1);
  2632. $list_20_1 = $this->unsetHandle($list_20_1,46,$type);
  2633. switch ($type) {
  2634. case 'xml':
  2635. foreach ($list_20_1 as $k=>$value){
  2636. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  2637. }
  2638. break;
  2639. case 'txt':
  2640. foreach ($list_20_1 as $k=>$value){
  2641. $txt .= $value."\r\n";
  2642. }
  2643. break;
  2644. case 'html':
  2645. break;
  2646. default:
  2647. // 如果没有匹配的值
  2648. }
  2649. /*
  2650. * 案例 标签 功能 无区域
  2651. */
  2652. $list_20_2 = $this->getIndex11_1("anli",120,12); //列表页
  2653. $list_20_2 = $this->unsetHandle($list_20_2,56,$type);
  2654. switch ($type) {
  2655. case 'xml':
  2656. foreach ($list_20_2 as $k=>$value){
  2657. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2658. }
  2659. break;
  2660. case 'txt':
  2661. foreach ($list_20_2 as $k=>$value){
  2662. $txt .= $value."\r\n";
  2663. }
  2664. break;
  2665. case 'html':
  2666. break;
  2667. default:
  2668. // 如果没有匹配的值
  2669. }
  2670. /*
  2671. * 主页 在最上面
  2672. * 职称补贴 - 分页
  2673. */
  2674. $list_21 = $this->getIndex7("zcbt",306,12); //列表页
  2675. //$list = array_merge($list,$list_21);
  2676. $list_21 = $this->unsetHandle($list_21,47,$type);
  2677. switch ($type) {
  2678. case 'xml':
  2679. foreach ($list_21 as $k=>$value){
  2680. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2681. }
  2682. break;
  2683. case 'txt':
  2684. foreach ($list_21 as $k=>$value){
  2685. $txt .= $value."\r\n";
  2686. }
  2687. break;
  2688. case 'html':
  2689. break;
  2690. default:
  2691. // 如果没有匹配的值
  2692. }
  2693. $list_21_1 = $this->getIndex8("zcbt",306,2); //职称补贴 - 详情页
  2694. //$list = array_merge($list,$list_21_1);
  2695. $list_21_1 = $this->unsetHandle($list_21_1,48,$type);
  2696. switch ($type) {
  2697. case 'xml':
  2698. foreach ($list_21_1 as $k=>$value){
  2699. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
  2700. }
  2701. break;
  2702. case 'txt':
  2703. foreach ($list_21_1 as $k=>$value){
  2704. $txt .= $value."\r\n";
  2705. }
  2706. break;
  2707. case 'html':
  2708. break;
  2709. default:
  2710. // 如果没有匹配的值
  2711. }
  2712. /*
  2713. * 职称补贴 标签 功能 无区域
  2714. */
  2715. $list_21_2 = $this->getIndex11_1("zcbt",306,12); //列表页
  2716. $list_21_2 = $this->unsetHandle($list_21_2,57,$type);
  2717. switch ($type) {
  2718. case 'xml':
  2719. foreach ($list_21_2 as $k=>$value){
  2720. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
  2721. }
  2722. break;
  2723. case 'txt':
  2724. foreach ($list_21_2 as $k=>$value){
  2725. $txt .= $value."\r\n";
  2726. }
  2727. break;
  2728. case 'html':
  2729. break;
  2730. default:
  2731. // 如果没有匹配的值
  2732. }
  2733. /*echo "<pre>";
  2734. var_dump($list);
  2735. echo "</pre>";*/
  2736. switch ($type) {
  2737. case 'xml':
  2738. // ... 添加其他页面的URL
  2739. $xmlWriter->endElement();
  2740. $xmlWriter->endDocument();
  2741. //var_dump($xmlWriter->outputMemory(true));
  2742. file_put_contents('./sitemaps/sitemap.xml', $xmlWriter->outputMemory(true));
  2743. break;
  2744. case 'txt':
  2745. file_put_contents('./sitemaps/sitemap.txt',$txt);
  2746. break;
  2747. case 'html':
  2748. $html .= '
  2749. <div class="content">
  2750. <h2>最新tags</h2>
  2751. <ul>
  2752. <!--<li><a target="_blank" href="https://www.zc10000.com/index.php?m=home&c=Tags&a=lists&tagid=69">建筑工程师</a></li>-->
  2753. </ul>
  2754. </div>
  2755. </body>
  2756. </html>';
  2757. //./sitemaps/sitemap.html
  2758. file_put_contents('./sitemap.html',$html);
  2759. break;
  2760. default:
  2761. // 如果没有匹配的值
  2762. }
  2763. }
  2764. public function getIndex()
  2765. {
  2766. $list = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  2767. $url = [];
  2768. $list[] = [
  2769. 'id' => 10000,
  2770. 'domain' => 'www'
  2771. ];
  2772. foreach ($list as $index=>$row){
  2773. $url[] = 'https://'.$row['domain'].'.zc10000.com';
  2774. }
  2775. $url[] = 'https://www.zc10000.com/shandong';
  2776. return $url;
  2777. }
  2778. public function getIndex2()
  2779. {
  2780. $list = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  2781. $url = [];
  2782. $list[] = [
  2783. 'id' => 10000,
  2784. 'domain' => 'www'
  2785. ];
  2786. foreach ($list as $index=>$row){
  2787. if((int)$row['id'] === 10000){
  2788. $collect = Db::name('citysite')->where(['parent_id'=>5290])->select();
  2789. foreach ($collect as $key=>$item){
  2790. $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$item['domain'];
  2791. }
  2792. }else{
  2793. $collect = Db::name('citysite')->where(['parent_id'=>$row['id']])->select();
  2794. foreach ($collect as $key=>$item){
  2795. $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$item['domain'];
  2796. }
  2797. }
  2798. }
  2799. return $url;
  2800. }
  2801. public function getIndex3()
  2802. {
  2803. $list = Db::name('arctype')->where(['parent_id'=>38,'status'=>1,'is_del'=>0])->count();
  2804. $page = ceil($list/12);
  2805. $url = [];
  2806. for ($i=2;$i<=$page;$i++){
  2807. $url[] = 'https://www.zc10000.com/zczl-'.$i;
  2808. }
  2809. return $url;
  2810. }
  2811. public function getIndex4()
  2812. {
  2813. $list = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  2814. $url = [];
  2815. $list[] = [
  2816. 'id' => 10000
  2817. ];
  2818. foreach ($list as $index=>$row){
  2819. if((int)$row['id'] === 10000){
  2820. $number = 32;
  2821. }else{
  2822. //查找序列号
  2823. $number = Db::name('seo_number')->where(['type'=>3,'aid'=>$row['id'],'is_del'=>0])->value('number');
  2824. }
  2825. $url[] = 'https://www.zc10000.com/zczl/jzzc'.$number;
  2826. }
  2827. return $url;
  2828. }
  2829. public function getIndex5()
  2830. {
  2831. $list = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  2832. $url = [];
  2833. $list[] = [
  2834. 'id' => 10000
  2835. ];
  2836. foreach ($list as $index=>$row){
  2837. //查找序列号
  2838. if((int)$row['id'] === 10000){
  2839. $number = 32;
  2840. }else{
  2841. $number = Db::name('seo_number')->where(['type'=>3,'aid'=>$row['id'],'is_del'=>0])->value('number');
  2842. }
  2843. //查找分页
  2844. $list2 = Db::name('arctype')->where(['parent_id'=>38,'status'=>1,'is_del'=>0,'area_id'=>$row['id']])->count();
  2845. if((int)$list2 === 0){
  2846. $list2 = 1; //假设有一条数据
  2847. }
  2848. $page = ceil($list2/12);
  2849. for ($i=2;$i<=$page;$i++){
  2850. $url[] = 'https://www.zc10000.com/zczl/jzzc'.$number.'-'.$i;
  2851. }
  2852. }
  2853. return $url;
  2854. }
  2855. public function getIndex6()
  2856. {
  2857. $list = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  2858. $url = [];
  2859. $list[] = [
  2860. 'id' => 10000,
  2861. 'domain' => 'www',
  2862. ];
  2863. foreach ($list as $index=>$row){
  2864. //查找序列号
  2865. $list_1 = Db::name('seo_number')->where(['type'=>1,'area_id'=>$row['id'],'is_del'=>0,'parentid'=>38])->select();
  2866. foreach ($list_1 as $key=>$item) {
  2867. //判断是否已删除 栏目只有删除 与 未删除
  2868. $op = Db::name('arctype')->where(['id'=>$item['aid']])->find();
  2869. if((int)$op['is_del'] === 1){
  2870. $url[] = 'https://' . $row['domain'] . '.zc10000.com/id' . $item['number'].'---ID:'.$item['aid'].'(is_del)';
  2871. }else{
  2872. $url[] = 'https://' . $row['domain'] . '.zc10000.com/id' . $item['number'];
  2873. }
  2874. if((int)$op['is_del'] === 0) {
  2875. //查询有多少级别
  2876. $level_group_id = Db::name('archives')->where(['typeid' => $item['aid'], 'product_id' => 0])->value('level_group_id');
  2877. //echo $level_group_id.'<br/>';
  2878. $level_count = 0;
  2879. if ((int)$level_group_id > 0) {
  2880. ///只调用存在的链接
  2881. $level_count = Db::name('archives')->where(['typeid' => $level_group_id, 'is_del' => 0, 'arcrank' => 0, 'status' => 1])->count();
  2882. }
  2883. for ($i = 1; $i < $level_count; $i++) {
  2884. //去掉主页
  2885. $url[] = 'https://' . $row['domain'] . '.zc10000.com/id' . $item['number'] . 'h' . $i;
  2886. }
  2887. //查询子类
  2888. $list_2 = Db::name('seo_number')->where(['type' => 1, 'is_del' => 0, 'parentid' => $item['aid']])->select();
  2889. foreach ($list_2 as $key2 => $item2) {
  2890. //判断是否已删除
  2891. $op2 = Db::name('arctype_cat')->where(['id' => $item2['aid']])->find();
  2892. if ((int)$op2['is_del'] === 1) {
  2893. $url[] = 'https://' . $row['domain'] . '.zc10000.com/id' . $item['number'] . '/sid' . $item2['number'] . '---ID:' . $item2['aid'] . '(is_del)';
  2894. } else {
  2895. $url[] = 'https://' . $row['domain'] . '.zc10000.com/id' . $item['number'] . '/sid' . $item2['number'];
  2896. }
  2897. if ((int)$op2['is_del'] === 0) {
  2898. //查询子类级别
  2899. $level_group_id2 = Db::name('archives')->where(['typeid' => $item['aid'], 'product_id' => $item2['aid']])->value('level_group_id');
  2900. $level_count2 = 0;
  2901. if ((int)$level_group_id2 > 0) {
  2902. //只调用存在的链接
  2903. $level_count2 = Db::name('archives')->where(['typeid' => $level_group_id2, 'is_del' => 0, 'arcrank' => 0, 'status' => 1])->count();
  2904. }
  2905. for ($i2 = 1; $i2 < $level_count2; $i2++) {
  2906. //去掉主页
  2907. $url[] = 'https://' . $row['domain'] . '.zc10000.com/id' . $item['number'] . '/sid' . $item2['number'] . 'h' . $i2;
  2908. }
  2909. }
  2910. }
  2911. }
  2912. }
  2913. }
  2914. return $url;
  2915. }
  2916. public function getIndex7($str="zclw",$typeid=116,$pasize=25)
  2917. {
  2918. $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0])->count();
  2919. $desc = '';
  2920. if((int)$list === 0){
  2921. $list = 1; //假设有一条数据
  2922. $desc = '---(list_is_null)';
  2923. }
  2924. $page = ceil($list/$pasize);
  2925. $url = [];
  2926. for ($i=2;$i<=$page;$i++){
  2927. $url[] = 'https://www.zc10000.com/'.$str.'-'.$i.$desc;
  2928. }
  2929. return $url;
  2930. }
  2931. public function getIndex8($str="zclw/lunwen",$typeid=116,$ty=4)
  2932. {
  2933. $list_1 = Db::name('seo_number')->where(['type'=>$ty,'tid'=>$typeid,'is_del'=>0])->select();
  2934. foreach ($list_1 as $key=>$item) {
  2935. //判断文档是否已删除
  2936. $op = Db::name('archives')->where(['aid'=>$item['aid']])->find();
  2937. $desc = '';
  2938. if((int)$op['is_del'] === 1){
  2939. $desc .= '---ID: '.$item['aid']."(is_del)";
  2940. }
  2941. if((int)$op['arcrank'] === 1){
  2942. $desc .= '---ID: '.$item['aid']."(is_arcrank)";
  2943. }
  2944. if((int)$op['status'] === 0){
  2945. $desc .= '---ID: '.$item['aid']."(is_status)";
  2946. }
  2947. $url[] = 'https://www.zc10000.com/'.$str.$item['number'].$desc;
  2948. }
  2949. return $url;
  2950. }
  2951. /*
  2952. * 职称材料
  2953. */
  2954. public function getIndex9($str="zccl",$typeid=126,$pasize=20)
  2955. {
  2956. $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0])->count();
  2957. $desc = '';
  2958. if((int)$list === 0){
  2959. $list = 1; //假设有一条数据
  2960. $desc = '---list-is_null)';
  2961. }
  2962. $page = ceil($list/$pasize);
  2963. $url = [];
  2964. for ($i=2;$i<=$page;$i++){
  2965. $url[] = 'https://www.zc10000.com/'.$str.'-'.$i.$desc;
  2966. }
  2967. return $url;
  2968. }
  2969. /*
  2970. * 职称材料 加入区域
  2971. */
  2972. public function getIndex10($str="zccl",$typeid=126,$pasize=20)
  2973. {
  2974. $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  2975. $url = [];
  2976. //https://www.zc10000.com/shandong_zccl
  2977. $area[] = [
  2978. 'id' => 10000,
  2979. 'domain' => 'www'
  2980. ];
  2981. foreach ($area as $index=>$row){
  2982. //seo_number 并没有这个字段 arcrank 假设没有 先不管了
  2983. $is_www = 0;
  2984. if((int)$row['id'] === 10000 && (int)$pasize === 20){
  2985. //伪区域内容 (职称材料调用)
  2986. $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'area_tag_id'=>$row['id']])->count();
  2987. $str = 'shandong_'.$str;
  2988. $is_www = 1;
  2989. }else{
  2990. $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'province_id'=>$row['id']])->count();
  2991. }
  2992. $desc = '';
  2993. if((int)$list === 0){
  2994. $list = 1; //假设有一条数据
  2995. $desc = '---list_is_null)';
  2996. }
  2997. $page = ceil($list/$pasize);
  2998. for ($i=1;$i<=$page;$i++){
  2999. if($i === 1 && $str === 'zccl' || $i === 1 && $str === 'zlwd' || $i === 1 && $str === 'zcwj' || $i === 1 && $is_www === 1){
  3000. $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$str.$desc;
  3001. }else{
  3002. if($i > 1) {
  3003. $url[] = 'https://' . $row['domain'] . '.zc10000.com/' . $str . '-' . $i.$desc;
  3004. }
  3005. }
  3006. }
  3007. }
  3008. return $url;
  3009. }
  3010. /*
  3011. * 加入 标签
  3012. */
  3013. public function getIndex11($str="zccl",$typeid=126,$pasize=20)
  3014. {
  3015. $tagList = Db::name('archives')->where(['typeid'=>58,'status'=>1,'is_del'=>0])->select();
  3016. $url = [];
  3017. foreach ($tagList as $index=>$row){
  3018. //seo_number 并没有这个字段 arcrank 假设没有 先不管了
  3019. $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'product_tag_id'=>$row['aid']])->count();
  3020. $desc = '';
  3021. if((int)$list === 0){
  3022. $list = 1; //假设有一条数据
  3023. $desc = '---list_is_null)';
  3024. }
  3025. $page = ceil($list/$pasize);
  3026. for ($i=1;$i<=$page;$i++){
  3027. if($i === 1 && $str === 'zccl' || $i === 1 && $str === 'zlwd' || $i === 1 && $str === 'zcwj' || $i === 1 && $str === 'shandong_zccl' || $i === 1 && $str === 'shandong_zlwd' || $i === 1 && $str === 'shandong_zcwj'){
  3028. $url[] = 'https://www.zc10000.com/'.$str.'/tag'.$row['aid'].$desc;
  3029. }else{
  3030. if($i > 1) {
  3031. $url[] = 'https://www.zc10000.com/' . $str . '/tag' . $row['aid'] . '-' . $i.$desc;
  3032. }
  3033. }
  3034. }
  3035. }
  3036. return $url;
  3037. }
  3038. /*
  3039. * 加入区域和标签
  3040. */
  3041. public function getIndex12($str="zccl",$typeid=126,$pasize=20)
  3042. {
  3043. $tagList = Db::name('archives')->where(['typeid'=>58,'status'=>1,'is_del'=>0])->select();
  3044. $url = [];
  3045. foreach ($tagList as $index=>$row){
  3046. $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  3047. foreach ($area as $key=>$item){
  3048. //seo_number 并没有这个字段 arcrank 假设没有 先不管了
  3049. $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'province_id'=>$item['id'],'product_tag_id'=>$row['aid']])->count();
  3050. $desc = '';
  3051. if((int)$list === 0){
  3052. $list = 1; //假设有一条数据
  3053. $desc = '---list_is_null)';
  3054. }
  3055. $page = ceil($list/$pasize);
  3056. for ($i=1;$i<=$page;$i++){
  3057. if($i === 1 && $str === 'zccl' || $i === 1 && $str === 'zlwd' || $i === 1 && $str === 'zcwj'){
  3058. $url[] = 'https://'.$item['domain'].'.zc10000.com/'.$str.'/tag'.$row['aid'].$desc;
  3059. }else{
  3060. if($i > 1) {
  3061. $url[] = 'https://' . $item['domain'] . '.zc10000.com/' . $str . '/tag' . $row['aid'] . '-' . $i.$desc;
  3062. }
  3063. }
  3064. }
  3065. }
  3066. }
  3067. return $url;
  3068. }
  3069. public function getIndex13($str='zlwd',$tid='126')
  3070. {
  3071. $list = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  3072. $url = [];
  3073. $list[] = [
  3074. 'id' => 0,
  3075. 'domain' => 'www'
  3076. ];
  3077. foreach ($list as $index=>$row){
  3078. //查找序列号
  3079. $data = Db::name('seo_number')->where(['type'=>5,'area_id'=>$row['id'],'is_del'=>0,'tid'=>$tid])->select();
  3080. foreach ($data as $key=>$item){
  3081. //判断文档是否已删除
  3082. $op = Db::name('archives')->where(['aid'=>$item['aid']])->find();
  3083. $desc = '';
  3084. if((int)$op['is_del'] === 1){
  3085. $desc .= '---ID: '.$item['aid']."(is_del)";
  3086. }
  3087. if((int)$op['arcrank'] === 1){
  3088. $desc .= '---ID: '.$item['aid']."(is_arcrank)";
  3089. }
  3090. if((int)$op['status'] === 0){
  3091. $desc .= '---ID: '.$item['aid']."(is_status)";
  3092. }
  3093. if((int)$row['id'] === 0){
  3094. $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$str.'/cms'.$item['number'].$desc;
  3095. }else{
  3096. $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$str.'/cms'.$item['number'].$desc;
  3097. }
  3098. }
  3099. }
  3100. return $url;
  3101. }
  3102. public function getIndex14($str="zhengce",$typeid=115,$pasize=10)
  3103. {
  3104. $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  3105. $url = [];
  3106. foreach ($area as $index=>$row){
  3107. $collect = Db::name('citysite')->where(['parent_id'=>$row['id']])->select();
  3108. foreach ($collect as $key=>$item){
  3109. //seo_number 并没有这个字段 arcrank 假设没有 先不管了
  3110. $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'city_id'=>$item['id']])->count();
  3111. $desc = '';
  3112. if((int)$list === 0){
  3113. $list = 1; //假设有一条数据
  3114. $desc = '---list_is_null)';
  3115. }
  3116. $page = ceil($list/$pasize);
  3117. for ($i=2;$i<=$page;$i++){
  3118. $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$item['domain'].'/'.$str.'-'.$i.$desc;
  3119. }
  3120. }
  3121. }
  3122. return $url;
  3123. }
  3124. public function getIndex15($str="zhengce")
  3125. {
  3126. $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  3127. $url = [];
  3128. foreach ($area as $index=>$row){
  3129. $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$str;
  3130. }
  3131. return $url;
  3132. }
  3133. public function getIndex16($str="zhengce")
  3134. {
  3135. $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  3136. $url = [];
  3137. foreach ($area as $index=>$row){
  3138. $collect = Db::name('citysite')->where(['parent_id'=>$row['id']])->select();
  3139. foreach ($collect as $key=>$item){
  3140. $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$item['domain'].'/'.$str;
  3141. }
  3142. }
  3143. return $url;
  3144. }
  3145. public function getIndex17($str="zhengce/cms",$typeid=115,$ty=2,$area_id=0,$city_id=0)
  3146. {
  3147. $list_1 = Db::name('seo_number')->where(['type'=>$ty,'tid'=>$typeid,'is_del'=>0,"area_id"=>$area_id,"city_id"=>$city_id])->select();
  3148. foreach ($list_1 as $key=>$item) {
  3149. //判断文档是否已删除
  3150. $op = Db::name('archives')->where(['aid'=>$item['aid']])->find();
  3151. $desc = '';
  3152. if((int)$op['is_del'] === 1){
  3153. $desc .= '---ID: '.$item['aid']."(is_del)";
  3154. }
  3155. if((int)$op['arcrank'] === 1){
  3156. $desc .= '---ID: '.$item['aid']."(is_arcrank)";
  3157. }
  3158. if((int)$op['status'] === 0){
  3159. $desc .= '---ID: '.$item['aid']."(is_status)";
  3160. }
  3161. $url[] = 'https://www.zc10000.com/'.$str.$item['number'].$desc;
  3162. }
  3163. return $url;
  3164. }
  3165. public function getIndex18($str="zhengce/cms",$typeid=115,$ty=2,$area_id=0,$city_id=0)
  3166. {
  3167. $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  3168. $url = [];
  3169. foreach ($area as $index=>$row){
  3170. $list_1 = Db::name('seo_number')->where(['type'=>$ty,'tid'=>$typeid,'is_del'=>0,"area_id"=>$row['id'],"city_id"=>$city_id])->select();
  3171. foreach ($list_1 as $key=>$item) {
  3172. //判断文档是否已删除
  3173. $op = Db::name('archives')->where(['aid'=>$item['aid']])->find();
  3174. $desc = '';
  3175. if((int)$op['is_del'] === 1){
  3176. $desc .= '---ID: '.$item['aid']."(is_del)";
  3177. }
  3178. if((int)$op['arcrank'] === 1){
  3179. $desc .= '---ID: '.$item['aid']."(is_arcrank)";
  3180. }
  3181. if((int)$op['status'] === 0){
  3182. $desc .= '---ID: '.$item['aid']."(is_status)";
  3183. }
  3184. $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$str.$item['number'].$desc;
  3185. }
  3186. }
  3187. return $url;
  3188. }
  3189. public function getIndex19($str="zhengce/cms",$typeid=115,$ty=2,$area_id=0,$city_id=0)
  3190. {
  3191. $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  3192. $url = [];
  3193. foreach ($area as $index=>$row){
  3194. $collect = Db::name('citysite')->where(['parent_id'=>$row['id']])->select();
  3195. foreach ($collect as $key=>$item){
  3196. $list_1 = Db::name('seo_number')->where(['type'=>$ty,'tid'=>$typeid,'is_del'=>0,"area_id"=>$row['id'],"city_id"=>$item['id']])->select();
  3197. foreach ($list_1 as $key2=>$item2) {
  3198. //判断文档是否已删除
  3199. $op = Db::name('archives')->where(['aid'=>$item2['aid']])->find();
  3200. $desc = '';
  3201. if((int)$op['is_del'] === 1){
  3202. $desc .= '---ID: '.$item2['aid']."(is_del)";
  3203. }
  3204. if((int)$op['arcrank'] === 1){
  3205. $desc .= '---ID: '.$item2['aid']."(is_arcrank)";
  3206. }
  3207. if((int)$op['status'] === 0){
  3208. $desc .= '---ID: '.$item2['aid']."(is_status)";
  3209. }
  3210. $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$item['domain'].'/'.$str.$item2['number'].$desc;
  3211. }
  3212. }
  3213. }
  3214. return $url;
  3215. }
  3216. public function buildXml($xmlWriter,$value,$time,$mod="hourly",$level="1.0")
  3217. {
  3218. /*
  3219. * 循环 start
  3220. */
  3221. // 添加你网站的URL
  3222. $xmlWriter->startElement('url');
  3223. $xmlWriter->writeElement('loc', $value);
  3224. $xmlWriter->writeElement('lastmod', $time);
  3225. $xmlWriter->writeElement('changefreq', $mod);
  3226. //always hourly daily weekly monthly yearly never
  3227. $xmlWriter->writeElement('priority', $level); //优先级 0.0到1.0之间
  3228. $xmlWriter->startElement('mobile:mobile');
  3229. $xmlWriter->writeAttribute('type', 'htmladapt');
  3230. //<mobile:mobile type="pc,mobile"/>
  3231. //<mobile:mobile/> :移动网页
  3232. //<mobile:mobile type="mobile"/> :移动网页
  3233. //<mobile:mobile type="htmladapt"/>:代码适配
  3234. $xmlWriter->endElement();
  3235. $xmlWriter->endElement();
  3236. /*
  3237. * 循环 end
  3238. */
  3239. return $xmlWriter;
  3240. }
  3241. public function unsetHandle($list=[],$group_id=0,$type='xml'){
  3242. if($type == 'txt') {
  3243. $temp = [];
  3244. foreach ($list as $k => $value) {
  3245. $data = [];
  3246. $update_data = [];
  3247. if (strpos($value, 'is_del') !== false) {
  3248. $data['is_del'] = 1;
  3249. $update_data['is_del'] = 1;
  3250. } else {
  3251. $data['is_del'] = 0;
  3252. $update_data['is_del'] = 0;
  3253. }
  3254. if (strpos($value, 'is_arcrank') !== false) {
  3255. $data['is_arcrank'] = 1;
  3256. $update_data['is_arcrank'] = 1;
  3257. } else {
  3258. $data['is_arcrank'] = 0;
  3259. $update_data['is_arcrank'] = 0;
  3260. }
  3261. if (strpos($value, 'is_status') !== false) {
  3262. $data['is_status'] = 1;
  3263. $update_data['is_status'] = 1;
  3264. } else {
  3265. $data['is_status'] = 0;
  3266. $update_data['is_status'] = 0;
  3267. }
  3268. if (strpos($value, 'list_is_null') !== false) {
  3269. $data['is_null'] = 1;
  3270. $update_data['is_null'] = 1;
  3271. //列表页为空 也要加入地图
  3272. $new_url = explode('---', $value);
  3273. $new_url = $new_url[0];
  3274. $temp[] = $new_url;
  3275. } else {
  3276. $data['is_null'] = 0;
  3277. $update_data['is_null'] = 0;
  3278. }
  3279. if (strpos($value, '---') !== false) {
  3280. $new_url = explode('---', $value);
  3281. $new_url = $new_url[0];
  3282. } else {
  3283. $new_url = $value;
  3284. //其他url加入地图
  3285. $temp[] = $value;
  3286. }
  3287. $one = Db::name('all_url')->where(['url' => $new_url])->find();
  3288. if (empty($one)) {
  3289. $data['group_id'] = $group_id;
  3290. $data['url'] = $new_url;
  3291. $data['update_time'] = time();
  3292. $data['add_time'] = time();
  3293. Db::name('all_url')->insert($data);
  3294. } else {
  3295. $update_data['update_time'] = time();
  3296. $update_data['group_id'] = $group_id;
  3297. Db::name('all_url')->where(['url' => $new_url])->update($update_data);
  3298. }
  3299. }
  3300. return $temp;
  3301. }else{
  3302. return $list;
  3303. }
  3304. }
  3305. public function catIndex()
  3306. {
  3307. $data = [
  3308. '获取主页和专题页',
  3309. '省级主页',
  3310. '城市主页',
  3311. '产品 无区域 分页',
  3312. '产品按省级 主页',
  3313. '产品按省级 分页',
  3314. '产品url',
  3315. '论文列表 - 分页',
  3316. '论文详情',
  3317. '职称材料 zccl 无区域 无标签 分页',
  3318. '职称材料 zccl 只有区域 包含 区域主页 + 分页',
  3319. '职称材料 zccl 只有标签 包含 标签主页 + 分页',
  3320. '职称材料 zccl 同时有 区域+标签 包含主页 + 分页',
  3321. '职称材料 zlwd 无区域 无标签 分页',
  3322. '职称材料 zlwd 只有区域 包含 区域主页 + 分页',
  3323. '职称材料 zlwd 只有标签 包含 标签主页 + 分页',
  3324. '职称材料 zlwd 同时有 区域+标签 包含主页 + 分页',
  3325. '职称材料 zcwj 无区域 无标签 分页',
  3326. '职称材料 zcwj 只有区域 包含 区域主页 + 分页',
  3327. '职称材料 zcwj 只有标签 包含 标签主页 + 分页',
  3328. '职称材料 zcwj 同时有 区域+标签 包含主页 + 分页',
  3329. '职称材料 详情页 zlwd',
  3330. '职称材料 详情页 zcwj',
  3331. '职称答辩 - 分页',
  3332. '职称答辩 - 分页',
  3333. '政策资讯生成主站域名 分页',
  3334. '政策资讯生成二级域名主页',
  3335. '政策资讯生成二级域名 分页',
  3336. '政策资讯生成二级域名 城市二级目录 主页',
  3337. '政策资讯生成二级域名城市二级目录 分页',
  3338. '政策资讯主站域名 详情',
  3339. '政策资讯省站域名 详情',
  3340. '政策资讯省站域名 城市二级目录 详情',
  3341. '评审攻略生成主站域名 分页',
  3342. '评审攻略生成二级域名主页',
  3343. '评审攻略生成二级域名 分页',
  3344. '评审攻略生成二级域名 城市二级目录 主页',
  3345. '评审攻略生成二级域名城市二级目录 分页',
  3346. '评审攻略主站域名 详情',
  3347. '评审攻略省站域名 详情',
  3348. '评审攻略省站域名 城市二级目录 详情',
  3349. '论文参考 分页',
  3350. '论文参考 详情页',
  3351. '常见问题 - 分页',
  3352. '常见问题 - 详情页',
  3353. '案例 - 分页',
  3354. '案例 - 详情页',
  3355. '职称补贴 - 分页',
  3356. '职称补贴 - 详情页',
  3357. '职称答辩 标签 功能', //49
  3358. '政策资讯 标签 功能 无区域', //50
  3359. '政策资讯 标签 功能 加上区域',
  3360. '评审攻略 标签 功能 无区域', //52
  3361. '评审攻略 标签 功能 加上区域',
  3362. '论文参考 标签 功能 无区域',
  3363. '常见问题 标签 功能 无区域',
  3364. '案例 标签 功能 无区域',
  3365. '职称补贴 标签 功能 无区域',
  3366. '伪山东 - 职称材料',
  3367. '伪山东 - 通用文件',
  3368. '伪山东 - 政策指引', //60
  3369. '常见问题生成二级域名主页', //61
  3370. '常见问题生成二级域名 分页', //62
  3371. '常见问题生成二级域名 城市二级目录 主页',
  3372. '常见问题生成二级域名城市二级目录 分页',
  3373. '常见问题省站域名 详情', //65
  3374. '常见问题省站域名 城市二级目录 详情',
  3375. '常见问题 标签 功能 加上区域', //67
  3376. ];
  3377. foreach ($data as $key => $row){
  3378. $insert['gid'] = $key;
  3379. $insert['name'] = $row;
  3380. $one = Db::name('all_name')->where('gid','=',$key)->find();
  3381. if(!empty($one)){
  3382. Db::name('all_name')->where('gid','=',$key)->update($insert);
  3383. }else{
  3384. Db::name('all_name')->insert($insert);
  3385. }
  3386. }
  3387. /*
  3388. * 查询sql
  3389. *
  3390. */
  3391. $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
  3392. WHEN a.is_del = 0 THEN ''
  3393. ELSE '文档已删除'
  3394. END AS 是否删除,CASE
  3395. WHEN a.is_null = 0 THEN ''
  3396. ELSE '列表数据为空'
  3397. END AS 列表是否为空,CASE
  3398. WHEN a.is_arcrank = 0 THEN ''
  3399. ELSE '文档审核中'
  3400. END AS 文档是否审核,CASE
  3401. WHEN a.is_status = 0 THEN ''
  3402. ELSE '屏蔽中'
  3403. END AS 正常或者屏蔽 from ey_all_url a order by a.group_id asc";
  3404. }
  3405. /*
  3406. * 文章 加入 标签
  3407. */
  3408. public function getIndex11_1($str="wthz",$typeid=111,$pasize=12)
  3409. {
  3410. //根据tid 查询
  3411. $cat = Db::name('arctype')->where(['parent_id'=>369,'article_id'=>$typeid])->find();
  3412. if(empty($cat)){
  3413. $cat_id = 371;
  3414. }else{
  3415. $cat_id = $cat['id'];
  3416. }
  3417. //加入区域 只调用主站的标签
  3418. $tagList = Db::name('archives')->where([
  3419. 'typeid'=>$cat_id,'status'=>1,'is_del'=>0,
  3420. 'province_id' => 0
  3421. ])->select();
  3422. $url = [];
  3423. foreach ($tagList as $index=>$row){
  3424. //seo_number 并没有这个字段 arcrank 假设没有 先不管了
  3425. //主站是没有区域 加入区域0
  3426. $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'product_tag_id'=>$row['aid'],'province_id' => 0])->count();
  3427. $desc = '';
  3428. if((int)$list === 0){
  3429. $list = 1; //假设有一条数据
  3430. $desc = '---list_is_null)';
  3431. }
  3432. $page = ceil($list/$pasize);
  3433. for ($i=1;$i<=$page;$i++){
  3434. if($i === 1){
  3435. $url[] = 'https://www.zc10000.com/'.$str.'/tag'.$row['aid'].$desc;
  3436. }else{
  3437. $url[] = 'https://www.zc10000.com/' . $str . '/tag' . $row['aid'] . '-' . $i.$desc;
  3438. }
  3439. }
  3440. }
  3441. return $url;
  3442. }
  3443. /*
  3444. * 文章 加入区域和标签
  3445. */
  3446. public function getIndex12_1($str="wthz",$typeid=111,$pasize=12)
  3447. {
  3448. //根据tid 查询
  3449. $cat = Db::name('arctype')->where(['parent_id'=>369,'article_id'=>$typeid])->find();
  3450. if(empty($cat)){
  3451. $cat_id = 371;
  3452. }else{
  3453. $cat_id = $cat['id'];
  3454. }
  3455. /*
  3456. * 原先是一个标签拥有多个省份
  3457. * 现在改为 每个省 对应 有哪些标签
  3458. */
  3459. $url = [];
  3460. $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
  3461. foreach ($area as $key=>$item){
  3462. $tagList = Db::name('archives')->where([
  3463. 'typeid'=>$cat_id,'status'=>1,'is_del'=>0,
  3464. 'province_id' => $item['id']
  3465. ])->select();
  3466. foreach ($tagList as $index=>$row){
  3467. //seo_number 并没有这个字段 arcrank 假设没有 先不管了
  3468. $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'province_id'=>$item['id'],'product_tag_id'=>$row['aid']])->count();
  3469. $desc = '';
  3470. if((int)$list === 0){
  3471. $list = 1; //假设有一条数据
  3472. $desc = '---list_is_null)';
  3473. }
  3474. $page = ceil($list/$pasize);
  3475. for ($i=1;$i<=$page;$i++){
  3476. if($i === 1){
  3477. $url[] = 'https://'.$item['domain'].'.zc10000.com/'.$str.'/tag'.$row['aid'].$desc;
  3478. }else{
  3479. $url[] = 'https://' . $item['domain'] . '.zc10000.com/' . $str . '/tag' . $row['aid'] . '-' . $i.$desc;
  3480. }
  3481. }
  3482. //查询城市
  3483. $collect = Db::name('citysite')->where(['parent_id'=>$item['id']])->select();
  3484. foreach ($collect as $key2=>$item2){
  3485. //查询
  3486. $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'province_id'=>$item['id'],'city_id'=>$item2['id'],'product_tag_id'=>$row['aid']])->count();
  3487. $desc = '';
  3488. if((int)$list === 0){
  3489. $list = 1; //假设有一条数据
  3490. $desc = '---list_is_null)';
  3491. }
  3492. $page = ceil($list/$pasize);
  3493. for ($i=1;$i<=$page;$i++){
  3494. if($i === 1){
  3495. $url[] = 'https://'.$item['domain'].'.zc10000.com/'.$item2['domain'].'/'.$str.'/tag'.$row['aid'].$desc;
  3496. }else{
  3497. $url[] = 'https://' . $item['domain'] . '.zc10000.com/'.$item2['domain'].'/' . $str . '/tag' . $row['aid'] . '-' . $i.$desc;
  3498. }
  3499. }
  3500. }
  3501. }
  3502. }
  3503. return $url;
  3504. }
  3505. /*
  3506. * 按字母输出所有城市
  3507. * https://www.zc10000.com/api/other/getAllCity
  3508. */
  3509. public function getAllCity(){
  3510. $list = Db::name('region')->where(['level'=>2])->order('initial asc,parent_id asc')
  3511. //->limit(2)
  3512. ->select();
  3513. //dump($list);
  3514. //'北京|beijing|bj'
  3515. $data = [];
  3516. $pinyin = new Pinyin();
  3517. //dump($pinyin);
  3518. foreach ($list as $key=>$row){
  3519. $chinese = str_replace('市','',$row['name']);
  3520. $a = $pinyin->convert($chinese);
  3521. $str = '';
  3522. foreach ($a as $index => $item){
  3523. $str = $str.$item;
  3524. }
  3525. $b = $pinyin->abbr($chinese);
  3526. $h = $row['name'].'|'.$str.'|'.$b;
  3527. $data[] = $h;
  3528. echo '\''.$h.'\',';
  3529. }
  3530. }
  3531. /*
  3532. * 校验文章和序列号记录 状态
  3533. * aid是唯一的 就不需要 分类查询了
  3534. * 以后按定时任务 分页处理
  3535. * https://www.zc10000.com/api/other/rtArticleIsdel
  3536. */
  3537. public function rtArticleIsdel(){
  3538. //针对 文章 论文 文档
  3539. $list = Db::name('seo_number')
  3540. ->where('type',in,[2,4,5])
  3541. ->where(['is_del'=>0])
  3542. ->select();
  3543. foreach ($list as $key=>$item){
  3544. //查询对应的有没有被删除 更新序列号记录
  3545. $one = Db::name('archives')->where(['aid'=>$item['aid']])->find();
  3546. $data = [
  3547. 'is_del' => (int)$one['is_del'],
  3548. 'is_kan' => (int)$one['arcrank'], // 0正常 1审核
  3549. 'status' => (int)$one['status'],
  3550. ];
  3551. $res = Db::name('seo_number')->where(['id'=>$item['id']])->update($data);
  3552. echo '文档ID: '.$item['id'].'-类型:'.$item['type'].'-'.$res.'<br/>';
  3553. }
  3554. }
  3555. /*
  3556. * https://www.zc10000.com/api/other/rtArticleIsdelCount
  3557. */
  3558. public function rtArticleIsdelCount(){
  3559. //针对 文章 论文 文档
  3560. $list = Db::name('seo_number')
  3561. ->where('type',in,[2,4,5])
  3562. ->where(['is_del'=>1])
  3563. ->select();
  3564. foreach ($list as $key=>$item){
  3565. //查询对应的有没有被删除 更新序列号记录
  3566. $one = Db::name('archives')->where(['aid'=>$item['aid']])->find();
  3567. echo '文档ID: '.$item['id'].'-类型:'.$item['type'].'-已删除:'.$one['is_del'].'<br/>';
  3568. }
  3569. }
  3570. /*
  3571. * 处理产品
  3572. * https://www.zc10000.com/api/other/rtArticleIsdelPro
  3573. */
  3574. public function rtArticleIsdelPro(){
  3575. //针对 文章 论文 文档
  3576. $list = Db::name('seo_number')
  3577. ->where('type','=',1)
  3578. ->where(['tid'=>38,'is_del'=>0])
  3579. ->select();
  3580. foreach ($list as $key=>$item){
  3581. //查询对应的有没有被删除 更新序列号记录
  3582. $one = Db::name('arctype')->where(['id'=>$item['aid']])->find();
  3583. $data = [
  3584. 'is_del' => $one['is_del'],
  3585. 'status' => $one['status'],
  3586. ];
  3587. $res = Db::name('seo_number')->where(['id'=>$item['id']])->update($data);
  3588. echo '文档ID: '.$item['id'].'-类型:'.$item['type'].'-'.$res.'<br/>';
  3589. }
  3590. }
  3591. /*
  3592. * https://www.zc10000.com/api/other/rtArticleIsdelProSon
  3593. */
  3594. public function rtArticleIsdelProSon(){
  3595. //针对 文章 论文 文档
  3596. $list = Db::name('seo_number')
  3597. ->where('type','=',1)
  3598. ->where('tid','<>',38)
  3599. ->where(['is_del'=>0])
  3600. ->select();
  3601. foreach ($list as $key=>$item){
  3602. //查询对应的有没有被删除 更新序列号记录
  3603. $one = Db::name('arctype_cat')->where(['id'=>$item['aid']])->find();
  3604. $data = [
  3605. 'is_del' => $one['is_del'],
  3606. 'status' => $one['status'],
  3607. ];
  3608. $res = Db::name('seo_number')->where(['id'=>$item['id']])->update($data);
  3609. echo '文档ID: '.$item['id'].'-类型:'.$item['type'].'-'.$res.'<br/>';
  3610. }
  3611. }
  3612. /*
  3613. * 删除没有内容的文章
  3614. * https://www.zc10000.com/api/other/delArticle
  3615. */
  3616. public function delArticle(){
  3617. //文章 论文 文档等
  3618. $list = Db::name('archives')->where('typeid','in',[115,126,825,826,126,127,111,117,118,120,122,131,132,133,306])->where(['is_del'=>0])->select();
  3619. foreach ($list as $key=>$item){
  3620. //查询对应的有没有被删除 更新序列号记录
  3621. $one = Db::name('zczygz_content')->where(['aid'=>$item['aid']])->find();
  3622. if(empty($one['content_5'])){
  3623. //删除文章
  3624. Db::name('archives')->where(['aid'=>$item['aid']])->update(['is_del'=>1]);
  3625. //序列号
  3626. $res = Db::name('seo_number')
  3627. ->where('type','in',[2,4,5])
  3628. ->where(['aid'=>$item['aid']])->update(['is_del'=>1]);
  3629. echo '文档ID: '.$item['aid'].'-'.$res.'<br/>';
  3630. }
  3631. }
  3632. }
  3633. /*
  3634. * 生成地图文件后 再次按域名 生成新的文件
  3635. * https://www.zc10000.com/api/other/urlMapHandle?type=xml
  3636. */
  3637. public function urlMapHandle(){
  3638. /*
  3639. * all_url 表 已经 更新地图文件的时候 写入链接状态
  3640. */
  3641. //读取数据库
  3642. $list = Db::name('all_url')->where('is_del','=',0)->order('group_id asc')->select();
  3643. $file = [];
  3644. foreach ($list as $key=>$item){
  3645. $url = explode('.',$item['url']);
  3646. $domain = str_replace('https://','',$url[0]);
  3647. $file[$domain][] = $item['url'];
  3648. }
  3649. //dump($file);
  3650. $type = request()->get('type','xml');
  3651. foreach ($file as $index => $row){
  3652. //创建文件
  3653. $this->jk($row,$index,$type);
  3654. }
  3655. }
  3656. public function jk($list,$name,$type){
  3657. switch ($type) {
  3658. case 'xml':
  3659. header('Content-type: text/xml');
  3660. $xmlWriter = new \XMLWriter();
  3661. $xmlWriter->openMemory();
  3662. $xmlWriter->startDocument('1.0', 'UTF-8');
  3663. $xmlWriter->startElement('urlset');
  3664. $xmlWriter->writeAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
  3665. $xmlWriter->writeAttribute('xmlns:mobile', 'http://www.google.com/schemas/sitemap-mobile/1.0');
  3666. break;
  3667. case 'txt':
  3668. $txt = '';
  3669. break;
  3670. case 'html':
  3671. $html = '
  3672. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3673. <html xmlns="http://www.w3.org/1999/xhtml">
  3674. <head>
  3675. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  3676. <title>职称网_网站地图</title>
  3677. </head>
  3678. <style>
  3679. * {
  3680. margin: 0px;
  3681. padding: 0px;
  3682. }
  3683. a {
  3684. color: grey;
  3685. text-decoration: none;
  3686. }
  3687. h1 a {
  3688. color: Black;
  3689. }
  3690. h1 {
  3691. font-size: 15px;
  3692. display: block;
  3693. width: 1200px;
  3694. margin: 0 auto;
  3695. border: 1px solid #eee;
  3696. padding: 10px;
  3697. color: Black;
  3698. }
  3699. h2 {
  3700. color: Black;
  3701. font-size: 16px;
  3702. margin-bottom: 10px;
  3703. }
  3704. a:hover {
  3705. color: Black;
  3706. text-decoration: underline;
  3707. }
  3708. .content {
  3709. width: 1200px;
  3710. border: 1px solid #eee;
  3711. margin: 0 auto;
  3712. padding: 10px;
  3713. margin-top: 10px;
  3714. color: #999;
  3715. overflow: hidden;
  3716. }
  3717. li {
  3718. text-indent: 20px;
  3719. list-style: disc;
  3720. }
  3721. .content li {
  3722. width: 285px;
  3723. text-indent: 5px;
  3724. float: left;
  3725. list-style: none;
  3726. height: 30px;
  3727. }
  3728. .content li a {
  3729. display: block;
  3730. height: 25px;
  3731. overflow: hidden;
  3732. }
  3733. </style>
  3734. <body>
  3735. <h1>
  3736. <a href="https://www.zc10000.com/">职称网</a>
  3737. </h1>
  3738. <div class="content">
  3739. <h2>分类</h2>
  3740. <ul>';
  3741. break;
  3742. default:
  3743. // 如果没有匹配的值
  3744. }
  3745. //写入文件
  3746. switch ($type) {
  3747. case 'xml':
  3748. foreach ($list as $k=>$value){
  3749. $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()));
  3750. }
  3751. break;
  3752. case 'txt':
  3753. foreach ($list as $k=>$value){
  3754. $txt .= $value."\r\n";
  3755. }
  3756. break;
  3757. case 'html':
  3758. foreach ($list as $k=>$value){
  3759. //$html .= '<li><a target="_blank" href="'.$value.'">'.$html_a[$k].'</a></li>';
  3760. }
  3761. $html .= "</ul></div>";
  3762. break;
  3763. default:
  3764. // 如果没有匹配的值
  3765. }
  3766. //创建目录
  3767. $dir = './sitemaps/'.$name;
  3768. if (!is_dir($dir)) {
  3769. mkdir($dir, 0777, true);
  3770. }
  3771. //创建文件
  3772. switch ($type) {
  3773. case 'xml':
  3774. // ... 添加其他页面的URL
  3775. $xmlWriter->endElement();
  3776. $xmlWriter->endDocument();
  3777. //var_dump($xmlWriter->outputMemory(true));
  3778. file_put_contents($dir.'/sitemap.xml', $xmlWriter->outputMemory(true));
  3779. break;
  3780. case 'txt':
  3781. file_put_contents($dir.'/sitemap.txt',$txt);
  3782. break;
  3783. case 'html':
  3784. $html .= '
  3785. <div class="content">
  3786. <h2>最新tags</h2>
  3787. <ul>
  3788. <!--<li><a target="_blank" href="https://www.zc10000.com/index.php?m=home&c=Tags&a=lists&tagid=69">建筑工程师</a></li>-->
  3789. </ul>
  3790. </div>
  3791. </body>
  3792. </html>';
  3793. file_put_contents($dir.'/sitemap.html',$html);
  3794. break;
  3795. default:
  3796. // 如果没有匹配的值
  3797. }
  3798. }
  3799. }