暫無描述
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 149KB

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