12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148 |
- <?php
- /**
- * 易优CMS
- * ============================================================================
- * 版权所有 2016-2028 海南赞赞网络科技有限公司,并保留所有权利。
- * 网站地址: http://www.eyoucms.com
- * ----------------------------------------------------------------------------
- * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷.
- * ============================================================================
- * Author: 小虎哥 <1105415366@qq.com>
- * Date: 2018-4-3
- */
-
- namespace app\api\controller;
- use \think\Db;
- use Overtrue\Pinyin\Pinyin;
-
- class Other extends Base
- {
- /*
- * 初始化操作
- */
-
- public function _initialize() {
- parent::_initialize();
- session('user'); // 哪里用到 session_id() , 哪个文件就加上这行代码
- }
-
- /**
- * 广告位js
- */
- public function other_show()
- {
- $pid = input('pid/d',1);
- $row = input('row/d',1);
- $where = array(
- 'pid'=>$pid,
- 'status'=>1,
- // 'start_time'=>array('lt', getTime()),
- );
- $ad = M("ad")->where($where)
- // ->where('end_time', ['>', getTime()], ['=', 0], 'or')
- ->order("sort_order asc")
- ->limit($row)
- ->cache(true,EYOUCMS_CACHE_TIME, 'ad') // 如果查询条件有时间字段,一定要去掉这行,避免产生一堆缓存文件
- ->select();
- foreach ($ad as &$value) {
- $value['intro'] = htmlspecialchars_decode($value['intro']);
- $value['intro'] = str_replace("\r\n", "", $value['intro']);
- $value['intro'] = str_replace("'", "\'", $value['intro']);
- }
- $this->assign('ad', $ad);
- return $this->fetch();
- }
-
- /*
- * 复制省级分类
- */
- public function index(){
-
- return false;
- $pro_list = Db::table('ey_citysite')->where([
- "level" => 1,
- "parent_id" => 0,
- "topid" => 0,
- "status" => 1,
- ])->select();
- //dump($pro_list);
-
- //循环省份
- //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
- /*foreach ($pro_list as $index=>$item){
- echo $item['id'].',';
- }*/
-
- //查询所有分类
- $cat_list = Db::table('ey_arctype')->where([
- 'topid'=>38,
- 'parent_id'=>38,
- 'type'=>'默认',
- 'status' => 1,
- 'is_del' => 0,
- 'area_id' => 1
- ])->select();
-
- $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';
- $pid = explode(',',$pid);
- //var_dump($pid);die;
-
- foreach ($pid as $index=>$item) {
- foreach ($cat_list as $key => $row) {
- //echo $row['id'].$row['typename'].'-';
- unset($row['id']);
- $row['area_id'] = $item;
- $row['dirname'] = $row['dirname'] . rand(1, 99999) . 'a' . rand(1, 99999);
- //插入表
- $res = Db::name('arctype')->insert($row);
- echo $res;
- }
- echo '<br>';
- }
- exit;
- }
-
- /*
- * 复制产品分类
- */
- public function index2(){
- return false;
- /*$pro_list = Db::table('ey_citysite')->where([
- "level" => 1,
- "parent_id" => 0,
- "topid" => 0,
- "status" => 1,
- ])->select();*/
- //dump($pro_list);
-
- //循环省份
- //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
- /*foreach ($pro_list as $index=>$item){
- echo $item['id'].',';
- }*/
-
- //$pid = '6872,6791,6645,6344,6303,6003,5879,5742,5625,5448,5290,5179,5056,4833,4813,4667';
- $pid = '4589,4474,4228,4042,4023,4003,6547,4359,4004,6990,7092,7144,7171';
- $pid = explode(',',$pid);
- //var_dump($pid);die;
- foreach ($pid as $in=>$id) {
- $area_id = $id;
-
- //查询某区域所有分类
- $cat_list = Db::table('ey_arctype')->where([
- 'topid' => 38,
- 'parent_id' => 38,
- 'type' => '默认',
- 'status' => 1,
- 'is_del' => 0,
- 'area_id' => $area_id
- ])->order('id asc')->select();
- //dump($cat_list);die;
-
- $i = 1;
- foreach ($cat_list as $index => $item) {
- //查询对应广东地区的哪个分类
- $cat = Db::table('ey_arctype')->where([
- 'topid' => 38,
- 'parent_id' => 38,
- 'type' => '默认',
- 'status' => 1,
- 'is_del' => 0,
- 'area_id' => 1,
- 'typename' => $item['typename']
- ])->find();
- //echo $cat['typename'];
- //查询广东地区对应所有产品
- $pro_list = Db::table('ey_arctype')->where([
- 'topid' => 38,
- 'parent_id' => $cat['id'],
- 'type' => '产品',
- 'status' => 1,
- 'is_del' => 0,
- 'area_id' => 1 //广东
- ])->select();
-
- foreach ($pro_list as $key => $row) {
- //echo $row['id'].$row['typename'].'-';
- unset($row['id']);
- $row['area_id'] = $area_id; //区域id
- $row['parent_id'] = (int)$item['id']; //更改上级id
- $row['dirname'] = $row['dirname'] . rand(1, 99999) . 'a' . rand(1, 99999);
- //插入表
- $res = Db::name('arctype')->insert($row);
- $i = $i + $res;
- echo $i;
- }
- echo '<br>';
- }
- }
- exit;
- }
-
- /*
- * 处理员网站
- * https://www.zc10000.com/api/other/index3?page=1
- */
- public function index3(){
- return false;
- $page = $_GET['page']?$_GET['page']:1;
- $pagesize = 50; //每次处理50条
- //查询文章
- $list = Db::table('ey_web_ur')
- ->where('to_tid','=',0)
- ->order('id asc')
- ->paginate($pagesize)->toArray();
- //dump($list);die;
- foreach($list['data'] as $index=>$row){
- //构建新数据
-
- //启动事务
- // 启动事务
- Db::startTrans();
- try {
- /*业务*/
- $run = 0;
- $one = Db::table('ey_archives_before')
- ->where(['aid'=>$row['aid']])->find();
- //dump($row);die;
- if(!empty($one)){
- unset($one['aid']);
- //1,2,4 对应 115/68,69,70,80,92 对应 111 / 8对应118 /其他对应 117
- $tid = (int)$one['typeid'];
- if($tid === 1 || $tid === 2 || $tid === 4){
- $typeid = 115;
- $url = '/zhengce/cms';
- }else if($tid === 68 || $tid === 69 || $tid === 70 || $tid === 80 || $tid === 92){
- $typeid = 111;
- $url = '/wthz';
- }else if($tid === 8){
- $typeid = 118;
- $url = '/zcsb';
- }else{
- $typeid = 117;
- $url = '/gonglve';
- }
- $one['typeid'] = $typeid;
- $one['channel'] = 103;
- //把one新插入栏目
- $new_aid = Db::name('archives')->insertGetId($one);
-
- //处理附表
- $two = Db::table('ey_article_content_b')
- ->where('aid','=',$row['aid'])
- ->find();
- if(!empty($two)){
- unset($two['id']);
- unset($two['aid']);
- $two['aid'] = $new_aid; //新的aid
- $two['content_5'] = $two['content'];
- $two['content_ey_m'] = $two['content_ey_m'];
- unset($two['content']);
- unset($two['content_ey_m']);
- $two['downname'] = $two['filename'];
- $two['down'] = $two['file'];
- unset($two['file']);
- unset($two['filename']);
- $res = Db::name('zczygz_content')->insertGetId($two);
- if($res > 0){
- //插入ey_web_ur
- $data = [
- 'to_tid' => $typeid,
- 'to_aid' => $new_aid,
- 'to_url' => $url.$new_aid,
- ];
- //var_dump($data);
- $res_c = Db::name('web_ur')
- ->where('id','=',$row['id'])->update($data);
- //var_dump($res_c);die;
- if($res_c === 0){
- //必须更新成功
- Db::rollback();
- $run = 1;
- }
- }else{
- //必须更新成功
- Db::rollback();
- $run = 1;
- }
- }else{
- //
- Db::rollback();
- $run = 1;
- }
- }
- if($run === 0){
- // 提交事务
- Db::commit();
- }
- } catch (\Exception $e) {
- // 回滚事务
- Db::rollback();
- }
- echo $row['id'];
- if($run === 0){
- echo "-ok";
- }else{
- echo "-fail";
- }
- echo '<br>';
- }
- }
-
- /*
- * 处理所有城市 有些省份 数据库没了 不管了
- * https://www.zc10000.com/api/other/index4
- */
- public function index4(){
- $list = Db::name('citysite')
- ->where(['level'=>1])
- ->order('id asc')
- ->select();
-
- //var_dump($list);
- foreach ($list as $index => $item){
- echo 'https://www.zc10000.com/api/other/index6?aid='.$item['id'].'<br/>';
- /*$one = Db::name('seo_number')->where([
- "type" => 3,
- "aid" => $item['id'],
- 'is_del' => 0,
- ])->find();
- if(!empty($one)) {
- if((int)$one['is_del'] === 0){
- $desc = '正常';
- }else{
- $desc = '原记录已删除';
- }
- echo $item['name'].'-已存在-'.$desc.'-序号为:'.$one['number'].'<br/>';
- }else{
- $data = [
- 'type' => 3,
- 'tid' => 0,
- 'aid' => $item['id'],
- 'number' => $index + 1,
- 'is_del' => 0,
- 'area_id' => 0,
- 'topid' => 0,
- 'parentid' => 0
- ];
- $res = Db::name('seo_number')->insert($data);
- echo $item['name'].'-新增成功'.$res.'<br/>';
- }*/
- }
- }
-
- /*
- * 处理产品大类 其实就是栏目 二级
- * 后台禁用掉 编辑时 重选区域 这样 会造成 排序混乱 对应的序列号不对
- * https://www.zc10000.com/api/other/index5
- * https://www.zc10000.com/id2
- */
- public function index5(){
- $list = Db::name('arctype')
- //'is_del'=>0
- ->where([
- 'topid'=>38,'parent_id'=>38,
- ])
- ->order('area_id asc,add_time asc') //按新增时间排序 按id asc 不准确
- ->select();
-
- //var_dump($list);
- $temp_id = 0;
- foreach ($list as $index => $item){
- //计算
- if($temp_id !== (int)$item['area_id']){
- $temp_id = (int)$item['area_id'];
- $num = 1; //重置为1
- echo "<hr/>";
- }
- /*echo '区域id:'.$item['area_id'].'-'.$item['typename'].'-序号:'.$num.'<br/>';
- $num++;*/
- echo '区域id:'.$item['area_id'].'-';
- $one = Db::name('seo_number')->where([
- "type" => 1, //产品类型
- "aid" => $item['id'], //实际的ID
- "tid" => $item['parent_id'], //属于哪个栏目的
- //'is_del' => 0,
- 'area_id' => $item['area_id'],
- 'topid' => $item['topid'],
- 'parentid' => $item['parent_id']
- ])->find();
- if(!empty($one)) {
- if((int)$one['number'] === $num){
- $desc = '-序列号正常';
- }else{
- $desc = '-<font style="color:red;">序列号不正常</font>';
- }
- if($item['is_del'] === 1){
- echo '<font style="color:blue;">序号:'.$num.'-'.$item['typename'].'-已存在序列表-原记录已删除-'.$desc.'</font><br/>';
- }else{
- echo '序号:'.$num.'-'.$item['typename'].'-已存在序列表-原记录正常'.$desc.'<br/>';
- }
- //不管是更新还是新增 存在记录就加1
- $num++;
- }else{
- //判断是否已删除,已删除不加入
- if((int)$item['is_del'] === 0){
- $data = [
- "type" => 1, //产品类型
- "aid" => $item['id'], //实际的ID
- "tid" => $item['parent_id'], //属于哪个栏目的
- 'is_del' => 0,
- 'area_id' => $item['area_id'],
- 'topid' => $item['topid'],
- 'parentid' => $item['parent_id'],
- 'number' => $num
- ];
- $res = Db::name('seo_number')->insert($data);
- echo '序号:'.$num.'-'.$item['typename'].'-不存在序列表且原记录正常,新增成功'.$res.'<br/>';
- //不管是更新还是新增 增加记录就加1
- $num++;
- }else{
- echo '<font style="color:green;">'.$item['typename'].'-不存在序列表且原记录已删除,不新增</font><br/>';
- }
- }
- }
- }
-
- /*
- * 处理产品三类id
- * 后台没有移动功能(以后也不能移动) 还好 只能在三级下面 进行 增加删除 不影响排序
- * 不过缺少 add_time 字段写入 需要修改原先的curd
- * https://www.zc10000.com/id2/sid1
- *
- * https://www.zc10000.com/api/other/index6?aid=1
- https://www.zc10000.com/api/other/index6?aid=30
- https://www.zc10000.com/api/other/index6?aid=4003
- https://www.zc10000.com/api/other/index6?aid=4004
- https://www.zc10000.com/api/other/index6?aid=4023
- https://www.zc10000.com/api/other/index6?aid=4042
- https://www.zc10000.com/api/other/index6?aid=4228
- https://www.zc10000.com/api/other/index6?aid=4359
- https://www.zc10000.com/api/other/index6?aid=4474
- https://www.zc10000.com/api/other/index6?aid=4589
- https://www.zc10000.com/api/other/index6?aid=4667
- https://www.zc10000.com/api/other/index6?aid=4813
- https://www.zc10000.com/api/other/index6?aid=4833
- https://www.zc10000.com/api/other/index6?aid=5056
- https://www.zc10000.com/api/other/index6?aid=5179
- https://www.zc10000.com/api/other/index6?aid=5290
- https://www.zc10000.com/api/other/index6?aid=5448
- https://www.zc10000.com/api/other/index6?aid=5625
- https://www.zc10000.com/api/other/index6?aid=5742
- https://www.zc10000.com/api/other/index6?aid=5879
- https://www.zc10000.com/api/other/index6?aid=6003
- https://www.zc10000.com/api/other/index6?aid=6303
- https://www.zc10000.com/api/other/index6?aid=6344
- https://www.zc10000.com/api/other/index6?aid=6547
- https://www.zc10000.com/api/other/index6?aid=6645
- https://www.zc10000.com/api/other/index6?aid=6791
- https://www.zc10000.com/api/other/index6?aid=6872
- https://www.zc10000.com/api/other/index6?aid=6990
- https://www.zc10000.com/api/other/index6?aid=7092
- https://www.zc10000.com/api/other/index6?aid=7144
- https://www.zc10000.com/api/other/index6?aid=7171
- */
-
- /*
- * 级别 不参与序列号 那是等级
- */
- public function index6(){
- $area_id = request()->get('aid',1);
- //按区域调用
- $catList = Db::name('arctype')
- //'is_del'=>0
- ->where([
- 'topid'=>38,'parent_id'=>38,'area_id'=> $area_id
- ])
- ->order('area_id asc,add_time asc') //按新增时间排序 按id asc 不准确
- ->select();
- //循环二级大类
- foreach ($catList as $key => $row) {
- //查询三级小类
- $list = Db::name('arctype_cat')->where([
- "parent_id" => $row['id'],
- "topid" => 38,
- //"is_del" => 0
- ])->select();
-
- //var_dump($list);
- $num = 1; //重置为1
- echo "<hr/>";
- foreach ($list as $index => $item){
- /*if((int)$item['is_del'] === 1){
- $desc = '<font style="color:red;">原文档记录已删除</font>';
- }else{
- $desc = '原文档记录正常';
- }
- echo '区域id:'.$row['area_id'].'-上级ID:'.$item['parent_id'].'-名称:'.$item['typename'].'-序号:'.$num.'-'.$desc.'<br/>';
- $num++;*/
- echo '区域id:'.$row['area_id'].'-';
- $one = Db::name('seo_number')->where([
- "type" => 1, //产品类型
- "aid" => $item['id'], //实际的ID
- "tid" => $item['parent_id'], //属于哪个栏目的
- //'is_del' => 0,
- //'area_id' => $row['area_id'], //没有这个条件
- 'topid' => $item['topid'],
- 'parentid' => $item['parent_id']
- ])->find();
- if(!empty($one)) {
- if((int)$one['number'] === $num){
- $desc = '-序列号正常';
- }else{
- $desc = '-<font style="color:red;">序列号不正常</font>';
- }
- if($item['is_del'] === 1){
- echo '<font style="color:blue;">序号:'.$num.'-'.'-上级ID:'.$item['parent_id'].'-名称:'.$item['typename'].'-已存在序列表-原记录已删除-'.$desc.'</font><br/>';
- }else{
- echo '序号:'.$num.'-'.'-上级ID:'.$item['parent_id'].'-名称:'.$item['typename'].'-已存在序列表-原记录正常'.$desc.'<br/>';
- }
- //不管是更新还是新增 存在记录就加1
- $num++;
- }else{
- //判断是否已删除,已删除不加入
- if((int)$item['is_del'] === 0){
- $data = [
- "type" => 1, //产品类型
- "aid" => $item['id'], //实际的ID
- "tid" => $item['parent_id'], //属于哪个栏目的 非38
- 'is_del' => 0,
- //'area_id' => $item['area_id'],
- 'topid' => $item['topid'], //还是38
- 'parentid' => $item['parent_id'],
- 'number' => $num
- ];
- $res = Db::name('seo_number')->insert($data);
- echo '序号:'.$num.'-'.'-上级ID:'.$item['parent_id'].'-名称:'.$item['typename'].'-不存在序列表且原记录正常,新增成功'.$res.'<br/>';
- //不管是更新还是新增 增加记录就加1
- $num++;
- }else{
- echo '<font style="color:green;">'.$item['typename'].'-不存在序列表且原记录已删除,不新增</font><br/>';
- }
- }
- }
- }
- }
-
- /*
- * 处理期刊 或者 是以后的其他文章栏目 都可以
- * 主要前提是 没有区域 只按发布时间排序就可以
- * https://www.zc10000.com/api/other/index7
- */
- public function index7(){
-
- //查询所有期刊
- $list = Db::name('archives')
- ->where('typeid','in',[116,123])
- ->order('add_time asc')
- ->select();
-
- //var_dump($list);
- $num = 1;
- foreach ($list as $index => $item){
- $one = Db::name('seo_number')->where([
- "type" => 4,
- "aid" => $item['aid'], //实际的文档aid
- //'is_del' => 0, //目前都是未删除
- ])->find();
- if(!empty($one)) {
- if((int)$one['number'] === $num){
- $ks = '序号正常';
- }else{
- $ks = '<font style="color:red;">序号不正常</font>';
- }
- if((int)$item['is_del'] === 0){
- $desc = '(原记录正常)';
- }else{
- $desc = '<font style="color:green;">(原记录已删除)</font>';
- }
- echo '文档ID:'.$item['aid'].'-'.$item['title'].'-已存在-'.$desc.'-序号为:'.$one['number'].'-'.$ks.'<br/>';
- $num++;
- }else{
- if((int)$item['is_del'] === 0){
- $data = [
- 'type' => 4,
- 'tid' => $item['typeid'],
- 'aid' => $item['aid'],
- 'number' => $num,
- 'is_del' => 0,
- //'area_id' => 0, //非栏目
- //'topid' => 0, //非栏目
- //'parentid' => 0 //非栏目
- ];
- $res = Db::name('seo_number')->insert($data);
- echo $item['title'].'-新增成功'.$res.'-序号为:'.$num.'<br/>';
- $num++;
- }else {
- echo '<font color="blue">文档ID:'.$item['aid'].'-'.$item['title'].'-原记录已删除-不新增-且不存在序号记录表</font><br/>';
- }
- }
- }
- }
-
- /*
- * 论文参考
- * https://www.zc10000.com/api/other/index8
- * 主要前提是 没有区域 只按发布时间排序就可以
- */
- public function index8(){
-
- //查询所有期刊 参考
- $list = Db::name('archives')
- ->where('typeid','in',[127,128])
- ->order('add_time asc')
- ->select();
-
- //var_dump($list);
- $num = 1;
- foreach ($list as $index => $item){
- $one = Db::name('seo_number')->where([
- "type" => 4,
- "aid" => $item['aid'], //实际的文档aid
- //'is_del' => 0, //目前都是未删除
- ])->find();
- if(!empty($one)) {
- if((int)$one['number'] === $num){
- $ks = '序号正常';
- }else{
- $ks = '<font style="color:red;">序号不正常</font>';
- }
- if((int)$item['is_del'] === 0){
- $desc = '(原记录正常)';
- }else{
- $desc = '<font style="color:green;">(原记录已删除)</font>';
- }
- echo '文档ID:'.$item['aid'].'-'.$item['title'].'-已存在-'.$desc.'-序号为:'.$one['number'].'-'.$ks.'<br/>';
- $num++;
- }else{
- if((int)$item['is_del'] === 0){
- $data = [
- 'type' => 4,
- 'tid' => $item['typeid'],
- 'aid' => $item['aid'],
- 'number' => $num,
- 'is_del' => 0,
- //'area_id' => 0, //非栏目
- //'topid' => 0, //非栏目
- //'parentid' => 0 //非栏目
- ];
- $res = Db::name('seo_number')->insert($data);
- echo $item['title'].'-新增成功'.$res.'-序号为:'.$num.'<br/>';
- $num++;
- }else {
- echo '<font color="blue">文档ID:'.$item['aid'].'-'.$item['title'].'-原记录已删除-不新增-且不存在序号记录表</font><br/>';
- }
- }
- }
- }
-
- /*
- * 标签
- * https://www.zc10000.com/api/other/index10000
- * 主要前提是 没有区域 只按发布时间排序就可以
- */
- public function index10000(){
-
- //查询所有期刊 参考
- $list = Db::name('archives')
- ->where('typeid','in',[371])
- ->order('add_time asc')
- ->select();
-
- //var_dump($list);
- $num = 1;
- foreach ($list as $index => $item){
- $one = Db::name('seo_number')->where([
- "type" => 10,
- "aid" => $item['aid'], //实际的文档aid
- //'is_del' => 0, //目前都是未删除
- ])->find();
- if(!empty($one)) {
- if((int)$one['number'] === $num){
- $ks = '序号正常';
- }else{
- $ks = '<font style="color:red;">序号不正常</font>';
- }
- if((int)$item['is_del'] === 0){
- $desc = '(原记录正常)';
- }else{
- $desc = '<font style="color:green;">(原记录已删除)</font>';
- }
- echo '文档ID:'.$item['aid'].'-'.$item['title'].'-已存在-'.$desc.'-序号为:'.$one['number'].'-'.$ks.'<br/>';
- $num++;
-
-
- //更新主记录
- Db::name('archives')
- ->where(['aid'=>$item['aid']])
- ->update(['number'=>(int)$one['number']]);
-
- }else{
- if((int)$item['is_del'] === 0){
- $data = [
- 'type' => 10,
- 'tid' => $item['typeid'],
- 'aid' => $item['aid'],
- 'number' => $num,
- 'is_del' => 0,
- //'area_id' => 0, //非栏目
- //'topid' => 0, //非栏目
- //'parentid' => 0 //非栏目
- ];
- $res = Db::name('seo_number')->insert($data);
- echo $item['title'].'-新增成功'.$res.'-序号为:'.$num.'<br/>';
-
-
- //更新主记录
- Db::name('archives')
- ->where(['aid'=>$item['aid']])
- ->update(['number'=>$num]);
-
- $num++;
-
- }else {
- echo '<font color="blue">文档ID:'.$item['aid'].'-'.$item['title'].'-原记录已删除-不新增-且不存在序号记录表</font><br/>';
- }
- }
- }
- }
-
- /*
- * 处理文档 注意有省级区分
- * 发布时候可以不选 区域
- * 但是编辑时,不能重选区域,会造成序号混乱
- * https://www.zc10000.com/api/other/index9?tid=126 政策指引
- * https://www.zc10000.com/api/other/index9?tid=825 政策文件
- * https://www.zc10000.com/api/other/index9?tid=826 参考文件
- */
- public function index9(){
-
- $tid = request()->get('tid',0);
- if((int)$tid === 0){
- echo "不存在文档栏目id";
- return false;
- }
- //查询所有指定 栏目id 的文档
- $list = Db::name('archives')
- ->where('typeid','=',$tid)
- ->order('province_id asc,add_time asc') //按照省份进行排序
- ->select();
-
- //var_dump($list);
- $temp_id = 0;
- foreach ($list as $index => $item){
-
- if((int)$item['province_id'] > 0) {
- if ($temp_id !== (int)$item['province_id']) {
- $temp_id = (int)$item['province_id'];
- $num = 1; //重置为1
- echo "<hr/>";
- }
- }else{
- //只输出一次
- if($index === 0){
- $num = 1; //重置为1
- echo "<hr/>";
- }
- }
-
- echo '区域ID:'.$item['province_id'].'-';
- $one = Db::name('seo_number')->where([
- "type" => 5,
- "aid" => $item['aid'], //实际的文档aid
- //'is_del' => 0, //目前都是未删除
- ])->find();
- if(!empty($one)) {
- if((int)$one['number'] === $num){
- $ks = '序号正常';
- }else{
- $ks = '<font style="color:red;">序号不正常</font>';
- }
- if((int)$item['is_del'] === 0){
- $desc = '(原记录正常)';
- }else{
- $desc = '<font style="color:green;">(原记录已删除)</font>';
- }
- echo '文档ID:'.$item['aid'].'-'.$item['title'].'-已存在-'.$desc.'-序号为:'.$one['number'].'-'.$ks.'<br/>';
- $num++;
- }else{
- if((int)$item['is_del'] === 0){
- $data = [
- 'type' => 5,
- 'tid' => $item['typeid'], //写入栏目id
- 'aid' => $item['aid'],
- 'number' => $num,
- 'is_del' => 0,
- 'area_id' => (int)$item['province_id'], //按区域
- //'topid' => 0, //非栏目
- //'parentid' => 0 //非栏目
- ];
- $res = Db::name('seo_number')->insert($data); //假设都会成功
- echo $item['title'].'-新增成功'.$res.'-序号为:'.$num.'<br/>';
- $num++;
- }else {
- echo '<font color="blue">文档ID:'.$item['aid'].'-'.$item['title'].'-原记录已删除-不新增-且不存在序号记录表</font><br/>';
- }
- }
- }
- }
-
-
- /*
- * 处理文章 复制期刊 修改type 大体一致 比如案例 常见问题
- * 如果有区域性的文章 又得特殊处理 比如评审攻略 -- 目前先忽略这些
- * 后续再说
- * https://www.zc10000.com/api/other/index10?tid=120 案例
- * https://www.zc10000.com/api/other/index10?tid=118 申报
- * https://www.zc10000.com/api/other/index10?tid=122 职称相关问题
- * https://www.zc10000.com/api/other/index10?tid=111 常见问题汇总 -- 已改为有区域
- * https://www.zc10000.com/api/other/index10?tid=133 历年真题题库
- * https://www.zc10000.com/api/other/index10?tid=132 答辩问题汇总
- * https://www.zc10000.com/api/other/index10?tid=131 防骗指南
- * https://www.zc10000.com/api/other/index10?tid=306 职称补贴
- * https://www.zc10000.com/api/other/index10?tid=1231 新增 新闻资讯
- * https://www.zc10000.com/api/other/index10?tid=1233 新增 业绩材料
- * https://www.zc10000.com/api/other/index10?tid=1234 新增 一键测评
- */
- public function index10(){
-
- $tid = request()->get('tid',0);
- if((int)$tid === 0){
- echo "不存在文档栏目id";
- exit;
- }
-
- $tids = ["120","118","122","111","133","132","131","306","1231","1233","1234"];
- if(!in_array($tid,$tids)){
- echo "不存在允许栏目内";
- exit;
- }
-
- //查询所有文档 包含已删除的
- $list = Db::name('archives')
- ->where('typeid','in',[$tid])
- ->order('add_time asc')
- ->select();
-
- //var_dump($list);
- $num = 1;
- foreach ($list as $index => $item){
- $one = Db::name('seo_number')->where([
- "type" => 2,
- "aid" => $item['aid'], //实际的文档aid
- //'is_del' => 0, //目前都是未删除
- ])->find();
-
- if(!empty($one)) {
-
- if((int)$one['number'] === $num){
- $ks = '序号正常';
- }else{
- $ks = '<font style="color:red;">序号不正常</font>';
- }
- if((int)$item['is_del'] === 0){
- $desc = '(原记录正常)';
- }else{
- $desc = '<font style="color:green;">(原记录已删除)</font>';
- }
- echo '文档ID:'.$item['aid'].'-'.$item['title'].'-已存在-'.$desc.'-序号为:'.$one['number'].'-'.$ks.'<br/>';
- $num++;
-
- }else{
- if((int)$item['is_del'] === 0){
- $data = [
- 'type' => 2,
- 'tid' => $item['typeid'], //文档本身的tid
- 'aid' => $item['aid'],
- 'number' => $num, //根据add_time 顺序
- 'is_del' => 0,
- //'area_id' => 0, //非栏目
- //'topid' => 0, //非栏目
- //'parentid' => 0 //非栏目
- ];
- $res = Db::name('seo_number')->insert($data);
- echo $item['title'].'-新增成功'.$res.'-序号为:'.$num.'<br/>';
- $num++;
- }else {
- echo '<font color="blue">文档ID:'.$item['aid'].'-'.$item['title'].'-原记录已删除-不新增-且不存在序号记录表</font><br/>';
- }
- }
- }
- }
-
- /*
- * area_tag_id
- * https://www.zc10000.com/api/other/index10_1?tid=1232 //评审政策
- */
-
- public function index10_1(){
-
- $tid = request()->get('tid',0);
- if((int)$tid === 0){
- echo "不存在文档栏目id";
- exit;
- }
-
- $tids = ["1232"];
- if(!in_array($tid,$tids)){
- echo "不存在允许栏目内";
- exit;
- }
-
- //查询所有指定 栏目id 的文档
- $list = Db::name('archives')
- ->where('typeid','=',$tid)
- //->where('area_tag_id','>',0)
- ->order('area_tag_id asc,add_time asc') //按照省份进行排序
- ->select();
-
- //var_dump($list);
- $temp_id = 0;
- $temp_id2 = 0;
- foreach ($list as $index => $item){
-
- if((int)$item['area_tag_id'] > 0 && (int)$item['city_id'] === 0) {
- //只属于省
- if ($temp_id !== (int)$item['area_tag_id']) {
- $temp_id = (int)$item['area_tag_id'];
- $num = 1; //重置为1
- echo "<hr/>";
- }
- }else if((int)$item['city_id'] > 0){
- if ($temp_id2 !== (int)$item['city_id']) {
- $temp_id2 = (int)$item['city_id'];
- $num = 1; //重置为1
- echo "<hr/>";
- }
- }else{
- //只输出一次
- if($index === 0){
- $num = 1; //重置为1
- echo "<hr/>";
- }
- }
-
- echo '区域省ID:'.$item['area_tag_id'].'-';
- if((int)$item['city_id'] > 0){
- echo '区域市ID:'.$item['city_id'].'-';
- }
-
- //测试排序
- //echo '文档ID:'.$item['aid'].'-序号为:'.$num.'<br/>';
- //$num++;
-
- $one = Db::name('seo_number')->where([
- "type" => 2, //文章
- "aid" => $item['aid'], //实际的文档aid 全站唯一的
- //'is_del' => 0, //目前都是未删除
- ])->find();
-
- if(!empty($one)) {
- if((int)$one['number'] === $num){
- $ks = '序号正常';
- }else{
- $ks = '<font style="color:red;">序号不正常</font>-'.$one['number'];
- }
- if((int)$item['is_del'] === 0){
- $desc = '(原记录正常)';
- }else{
- $desc = '<font style="color:green;">(原记录已删除)</font>';
- }
- echo '文档ID:'.$item['aid'].'-'.$item['title'].'-已存在-'.$desc.'-序号为:'.$one['number'].'-'.$ks.'<br/>';
- $num++;
- }else{
- if((int)$item['is_del'] === 0){
-
- if((int)$tid === 1232){
- //评审政策
- $area_id = (int)$item['area_tag_id'];
- $city_id = 0;
- }else{
- $area_id = (int)$item['province_id'];
- $city_id = (int)$item['city_id'];
- }
-
-
- $data = [
- 'type' => 2,
- 'tid' => $item['typeid'], //写入栏目id 攻略或者政策资讯
- 'aid' => $item['aid'], //实际文档id
- 'number' => $num,
- 'is_del' => 0,
- 'area_id' => $area_id, //按区域
- 'city_id' => $city_id, //按城市
- //'topid' => 0, //非栏目
- //'parentid' => 0 //非栏目
- ];
- $res = Db::name('seo_number')->insert($data); //假设都会成功
- echo $item['title'].'-新增成功'.$res.'-序号为:'.$num.'<br/>';
- $num++;
- }else {
- echo '<font color="blue">文档ID:'.$item['aid'].'-'.$item['title'].'-原记录已删除-不新增-且不存在序号记录表</font><br/>';
- }
- }
- }
-
- }
-
- /*
- * 评审攻略
- * https://www.zc10000.com/api/other/index11?tid=117 评审攻略
- * https://www.zc10000.com/api/other/index11?tid=115 政策资讯
- * https://www.zc10000.com/api/other/index11?tid=111 常见问题解答
- *
- * 后台编辑 禁用 区域重选
- */
- public function index11(){
-
- $tid = request()->get('tid',0);
- if((int)$tid === 0){
- echo "不存在文档栏目id";
- exit;
- }
-
- $tids = ["117","115","111"];
- if(!in_array($tid,$tids)){
- echo "不存在允许栏目内";
- exit;
- }
-
- //查询所有指定 栏目id 的文档
- $list = Db::name('archives')
- ->where('typeid','=',$tid)
- ->order('province_id asc,city_id asc,add_time asc') //按照省份进行排序
- ->select();
-
- //var_dump($list);
- $temp_id = 0;
- $temp_id2 = 0;
- foreach ($list as $index => $item){
-
- if((int)$item['province_id'] > 0 && (int)$item['city_id'] === 0) {
- //只属于省
- if ($temp_id !== (int)$item['province_id']) {
- $temp_id = (int)$item['province_id'];
- $num = 1; //重置为1
- echo "<hr/>";
- }
- }else if((int)$item['city_id'] > 0){
- if ($temp_id2 !== (int)$item['city_id']) {
- $temp_id2 = (int)$item['city_id'];
- $num = 1; //重置为1
- echo "<hr/>";
- }
- }else{
- //只输出一次
- if($index === 0){
- $num = 1; //重置为1
- echo "<hr/>";
- }
- }
-
- echo '区域省ID:'.$item['province_id'].'-';
- if((int)$item['city_id'] > 0){
- echo '区域市ID:'.$item['city_id'].'-';
- }
-
- //测试排序
- //echo '文档ID:'.$item['aid'].'-序号为:'.$num.'<br/>';
- //$num++;
-
- $one = Db::name('seo_number')->where([
- "type" => 2, //文章
- "aid" => $item['aid'], //实际的文档aid 全站唯一的
- //'is_del' => 0, //目前都是未删除
- ])->find();
-
- if(!empty($one)) {
- if((int)$one['number'] === $num){
- $ks = '序号正常';
- }else{
- $ks = '<font style="color:red;">序号不正常</font>-'.$one['number'];
- }
- if((int)$item['is_del'] === 0){
- $desc = '(原记录正常)';
- }else{
- $desc = '<font style="color:green;">(原记录已删除)</font>';
- }
- echo '文档ID:'.$item['aid'].'-'.$item['title'].'-已存在-'.$desc.'-序号为:'.$one['number'].'-'.$ks.'<br/>';
- $num++;
- }else{
- if((int)$item['is_del'] === 0){
-
- if((int)$tid === 1232){
- //评审政策
- $area_id = (int)$item['product_tag_id'];
- $city_id = 0;
- }else{
- $area_id = (int)$item['province_id'];
- $city_id = (int)$item['city_id'];
- }
-
-
- $data = [
- 'type' => 2,
- 'tid' => $item['typeid'], //写入栏目id 攻略或者政策资讯
- 'aid' => $item['aid'], //实际文档id
- 'number' => $num,
- 'is_del' => 0,
- 'area_id' => $area_id, //按区域
- 'city_id' => $city_id, //按城市
- //'topid' => 0, //非栏目
- //'parentid' => 0 //非栏目
- ];
- $res = Db::name('seo_number')->insert($data); //假设都会成功
- echo $item['title'].'-新增成功'.$res.'-序号为:'.$num.'<br/>';
- $num++;
- }else {
- echo '<font color="blue">文档ID:'.$item['aid'].'-'.$item['title'].'-原记录已删除-不新增-且不存在序号记录表</font><br/>';
- }
- }
- }
-
- }
-
- /*
- * 批量修改图片地址
- * https://www.zc10000.com/api/other/index89
- */
- public function index89(){
-
- $list = Db::name('ad')->select();
- foreach ($list as $index=>$item){
- if(!empty($item['litpic'])){
- if (strpos($item['litpic'], 'zc10000.com') !== false) {
- //包含
- } else {
- if (strpos($item['litpic'], '/uploads/') !== false) {
- //包含
- $item['litpic'] = 'https://oss.zc10000.com'.$item['litpic'];
- $res = Db::name('ad')->update($item);
- echo $res.'<br/>';
- }else{
-
- }
- }
- }
- }
- }
-
- public function index90(){
-
- $list = Db::name('archives')->select();
- foreach ($list as $index=>$item){
- if(!empty($item['litpic'])){
- if (strpos($item['litpic'], 'zc10000.com') !== false) {
- //包含
- } else {
- if (strpos($item['litpic'], '/uploads/') !== false) {
- //包含
- $item['litpic'] = 'https://oss.zc10000.com'.$item['litpic'];
- $res = Db::name('archives')->update($item);
- echo $res.'<br/>';
- }else{
-
- }
- }
- }
- }
- }
-
- public function index91(){
-
- $list = Db::name('arctype')->select();
- foreach ($list as $index=>$item){
- if(!empty($item['litpic'])){
- if (strpos($item['litpic'], 'zc10000.com') !== false) {
- //包含
- } else {
- if (strpos($item['litpic'], '/uploads/') !== false) {
- //包含
- $item['litpic'] = 'https://oss.zc10000.com'.$item['litpic'];
- $res = Db::name('arctype')->update($item);
- echo $res.'<br/>';
- }else{
-
- }
- }
- }
- }
- }
-
- public function index92(){
-
- $list = Db::name('links')->select();
- foreach ($list as $index=>$item){
- if(!empty($item['logo'])){
- if (strpos($item['logo'], 'zc10000.com') !== false) {
- //包含
- } else {
- if (strpos($item['logo'], '/uploads/') !== false) {
- //包含
- $item['logo'] = 'https://oss.zc10000.com'.$item['logo'];
- $res = Db::name('links')->update($item);
- echo $res.'<br/>';
- }else{
-
- }
- }
- }
- }
- }
-
- public function index93(){
-
- $list = Db::name('nav_list')->select();
- foreach ($list as $index=>$item){
- if(!empty($item['nav_pic'])){
- if (strpos($item['nav_pic'], 'zc10000.com') !== false) {
- //包含
- } else {
- if (strpos($item['nav_pic'], '/uploads/') !== false) {
- //包含
- $item['nav_pic'] = 'https://oss.zc10000.com'.$item['nav_pic'];
- $res = Db::name('nav_list')->update($item);
- echo $res.'<br/>';
- }else{
-
- }
- }
- }
- }
- }
-
- public function index94(){
-
- $list = Db::name('uploads')->select();
- foreach ($list as $index=>$item){
- if(!empty($item['image_url'])){
- if (strpos($item['image_url'], 'zc10000.com') !== false) {
- //包含
- } else {
- if (strpos($item['image_url'], '/uploads/') !== false) {
- //包含
- $item['image_url'] = 'https://oss.zc10000.com'.$item['image_url'];
- $res = Db::name('uploads')->update($item);
- echo $res.'<br/>';
- }else{
-
- }
- }
- }
- }
- }
-
- public function index95(){
-
- $list = Db::name('zczygz_content')->select();
- foreach ($list as $index=>$item){
- if(!empty($item['content_5'])){
- ////oss.zc10000.com/uploads/allimg/20240308/1-24030Q95602A4.jpg
- $newStr = str_replace("/uploads/", '//oss.zc10000.com/uploads/', $item['content_5']);
- $newStr = str_replace("//oss.zc10000.com//oss.zc10000.com/uploads/", '//oss.zc10000.com/uploads/', $newStr);
- $item['content_5'] = $newStr;
- $res = Db::name('zczygz_content')->update($item);
- echo $res.'<br/>';
- }
- }
- }
- public function index96(){
-
- $list = Db::name('zczygz_content')->select();
- foreach ($list as $index=>$item){
- if(!empty($item['down'])){
- if (strpos($item['down'], 'zc10000.com') !== false) {
- //包含
- } else {
- if (strpos($item['down'], '/uploads/') !== false) {
- //包含
- $item['down'] = 'https://oss.zc10000.com'.$item['down'];
- $res = Db::name('zczygz_content')->update($item);
- echo $res.'<br/>';
- }else{
-
- }
- }
- }
- }
- }
-
- /*
- * 生成百度地图
- * https://www.zc10000.com/api/other/index100?type=xml
- *
- */
- public function index100(){
-
- /* if (extension_loaded('xml')) {
- echo "xml extension is loaded";
- } else {
- echo "xml extension is not loaded";
- }*/
-
- /*// 创建XML根节点
- $xml = new SimpleXMLElement('<?xml version="1.0"?><root></root>');
-
- // 添加子节点
- $item = $xml->addChild('item');
- $item->addChild('id', 1);
- $item->addChild('name', 'Item Name');
- $item->addChild('price', '$99.99');
-
- // 保存XML到文件或输出
- $xml->asXML();
- // 输出到浏览器
- header('Content-Type: text/xml');
- echo $xml->asXML();
- // 保存到文件
- $xml->asXML('output.xml');*/
-
- //ini_set('memory_limit', '1024M'); //无用
- /*
- * 可对比系统的xml生成
- */
- $type = request()->get('type','xml');
- switch ($type) {
- case 'xml':
- header('Content-type: text/xml');
- $xmlWriter = new \XMLWriter();
- $xmlWriter->openMemory();
- $xmlWriter->startDocument('1.0', 'UTF-8');
- $xmlWriter->startElement('urlset');
- $xmlWriter->writeAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
- $xmlWriter->writeAttribute('xmlns:mobile', 'http://www.google.com/schemas/sitemap-mobile/1.0');
- break;
- case 'txt':
- $txt = '';
- break;
- case 'html':
- $html = '
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>职称网_网站地图</title>
- </head>
- <style>
- * {
- margin: 0px;
- padding: 0px;
- }
- a {
- color: grey;
- text-decoration: none;
- }
- h1 a {
- color: Black;
- }
- h1 {
- font-size: 15px;
- display: block;
- width: 1200px;
- margin: 0 auto;
- border: 1px solid #eee;
- padding: 10px;
- color: Black;
- }
- h2 {
- color: Black;
- font-size: 16px;
- margin-bottom: 10px;
- }
- a:hover {
- color: Black;
- text-decoration: underline;
- }
- .content {
- width: 1200px;
- border: 1px solid #eee;
- margin: 0 auto;
- padding: 10px;
- margin-top: 10px;
- color: #999;
- overflow: hidden;
- }
- li {
- text-indent: 20px;
- list-style: disc;
- }
- .content li {
- width: 285px;
- text-indent: 5px;
- float: left;
- list-style: none;
- height: 30px;
- }
- .content li a {
- display: block;
- height: 25px;
- overflow: hidden;
- }
- </style>
- <body>
- <h1>
- <a href="https://www.zc10000.com/">职称网</a>
- </h1>
-
- <div class="content">
- <h2>分类</h2>
- <ul>';
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 方法1 获取主页
- */
- $list = [
- 'https://www.zc10000.com', //省级主页 + 城市主页
- 'https://www.zc10000.com/zczl', //产品分页 + 产品详情
- 'https://www.zc10000.com/zclw',
- 'https://www.zc10000.com/zccl',
- 'https://www.zc10000.com/zlwd',
- 'https://www.zc10000.com/zcwj',
- 'https://www.zc10000.com/zcdb',
- 'https://www.zc10000.com/zhengce',
- 'https://www.zc10000.com/gonglve',
- 'https://www.zc10000.com/lwck',
- 'https://www.zc10000.com/wthz',
- 'https://www.zc10000.com/anli',
- 'https://www.zc10000.com/zcbt',
- 'https://zczl.zc10000.com',
- ];
- $html_a = ['职称网','职称工种','职称论文','职称材料','通用文件','政策指引','职称答辩','政策资讯','评审攻略','论文参考','常见问题','案例分析','职称补贴','快速评审'];
- $list = $this->unsetHandle($list,0,$type);
- switch ($type) {
- case 'xml':
- foreach ($list as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()));
- }
- break;
- case 'txt':
- foreach ($list as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- foreach ($list as $k=>$value){
- $html .= '<li><a target="_blank" href="'.$value.'">'.$html_a[$k].'</a></li>';
- }
- $html .= "</ul></div>";
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 省级主页
- */
- $list_1 = $this->getIndex();
- $list_1 = $this->unsetHandle($list_1,1,$type);
- //$list = array_merge($list,$list_1);
- switch ($type) {
- case 'xml':
- foreach ($list_1 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()));
- }
- break;
- case 'txt':
- foreach ($list_1 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- $html .= '<div class="content"><h2>省级站点</h2><ul>';
- //dump($list_1);die;
- foreach ($list_1 as $k=>$value){
- $value1 = explode('.',$value);
- $value2 = explode('//',$value1[0]);
- $name = Db::name('citysite')->where('domain','=',$value2[1])->value('name');
- if(empty($name)){
- if($value == 'https://www.zc10000.com/shandong'){
- $name = '山东';
- $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'站</a></li>';
- }
- }else{
- $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'站</a></li>';
- }
-
- }
- $html .= '</ul></div>';
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 城市主页
- */
- $list_2 = $this->getIndex2();
- //$list = array_merge($list,$list_2);
- $list_2 = $this->unsetHandle($list_2,2,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_2 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()));
- }
- break;
- case 'txt':
- foreach ($list_2 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 产品 无区域 主页 已有
- * 产品 无区域 分页
- */
- $list_3 = $this->getIndex3(); //产品分页
- //$list = array_merge($list,$list_3);
- $list_3 = $this->unsetHandle($list_3,3,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_3 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_3 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 产品按省级 主页
- */
- $list_4 = $this->getIndex4(); //产品分页
- //$list = array_merge($list,$list_4);
- $list_4 = $this->unsetHandle($list_4,4,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_4 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_4 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- $html .= '<div class="content"><h2>职称工种</h2><ul>';
- foreach ($list_4 as $k=>$value){
- $value1 = explode('zczl/jzzc',$value);
- $aid = Db::name('seo_number')->where('number','=',$value1[1])
- ->where('type','=',3)
- ->value('aid');
- $name = Db::name('citysite')->where('id','=',$aid)->value('name');
- if(empty($name)){
- $name = '山东';
- }
- $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'地区</a></li>';
- }
- $html .= '</ul></div>';
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 产品按省级 分页
- */
- $list_5 = $this->getIndex5(); //产品分页
- $list_5 = $this->unsetHandle($list_5,5,$type);
- //$list = array_merge($list,$list_5);
- switch ($type) {
- case 'xml':
- foreach ($list_5 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_5 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 产品url
- * 按照 /id /idh /id/sid /id/sidh
- */
- $list_6 = $this->getIndex6(); //产品分页
- $list_6 = $this->unsetHandle($list_6,6,$type);
- //$list = array_merge($list,$list_6);
- switch ($type) {
- case 'xml':
- foreach ($list_6 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_6 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
-
- /*
- * 论文主页 已有
- * 论文列表 - 分页
- */
- $list_7 = $this->getIndex7();
- $list_7 = $this->unsetHandle($list_7,7,$type);
- //$list = array_merge($list,$list_7);
- switch ($type) {
- case 'xml':
- foreach ($list_7 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_7 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
-
- /*
- * 论文详情
- */
- $list_8 = $this->getIndex8();
- $list_8 = $this->unsetHandle($list_8,8,$type);
- //$list = array_merge($list,$list_8);
- switch ($type) {
- case 'xml':
- foreach ($list_8 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_8 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
-
- /*
- * 主页在最上面
- * 职称材料 无区域 无标签 分页
- */
-
-
- /*
- * 职称材料 栏目1
- */
- $list_9 = $this->getIndex9("zccl",126,20);
- $list_9 = $this->unsetHandle($list_9,9,$type);
- //$list = array_merge($list,$list_9);
- switch ($type) {
- case 'xml':
- foreach ($list_9 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_9 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 职称材料 只有区域
- * 包含 区域主页 + 分页
- * 包含 伪区域主页 + 分页
- */
- $list_10 = $this->getIndex10("zccl",126,20);
- $list_10 = $this->unsetHandle($list_10,10,$type);
- //$list = array_merge($list,$list_10);
- switch ($type) {
- case 'xml':
- foreach ($list_10 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_10 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- $html .= '<div class="content"><h2>职称材料</h2><ul>';
- //dump($list_10);die;
- foreach ($list_10 as $k=>$value){
- $value = str_replace('---list_is_null)','',$value);
- $pos = strpos($value, '-');
- if ($pos !== false) {
-
- }else{
- $value1 = explode('.',$value);
- $value2 = explode('//',$value1[0]);
- //echo $value2;
- $name = Db::name('citysite')->where('domain','=',$value2[1])->value('name');
- if(empty($name)){
- $name = '山东';
- }
- $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'地区</a></li>';
- }
- }
- $html .= '</ul></div>';
- break;
- default:
- // 如果没有匹配的值
- }
- /*
- * 职称材料 只有标签
- * 包含 标签主页 + 分页
- */
- $list_11 = $this->getIndex11("zccl",126,20);
- $list_11 = $this->unsetHandle($list_11,11,$type);
- //$list = array_merge($list,$list_11);
- switch ($type) {
- case 'xml':
- foreach ($list_11 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_11 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- /*
- * 职称材料 同时有 区域+标签
- * 包含主页 + 分页
- */
- $list_12 = $this->getIndex12("zccl",126,20);
- $list_12 = $this->unsetHandle($list_12,12,$type);
- //$list = array_merge($list,$list_12);
- switch ($type) {
- case 'xml':
- foreach ($list_12 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_12 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 职称材料 栏目2
- */
- $list_9_1 = $this->getIndex9("zlwd",126,20);
- $list_9_1 = $this->unsetHandle($list_9_1,13,$type);
- //$list = array_merge($list,$list_9_1);
- switch ($type) {
- case 'xml':
- foreach ($list_9_1 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_9_1 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- $list_10_1 = $this->getIndex10("zlwd",126,20);
- $list_10_1 = $this->unsetHandle($list_10_1,14,$type);
- //$list = array_merge($list,$list_10_1);
- switch ($type) {
- case 'xml':
- foreach ($list_10_1 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_10_1 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- $list_11_1 = $this->getIndex11("zlwd",126,20);
- $list_11_1 = $this->unsetHandle($list_11_1,15,$type);
- //$list = array_merge($list,$list_11_1);
- switch ($type) {
- case 'xml':
- foreach ($list_11_1 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_11_1 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- $list_12_1 = $this->getIndex12("zlwd",126,20);
- $list_12_1 = $this->unsetHandle($list_12_1,16,$type);
- //$list = array_merge($list,$list_12_1);
- switch ($type) {
- case 'xml':
- foreach ($list_12_1 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_12_1 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 职称材料 栏目3
- */
- $list_9_2 = $this->getIndex9("zcwj",825,20);
- $list_9_2 = $this->unsetHandle($list_9_2,17,$type);
- //$list = array_merge($list,$list_9_2);
- switch ($type) {
- case 'xml':
- foreach ($list_9_2 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_9_2 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_10_2 = $this->getIndex10("zcwj",825,20);
- $list_10_2 = $this->unsetHandle($list_10_2,18,$type);
- //$list = array_merge($list,$list_10_2);
- switch ($type) {
- case 'xml':
- foreach ($list_10_2 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_10_2 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_11_2 = $this->getIndex11("zcwj",825,20);
- $list_11_2 = $this->unsetHandle($list_11_2,19,$type);
- //$list = array_merge($list,$list_11_2);
- switch ($type) {
- case 'xml':
- foreach ($list_11_2 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_11_2 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_12_2 = $this->getIndex12("zcwj",825,20);
- $list_12_2 = $this->unsetHandle($list_12_2,20,$type);
- //$list = array_merge($list,$list_12_2);
- switch ($type) {
- case 'xml':
- foreach ($list_12_2 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_12_2 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 补充伪区域 url 加入标签
- */
- $list_11_3 = $this->getIndex11("shandong_zccl",126,20);
- $list_11_3 = $this->unsetHandle($list_11_3,58,$type);
- //$list = array_merge($list,$list_11);
- switch ($type) {
- case 'xml':
- foreach ($list_11_3 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_11_3 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_11_4 = $this->getIndex11("shandong_zlwd",126,20);
- $list_11_4 = $this->unsetHandle($list_11_4,59,$type);
- //$list = array_merge($list,$list_11);
- switch ($type) {
- case 'xml':
- foreach ($list_11_4 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_11_4 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_11_5 = $this->getIndex11("shandong_zcwj",825,20);
- $list_11_5 = $this->unsetHandle($list_11_5,60,$type);
- //$list = array_merge($list,$list_11);
- switch ($type) {
- case 'xml':
- foreach ($list_11_5 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_11_5 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
-
- /*
- * 职称材料 详情页
- */
- $list_13 = $this->getIndex13('zlwd',126);
- $list_13 = $this->unsetHandle($list_13,21,$type);
- //$list = array_merge($list,$list_13);
- switch ($type) {
- case 'xml':
- foreach ($list_13 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_13 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_13_1 = $this->getIndex13('zcwj',825);
- $list_13_1 = $this->unsetHandle($list_13_1,22,$type);
- //$list = array_merge($list,$list_13_1);
- switch ($type) {
- case 'xml':
- foreach ($list_13_1 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_13_1 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 主页在最上面
- * 职称答辩 - 分页
- */
- $list_14 = $this->getIndex7("zcdb",132,12); //列表页
- $list_14 = $this->unsetHandle($list_14,23,$type);
- //$list = array_merge($list,$list_14);
- switch ($type) {
- case 'xml':
- foreach ($list_14 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_14 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_15 = $this->getIndex8("zcdb1",132,2); //职称答辩 - 详情页
- $list_15 = $this->unsetHandle($list_15,24,$type);
- //$list = array_merge($list,$list_15);
- switch ($type) {
- case 'xml':
- foreach ($list_15 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_15 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- *
- */
- $list_14_1 = $this->getIndex11_1("zcdb",132,12); //列表页
- $list_14_1 = $this->unsetHandle($list_14_1,49,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_14_1 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_14_1 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 调用政策资讯 主页 最上面
- *
- */
- $list_16_1 = $this->getIndex9("zhengce",115,12); //生成主站域名 分页
- //$list = array_merge($list,$list_16_1);
- $list_16_1 = $this->unsetHandle($list_16_1,25,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_1 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_16_1 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_16 = $this->getIndex15("zhengce"); //生成二级域名主页(这里 是 所有省级主页)
- //$list = array_merge($list,$list_16);
- $list_16 = $this->unsetHandle($list_16,26,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_16 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- $html .= '<div class="content"><h2>政策资讯</h2><ul>';
- foreach ($list_16 as $k=>$value){
- $pos = strpos($value, '-');
- if ($pos !== false) {
-
- }else{
- $value1 = explode('.',$value);
- $value2 = explode('//',$value1[0]);
- //echo $value2;
- $name = Db::name('citysite')->where('domain','=',$value2[1])->value('name');
- $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'地区</a></li>';
- }
- }
- $html .= '</ul></div>';
- break;
- default:
- // 如果没有匹配的值
- }
- $list_16_2 = $this->getIndex10("zhengce",115,12); //生成二级域名 分页
- //$list = array_merge($list,$list_16_2);
- $list_16_2 = $this->unsetHandle($list_16_2,27,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_2 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_16_2 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_16_4 = $this->getIndex16("zhengce"); //生成二级域名 城市二级目录 主页
- //$list = array_merge($list,$list_16_4);
- $list_16_4 = $this->unsetHandle($list_16_4,28,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_4 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_16_4 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_16_3 = $this->getIndex14("zhengce",115,12); //生成二级域名城市二级目录 分页
- //$list = array_merge($list,$list_16_3);
- $list_16_3 = $this->unsetHandle($list_16_3,29,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_3 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_16_3 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_16_5 = $this->getIndex17("zhengce/cms",115,2,0,0); //主站域名 详情
- //$list = array_merge($list,$list_16_5);
- $list_16_5 = $this->unsetHandle($list_16_5,30,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_5 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_16_5 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_16_6 = $this->getIndex18("zhengce/cms",115,2,0,0); //省站域名 详情
- //$list = array_merge($list,$list_16_6);
- $list_16_6 = $this->unsetHandle($list_16_6,31,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_6 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_16_6 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_16_7 = $this->getIndex19("zhengce/cms",115,2,0,0); //省站域名二级城市目录 详情
- //$list = array_merge($list,$list_16_7);
- $list_16_7 = $this->unsetHandle($list_16_7,32,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_7 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_16_7 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 政策资讯 标签 功能 无区域
- */
- $list_16_8 = $this->getIndex11_1("zhengce",115,12); //列表页
- $list_16_8 = $this->unsetHandle($list_16_8,50,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_8 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_16_8 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 政策资讯 标签 功能 加上区域
- */
- $list_16_9 = $this->getIndex12_1("zhengce",115,12); //列表页
- $list_16_9 = $this->unsetHandle($list_16_9,51,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_9 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_16_9 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 攻略主页 在最上面
- */
- $list_17_1 = $this->getIndex9("gonglve",117,12); //生成主站域名 分页
- //$list = array_merge($list,$list_17_1);
- $list_17_1 = $this->unsetHandle($list_17_1,33,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_17_1 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_17_1 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_17 = $this->getIndex15("gonglve"); //生成二级域名主页
- //$list = array_merge($list,$list_17);
- $list_17 = $this->unsetHandle($list_17,34,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_17 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_17 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- $html .= '<div class="content"><h2>评审攻略</h2><ul>';
- foreach ($list_17 as $k=>$value){
- $pos = strpos($value, '-');
- if ($pos !== false) {
-
- }else{
- $value1 = explode('.',$value);
- $value2 = explode('//',$value1[0]);
- //echo $value2;
- $name = Db::name('citysite')->where('domain','=',$value2[1])->value('name');
- $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'地区</a></li>';
- }
- }
- $html .= '</ul></div>';
- break;
- default:
- // 如果没有匹配的值
- }
- $list_17_2 = $this->getIndex10("gonglve",117,12); //生成二级域名 分页
- //$list = array_merge($list,$list_17_2);
- $list_17_2 = $this->unsetHandle($list_17_2,35,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_17_2 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_17_2 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_17_4 = $this->getIndex16("gonglve"); //生成二级域名 城市二级目录 主页
- //$list = array_merge($list,$list_17_4);
- $list_17_4 = $this->unsetHandle($list_17_4,36,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_17_4 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_17_4 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_17_3 =$this->getIndex14("gonglve",117,12); //生成二级域名城市二级目录 分页
- //$list = array_merge($list,$list_17_3);
- $list_17_3 = $this->unsetHandle($list_17_3,37,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_17_3 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_17_3 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_17_5 = $this->getIndex17("gonglve1-",117,2,0,0); //主站域名 详情
- //$list = array_merge($list,$list_17_5);
- $list_17_5 = $this->unsetHandle($list_17_5,38,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_17_5 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_17_5 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_17_6 = $this->getIndex18("gonglve1-",117,2,0,0); //省站域名 详情
- //$list = array_merge($list,$list_17_6);
- $list_17_6 = $this->unsetHandle($list_17_6,39,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_17_6 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_17_6 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_17_7 = $this->getIndex19("gonglve1-",117,2,0,0); //省站域名 城市二级目录 详情
- //$list = array_merge($list,$list_17_7);
- $list_17_7 = $this->unsetHandle($list_17_7,40,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_17_7 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_17_7 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 评审攻略 标签 功能 无区域
- */
- $list_17_8 = $this->getIndex11_1("gonglve",117,12); //列表页
- $list_17_8 = $this->unsetHandle($list_17_8,52,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_17_8 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_17_8 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 政策资讯 标签 功能 加上区域
- */
- $list_17_9 = $this->getIndex12_1("gonglve",117,12); //列表页
- $list_17_9 = $this->unsetHandle($list_17_9,53,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_17_9 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_17_9 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
-
- /*
- * 主页在最上面
- * 论文参考 分页
- */
- $list_18 = $this->getIndex7("lwck",127,12); //列表页
- //$list = array_merge($list,$list_18);
- $list_18 = $this->unsetHandle($list_18,41,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_18 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_18 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_18_1 = $this->getIndex8("lwck/cankao",127,2); //论文参考 详情页
- //$list = array_merge($list,$list_18_1);
- $list_18_1 = $this->unsetHandle($list_18_1,42,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_18_1 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_18_1 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 论文参考 标签 功能 无区域
- */
- $list_18_2 = $this->getIndex11_1("lwck",127,12); //列表页
- $list_18_2 = $this->unsetHandle($list_18_2,54,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_18_2 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_18_2 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 主页在最上面
- * 常见问题 - 分页
- */
- $list_19 = $this->getIndex7("wthz",111,12); //列表页
- //$list = array_merge($list,$list_19);
- $list_19 = $this->unsetHandle($list_19,43,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_19 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_19 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- //$list_19_1 = $this->getIndex8("wthz",111,2); //常见问题 - 详情页 添加区域后 改为方法getIndex17
- $list_19_1 = $this->getIndex17("wthz",111,2,0,0); //主站域名 详情
- //$list = array_merge($list,$list_19_1);
- $list_19_1 = $this->unsetHandle($list_19_1,44,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_19_1 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_19_1 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 文章新增 区域 增加部分
- * !+++++++++++++++++++++++++++++++++++++++++
- */
- $list_16_a = $this->getIndex15("wthz"); //生成二级域名主页(这里 是 所有省级主页)
- //$list = array_merge($list,$list_16);
- $list_16_a = $this->unsetHandle($list_16_a,61,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_a as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_16_a as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- $html .= '<div class="content"><h2>常见问题</h2><ul>';
- foreach ($list_16_a as $k=>$value){
- $pos = strpos($value, '-');
- if ($pos !== false) {
-
- }else{
- $value1 = explode('.',$value);
- $value2 = explode('//',$value1[0]);
- //echo $value2;
- $name = Db::name('citysite')->where('domain','=',$value2[1])->value('name');
- $html .= '<li><a target="_blank" href="'.$value.'">'.$name.'地区</a></li>';
- }
- }
- $html .= '</ul></div>';
- break;
- default:
- // 如果没有匹配的值
- }
- $list_16_2_a = $this->getIndex10("wthz",111,12); //生成二级域名 分页
- //$list = array_merge($list,$list_16_2);
- $list_16_2_a = $this->unsetHandle($list_16_2_a,62,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_2_a as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_16_2_a as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_16_4_a = $this->getIndex16("wthz"); //生成二级域名 城市二级目录 主页
- //$list = array_merge($list,$list_16_4);
- $list_16_4_a = $this->unsetHandle($list_16_4_a,63,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_4_a as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_16_4_a as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_16_3_a = $this->getIndex14("wthz",111,12); //生成二级域名城市二级目录 分页
- //$list = array_merge($list,$list_16_3);
- $list_16_3_a = $this->unsetHandle($list_16_3_a,64,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_3_a as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_16_3_a as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_16_6_a = $this->getIndex18("wthz",111,2,0,0); //省站域名 详情
- //$list = array_merge($list,$list_16_6);
- $list_16_6_a = $this->unsetHandle($list_16_6_a,65,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_6_a as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_16_6_a as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_16_7_a = $this->getIndex19("wthz",111,2,0,0); //省站域名二级城市目录 详情
- //$list = array_merge($list,$list_16_7);
- $list_16_7_a = $this->unsetHandle($list_16_7_a,66,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_7_a as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_16_7_a as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
-
- /*
- * 常见问题 标签 功能 无区域
- */
- $list_19_2 = $this->getIndex11_1("wthz",111,12); //列表页
- $list_19_2 = $this->unsetHandle($list_19_2,55,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_19_2 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_19_2 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /**
- * 文章类型 常见问题 标签功能 增加 区域
- */
- /*
- * 政策资讯 标签 功能 加上区域
- */
- $list_16_9_a = $this->getIndex12_1("wthz",111,12); //列表页
- $list_16_9_a = $this->unsetHandle($list_16_9_a,67,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_16_9_a as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_16_9_a as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
-
- /*
- * 主页在最上面
- * 案例 - 分页
- */
- $list_20 = $this->getIndex7("anli",120,12); //列表页
- //$list = array_merge($list,$list_20);
- $list_20 = $this->unsetHandle($list_20,45,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_20 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_20 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_20_1 = $this->getIndex8("anli",120,2); //案例 - 详情页
- //$list = array_merge($list,$list_20_1);
- $list_20_1 = $this->unsetHandle($list_20_1,46,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_20_1 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_20_1 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- /*
- * 案例 标签 功能 无区域
- */
- $list_20_2 = $this->getIndex11_1("anli",120,12); //列表页
- $list_20_2 = $this->unsetHandle($list_20_2,56,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_20_2 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_20_2 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
- /*
- * 主页 在最上面
- * 职称补贴 - 分页
- */
- $list_21 = $this->getIndex7("zcbt",306,12); //列表页
- //$list = array_merge($list,$list_21);
- $list_21 = $this->unsetHandle($list_21,47,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_21 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_21 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- $list_21_1 = $this->getIndex8("zcbt",306,2); //职称补贴 - 详情页
- //$list = array_merge($list,$list_21_1);
- $list_21_1 = $this->unsetHandle($list_21_1,48,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_21_1 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.8');
- }
- break;
- case 'txt':
- foreach ($list_21_1 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
- /*
- * 职称补贴 标签 功能 无区域
- */
- $list_21_2 = $this->getIndex11_1("zcbt",306,12); //列表页
- $list_21_2 = $this->unsetHandle($list_21_2,57,$type);
- switch ($type) {
- case 'xml':
- foreach ($list_21_2 as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()),'hourly','0.9');
- }
- break;
- case 'txt':
- foreach ($list_21_2 as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- break;
- default:
- // 如果没有匹配的值
- }
-
-
- /*echo "<pre>";
- var_dump($list);
- echo "</pre>";*/
-
-
- switch ($type) {
- case 'xml':
- // ... 添加其他页面的URL
- $xmlWriter->endElement();
- $xmlWriter->endDocument();
- //var_dump($xmlWriter->outputMemory(true));
- file_put_contents('./sitemaps/sitemap.xml', $xmlWriter->outputMemory(true));
- break;
- case 'txt':
- file_put_contents('./sitemaps/sitemap.txt',$txt);
- break;
- case 'html':
-
- $html .= '
- <div class="content">
- <h2>最新tags</h2>
- <ul>
- <!--<li><a target="_blank" href="https://www.zc10000.com/index.php?m=home&c=Tags&a=lists&tagid=69">建筑工程师</a></li>-->
- </ul>
- </div>
-
- </body>
- </html>';
-
- //./sitemaps/sitemap.html
- file_put_contents('./sitemap.html',$html);
- break;
- default:
- // 如果没有匹配的值
- }
-
- }
- public function getIndex()
- {
- $list = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- $url = [];
-
-
- $list[] = [
- 'id' => 10000,
- 'domain' => 'www'
- ];
-
- foreach ($list as $index=>$row){
- $url[] = 'https://'.$row['domain'].'.zc10000.com';
- }
- $url[] = 'https://www.zc10000.com/shandong';
- return $url;
- }
- public function getIndex2()
- {
- $list = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- $url = [];
-
- $list[] = [
- 'id' => 10000,
- 'domain' => 'www'
- ];
-
- foreach ($list as $index=>$row){
-
- if((int)$row['id'] === 10000){
- $collect = Db::name('citysite')->where(['parent_id'=>5290])->select();
- foreach ($collect as $key=>$item){
- $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$item['domain'];
- }
- }else{
- $collect = Db::name('citysite')->where(['parent_id'=>$row['id']])->select();
- foreach ($collect as $key=>$item){
- $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$item['domain'];
- }
- }
-
- }
- return $url;
- }
-
- public function getIndex3()
- {
- $list = Db::name('arctype')->where(['parent_id'=>38,'status'=>1,'is_del'=>0])->count();
- $page = ceil($list/12);
- $url = [];
- for ($i=2;$i<=$page;$i++){
- $url[] = 'https://www.zc10000.com/zczl-'.$i;
- }
- return $url;
- }
-
- public function getIndex4()
- {
- $list = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- $url = [];
-
- $list[] = [
- 'id' => 10000
- ];
- foreach ($list as $index=>$row){
- if((int)$row['id'] === 10000){
- $number = 32;
- }else{
- //查找序列号
- $number = Db::name('seo_number')->where(['type'=>3,'aid'=>$row['id'],'is_del'=>0])->value('number');
- }
- $url[] = 'https://www.zc10000.com/zczl/jzzc'.$number;
- }
- return $url;
- }
-
- public function getIndex5()
- {
- $list = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- $url = [];
-
- $list[] = [
- 'id' => 10000
- ];
- foreach ($list as $index=>$row){
- //查找序列号
- if((int)$row['id'] === 10000){
- $number = 32;
- }else{
- $number = Db::name('seo_number')->where(['type'=>3,'aid'=>$row['id'],'is_del'=>0])->value('number');
- }
- //查找分页
- $list2 = Db::name('arctype')->where(['parent_id'=>38,'status'=>1,'is_del'=>0,'area_id'=>$row['id']])->count();
- if((int)$list2 === 0){
- $list2 = 1; //假设有一条数据
- }
- $page = ceil($list2/12);
- for ($i=2;$i<=$page;$i++){
- $url[] = 'https://www.zc10000.com/zczl/jzzc'.$number.'-'.$i;
- }
- }
- return $url;
- }
- public function getIndex6()
- {
- $list = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- $url = [];
- $list[] = [
- 'id' => 10000,
- 'domain' => 'www',
- ];
- foreach ($list as $index=>$row){
- //查找序列号
- $list_1 = Db::name('seo_number')->where(['type'=>1,'area_id'=>$row['id'],'is_del'=>0,'parentid'=>38])->select();
- foreach ($list_1 as $key=>$item) {
-
- //判断是否已删除 栏目只有删除 与 未删除
- $op = Db::name('arctype')->where(['id'=>$item['aid']])->find();
- if((int)$op['is_del'] === 1){
- $url[] = 'https://' . $row['domain'] . '.zc10000.com/id' . $item['number'].'---ID:'.$item['aid'].'(is_del)';
- }else{
- $url[] = 'https://' . $row['domain'] . '.zc10000.com/id' . $item['number'];
- }
-
- if((int)$op['is_del'] === 0) {
- //查询有多少级别
- $level_group_id = Db::name('archives')->where(['typeid' => $item['aid'], 'product_id' => 0])->value('level_group_id');
- //echo $level_group_id.'<br/>';
-
- $level_count = 0;
- if ((int)$level_group_id > 0) {
- ///只调用存在的链接
- $level_count = Db::name('archives')->where(['typeid' => $level_group_id, 'is_del' => 0, 'arcrank' => 0, 'status' => 1])->count();
- }
- for ($i = 1; $i < $level_count; $i++) {
- //去掉主页
- $url[] = 'https://' . $row['domain'] . '.zc10000.com/id' . $item['number'] . 'h' . $i;
- }
-
- //查询子类
- $list_2 = Db::name('seo_number')->where(['type' => 1, 'is_del' => 0, 'parentid' => $item['aid']])->select();
- foreach ($list_2 as $key2 => $item2) {
-
- //判断是否已删除
- $op2 = Db::name('arctype_cat')->where(['id' => $item2['aid']])->find();
- if ((int)$op2['is_del'] === 1) {
- $url[] = 'https://' . $row['domain'] . '.zc10000.com/id' . $item['number'] . '/sid' . $item2['number'] . '---ID:' . $item2['aid'] . '(is_del)';
- } else {
- $url[] = 'https://' . $row['domain'] . '.zc10000.com/id' . $item['number'] . '/sid' . $item2['number'];
- }
-
- if ((int)$op2['is_del'] === 0) {
- //查询子类级别
- $level_group_id2 = Db::name('archives')->where(['typeid' => $item['aid'], 'product_id' => $item2['aid']])->value('level_group_id');
- $level_count2 = 0;
- if ((int)$level_group_id2 > 0) {
- //只调用存在的链接
- $level_count2 = Db::name('archives')->where(['typeid' => $level_group_id2, 'is_del' => 0, 'arcrank' => 0, 'status' => 1])->count();
- }
- for ($i2 = 1; $i2 < $level_count2; $i2++) {
- //去掉主页
- $url[] = 'https://' . $row['domain'] . '.zc10000.com/id' . $item['number'] . '/sid' . $item2['number'] . 'h' . $i2;
- }
- }
- }
- }
- }
- }
- return $url;
- }
-
- public function getIndex7($str="zclw",$typeid=116,$pasize=25)
- {
- $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0])->count();
-
- $desc = '';
- if((int)$list === 0){
- $list = 1; //假设有一条数据
- $desc = '---(list_is_null)';
- }
-
- $page = ceil($list/$pasize);
- $url = [];
- for ($i=2;$i<=$page;$i++){
- $url[] = 'https://www.zc10000.com/'.$str.'-'.$i.$desc;
- }
- return $url;
- }
- public function getIndex8($str="zclw/lunwen",$typeid=116,$ty=4)
- {
- $list_1 = Db::name('seo_number')->where(['type'=>$ty,'tid'=>$typeid,'is_del'=>0])->select();
- foreach ($list_1 as $key=>$item) {
- //判断文档是否已删除
- $op = Db::name('archives')->where(['aid'=>$item['aid']])->find();
- $desc = '';
- if((int)$op['is_del'] === 1){
- $desc .= '---ID: '.$item['aid']."(is_del)";
- }
- if((int)$op['arcrank'] === 1){
- $desc .= '---ID: '.$item['aid']."(is_arcrank)";
- }
- if((int)$op['status'] === 0){
- $desc .= '---ID: '.$item['aid']."(is_status)";
- }
- $url[] = 'https://www.zc10000.com/'.$str.$item['number'].$desc;
- }
- return $url;
- }
-
- /*
- * 职称材料
- */
- public function getIndex9($str="zccl",$typeid=126,$pasize=20)
- {
- $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0])->count();
-
- $desc = '';
- if((int)$list === 0){
- $list = 1; //假设有一条数据
- $desc = '---list-is_null)';
- }
-
- $page = ceil($list/$pasize);
- $url = [];
- for ($i=2;$i<=$page;$i++){
- $url[] = 'https://www.zc10000.com/'.$str.'-'.$i.$desc;
- }
- return $url;
- }
- /*
- * 职称材料 加入区域
- */
- public function getIndex10($str="zccl",$typeid=126,$pasize=20)
- {
- $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- $url = [];
-
- //https://www.zc10000.com/shandong_zccl
- $area[] = [
- 'id' => 10000,
- 'domain' => 'www'
- ];
- foreach ($area as $index=>$row){
- //seo_number 并没有这个字段 arcrank 假设没有 先不管了
- $is_www = 0;
- if((int)$row['id'] === 10000 && (int)$pasize === 20){
- //伪区域内容 (职称材料调用)
- $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'area_tag_id'=>$row['id']])->count();
- $str = 'shandong_'.$str;
- $is_www = 1;
- }else{
- $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'province_id'=>$row['id']])->count();
- }
-
- $desc = '';
- if((int)$list === 0){
- $list = 1; //假设有一条数据
- $desc = '---list_is_null)';
- }
-
- $page = ceil($list/$pasize);
- for ($i=1;$i<=$page;$i++){
- if($i === 1 && $str === 'zccl' || $i === 1 && $str === 'zlwd' || $i === 1 && $str === 'zcwj' || $i === 1 && $is_www === 1){
- $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$str.$desc;
- }else{
- if($i > 1) {
- $url[] = 'https://' . $row['domain'] . '.zc10000.com/' . $str . '-' . $i.$desc;
- }
- }
- }
- }
- return $url;
- }
-
- /*
- * 加入 标签
- */
- public function getIndex11($str="zccl",$typeid=126,$pasize=20)
- {
- $tagList = Db::name('archives')->where(['typeid'=>58,'status'=>1,'is_del'=>0])->select();
- $url = [];
- foreach ($tagList as $index=>$row){
- //seo_number 并没有这个字段 arcrank 假设没有 先不管了
- $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'product_tag_id'=>$row['aid']])->count();
-
- $desc = '';
- if((int)$list === 0){
- $list = 1; //假设有一条数据
- $desc = '---list_is_null)';
- }
- $page = ceil($list/$pasize);
- for ($i=1;$i<=$page;$i++){
- 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'){
- $url[] = 'https://www.zc10000.com/'.$str.'/tag'.$row['aid'].$desc;
- }else{
- if($i > 1) {
- $url[] = 'https://www.zc10000.com/' . $str . '/tag' . $row['aid'] . '-' . $i.$desc;
- }
- }
-
- }
- }
- return $url;
- }
-
- /*
- * 加入区域和标签
- */
- public function getIndex12($str="zccl",$typeid=126,$pasize=20)
- {
- $tagList = Db::name('archives')->where(['typeid'=>58,'status'=>1,'is_del'=>0])->select();
- $url = [];
- foreach ($tagList as $index=>$row){
- $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- foreach ($area as $key=>$item){
- //seo_number 并没有这个字段 arcrank 假设没有 先不管了
- $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'province_id'=>$item['id'],'product_tag_id'=>$row['aid']])->count();
-
- $desc = '';
- if((int)$list === 0){
- $list = 1; //假设有一条数据
- $desc = '---list_is_null)';
- }
- $page = ceil($list/$pasize);
- for ($i=1;$i<=$page;$i++){
- if($i === 1 && $str === 'zccl' || $i === 1 && $str === 'zlwd' || $i === 1 && $str === 'zcwj'){
- $url[] = 'https://'.$item['domain'].'.zc10000.com/'.$str.'/tag'.$row['aid'].$desc;
- }else{
- if($i > 1) {
- $url[] = 'https://' . $item['domain'] . '.zc10000.com/' . $str . '/tag' . $row['aid'] . '-' . $i.$desc;
- }
- }
- }
- }
- }
- return $url;
- }
-
- public function getIndex13($str='zlwd',$tid='126')
- {
- $list = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- $url = [];
-
- $list[] = [
- 'id' => 0,
- 'domain' => 'www'
- ];
-
- foreach ($list as $index=>$row){
- //查找序列号
- $data = Db::name('seo_number')->where(['type'=>5,'area_id'=>$row['id'],'is_del'=>0,'tid'=>$tid])->select();
- foreach ($data as $key=>$item){
-
- //判断文档是否已删除
- $op = Db::name('archives')->where(['aid'=>$item['aid']])->find();
- $desc = '';
- if((int)$op['is_del'] === 1){
- $desc .= '---ID: '.$item['aid']."(is_del)";
- }
- if((int)$op['arcrank'] === 1){
- $desc .= '---ID: '.$item['aid']."(is_arcrank)";
- }
- if((int)$op['status'] === 0){
- $desc .= '---ID: '.$item['aid']."(is_status)";
- }
-
- if((int)$row['id'] === 0){
- $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$str.'/cms'.$item['number'].$desc;
- }else{
- $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$str.'/cms'.$item['number'].$desc;
- }
-
- }
- }
- return $url;
- }
-
- public function getIndex14($str="zhengce",$typeid=115,$pasize=10)
- {
- $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- $url = [];
- foreach ($area as $index=>$row){
- $collect = Db::name('citysite')->where(['parent_id'=>$row['id']])->select();
- foreach ($collect as $key=>$item){
- //seo_number 并没有这个字段 arcrank 假设没有 先不管了
- $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'city_id'=>$item['id']])->count();
-
- $desc = '';
- if((int)$list === 0){
- $list = 1; //假设有一条数据
- $desc = '---list_is_null)';
- }
- $page = ceil($list/$pasize);
- for ($i=2;$i<=$page;$i++){
- $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$item['domain'].'/'.$str.'-'.$i.$desc;
- }
- }
- }
- return $url;
- }
-
- public function getIndex15($str="zhengce")
- {
- $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- $url = [];
- foreach ($area as $index=>$row){
- $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$str;
- }
- return $url;
- }
-
- public function getIndex16($str="zhengce")
- {
- $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- $url = [];
- foreach ($area as $index=>$row){
- $collect = Db::name('citysite')->where(['parent_id'=>$row['id']])->select();
- foreach ($collect as $key=>$item){
- $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$item['domain'].'/'.$str;
- }
- }
- return $url;
- }
-
- public function getIndex17($str="zhengce/cms",$typeid=115,$ty=2,$area_id=0,$city_id=0)
- {
- $list_1 = Db::name('seo_number')->where(['type'=>$ty,'tid'=>$typeid,'is_del'=>0,"area_id"=>$area_id,"city_id"=>$city_id])->select();
- foreach ($list_1 as $key=>$item) {
- //判断文档是否已删除
- $op = Db::name('archives')->where(['aid'=>$item['aid']])->find();
- $desc = '';
- if((int)$op['is_del'] === 1){
- $desc .= '---ID: '.$item['aid']."(is_del)";
- }
- if((int)$op['arcrank'] === 1){
- $desc .= '---ID: '.$item['aid']."(is_arcrank)";
- }
- if((int)$op['status'] === 0){
- $desc .= '---ID: '.$item['aid']."(is_status)";
- }
- $url[] = 'https://www.zc10000.com/'.$str.$item['number'].$desc;
- }
- return $url;
- }
-
- public function getIndex18($str="zhengce/cms",$typeid=115,$ty=2,$area_id=0,$city_id=0)
- {
- $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- $url = [];
- foreach ($area as $index=>$row){
- $list_1 = Db::name('seo_number')->where(['type'=>$ty,'tid'=>$typeid,'is_del'=>0,"area_id"=>$row['id'],"city_id"=>$city_id])->select();
- foreach ($list_1 as $key=>$item) {
- //判断文档是否已删除
- $op = Db::name('archives')->where(['aid'=>$item['aid']])->find();
- $desc = '';
- if((int)$op['is_del'] === 1){
- $desc .= '---ID: '.$item['aid']."(is_del)";
- }
- if((int)$op['arcrank'] === 1){
- $desc .= '---ID: '.$item['aid']."(is_arcrank)";
- }
- if((int)$op['status'] === 0){
- $desc .= '---ID: '.$item['aid']."(is_status)";
- }
- $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$str.$item['number'].$desc;
- }
- }
- return $url;
- }
-
- public function getIndex19($str="zhengce/cms",$typeid=115,$ty=2,$area_id=0,$city_id=0)
- {
- $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- $url = [];
- foreach ($area as $index=>$row){
- $collect = Db::name('citysite')->where(['parent_id'=>$row['id']])->select();
- foreach ($collect as $key=>$item){
- $list_1 = Db::name('seo_number')->where(['type'=>$ty,'tid'=>$typeid,'is_del'=>0,"area_id"=>$row['id'],"city_id"=>$item['id']])->select();
- foreach ($list_1 as $key2=>$item2) {
- //判断文档是否已删除
- $op = Db::name('archives')->where(['aid'=>$item2['aid']])->find();
- $desc = '';
- if((int)$op['is_del'] === 1){
- $desc .= '---ID: '.$item2['aid']."(is_del)";
- }
- if((int)$op['arcrank'] === 1){
- $desc .= '---ID: '.$item2['aid']."(is_arcrank)";
- }
- if((int)$op['status'] === 0){
- $desc .= '---ID: '.$item2['aid']."(is_status)";
- }
- $url[] = 'https://'.$row['domain'].'.zc10000.com/'.$item['domain'].'/'.$str.$item2['number'].$desc;
- }
- }
- }
- return $url;
- }
-
- public function buildXml($xmlWriter,$value,$time,$mod="hourly",$level="1.0")
- {
- /*
- * 循环 start
- */
- // 添加你网站的URL
- $xmlWriter->startElement('url');
- $xmlWriter->writeElement('loc', $value);
- $xmlWriter->writeElement('lastmod', $time);
- $xmlWriter->writeElement('changefreq', $mod);
- //always hourly daily weekly monthly yearly never
- $xmlWriter->writeElement('priority', $level); //优先级 0.0到1.0之间
-
- $xmlWriter->startElement('mobile:mobile');
- $xmlWriter->writeAttribute('type', 'htmladapt');
- //<mobile:mobile type="pc,mobile"/>
- //<mobile:mobile/> :移动网页
- //<mobile:mobile type="mobile"/> :移动网页
- //<mobile:mobile type="htmladapt"/>:代码适配
- $xmlWriter->endElement();
- $xmlWriter->endElement();
- /*
- * 循环 end
- */
- return $xmlWriter;
- }
- public function unsetHandle($list=[],$group_id=0,$type='xml'){
- if($type == 'txt') {
- $temp = [];
- foreach ($list as $k => $value) {
- $data = [];
- $update_data = [];
- if (strpos($value, 'is_del') !== false) {
- $data['is_del'] = 1;
- $update_data['is_del'] = 1;
- } else {
- $data['is_del'] = 0;
- $update_data['is_del'] = 0;
- }
- if (strpos($value, 'is_arcrank') !== false) {
- $data['is_arcrank'] = 1;
- $update_data['is_arcrank'] = 1;
- } else {
- $data['is_arcrank'] = 0;
- $update_data['is_arcrank'] = 0;
- }
-
- if (strpos($value, 'is_status') !== false) {
- $data['is_status'] = 1;
- $update_data['is_status'] = 1;
- } else {
- $data['is_status'] = 0;
- $update_data['is_status'] = 0;
- }
- if (strpos($value, 'list_is_null') !== false) {
- $data['is_null'] = 1;
- $update_data['is_null'] = 1;
- //列表页为空 也要加入地图
- $new_url = explode('---', $value);
- $new_url = $new_url[0];
- $temp[] = $new_url;
- } else {
- $data['is_null'] = 0;
- $update_data['is_null'] = 0;
- }
-
- if (strpos($value, '---') !== false) {
- $new_url = explode('---', $value);
- $new_url = $new_url[0];
- } else {
- $new_url = $value;
- //其他url加入地图
- $temp[] = $value;
- }
- $one = Db::name('all_url')->where(['url' => $new_url])->find();
- if (empty($one)) {
- $data['group_id'] = $group_id;
- $data['url'] = $new_url;
- $data['update_time'] = time();
- $data['add_time'] = time();
- Db::name('all_url')->insert($data);
- } else {
- $update_data['update_time'] = time();
- $update_data['group_id'] = $group_id;
- Db::name('all_url')->where(['url' => $new_url])->update($update_data);
- }
- }
- return $temp;
- }else{
- return $list;
- }
- }
-
- public function catIndex()
- {
-
- $data = [
- '获取主页和专题页',
- '省级主页',
- '城市主页',
- '产品 无区域 分页',
- '产品按省级 主页',
- '产品按省级 分页',
- '产品url',
- '论文列表 - 分页',
- '论文详情',
- '职称材料 zccl 无区域 无标签 分页',
- '职称材料 zccl 只有区域 包含 区域主页 + 分页',
- '职称材料 zccl 只有标签 包含 标签主页 + 分页',
- '职称材料 zccl 同时有 区域+标签 包含主页 + 分页',
- '职称材料 zlwd 无区域 无标签 分页',
- '职称材料 zlwd 只有区域 包含 区域主页 + 分页',
- '职称材料 zlwd 只有标签 包含 标签主页 + 分页',
- '职称材料 zlwd 同时有 区域+标签 包含主页 + 分页',
- '职称材料 zcwj 无区域 无标签 分页',
- '职称材料 zcwj 只有区域 包含 区域主页 + 分页',
- '职称材料 zcwj 只有标签 包含 标签主页 + 分页',
- '职称材料 zcwj 同时有 区域+标签 包含主页 + 分页',
- '职称材料 详情页 zlwd',
- '职称材料 详情页 zcwj',
- '职称答辩 - 分页',
- '职称答辩 - 分页',
- '政策资讯生成主站域名 分页',
- '政策资讯生成二级域名主页',
- '政策资讯生成二级域名 分页',
- '政策资讯生成二级域名 城市二级目录 主页',
- '政策资讯生成二级域名城市二级目录 分页',
- '政策资讯主站域名 详情',
- '政策资讯省站域名 详情',
- '政策资讯省站域名 城市二级目录 详情',
- '评审攻略生成主站域名 分页',
- '评审攻略生成二级域名主页',
- '评审攻略生成二级域名 分页',
- '评审攻略生成二级域名 城市二级目录 主页',
- '评审攻略生成二级域名城市二级目录 分页',
- '评审攻略主站域名 详情',
- '评审攻略省站域名 详情',
- '评审攻略省站域名 城市二级目录 详情',
- '论文参考 分页',
- '论文参考 详情页',
- '常见问题 - 分页',
- '常见问题 - 详情页',
- '案例 - 分页',
- '案例 - 详情页',
- '职称补贴 - 分页',
- '职称补贴 - 详情页',
- '职称答辩 标签 功能', //49
- '政策资讯 标签 功能 无区域', //50
- '政策资讯 标签 功能 加上区域',
- '评审攻略 标签 功能 无区域', //52
- '评审攻略 标签 功能 加上区域',
- '论文参考 标签 功能 无区域',
- '常见问题 标签 功能 无区域',
- '案例 标签 功能 无区域',
- '职称补贴 标签 功能 无区域',
- '伪山东 - 职称材料',
- '伪山东 - 通用文件',
- '伪山东 - 政策指引', //60
- '常见问题生成二级域名主页', //61
- '常见问题生成二级域名 分页', //62
- '常见问题生成二级域名 城市二级目录 主页',
- '常见问题生成二级域名城市二级目录 分页',
- '常见问题省站域名 详情', //65
- '常见问题省站域名 城市二级目录 详情',
- '常见问题 标签 功能 加上区域', //67
- ];
- foreach ($data as $key => $row){
- $insert['gid'] = $key;
- $insert['name'] = $row;
- $one = Db::name('all_name')->where('gid','=',$key)->find();
- if(!empty($one)){
- Db::name('all_name')->where('gid','=',$key)->update($insert);
- }else{
- Db::name('all_name')->insert($insert);
- }
- }
-
- /*
- * 查询sql
- *
- */
- $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
- WHEN a.is_del = 0 THEN ''
- ELSE '文档已删除'
- END AS 是否删除,CASE
- WHEN a.is_null = 0 THEN ''
- ELSE '列表数据为空'
- END AS 列表是否为空,CASE
- WHEN a.is_arcrank = 0 THEN ''
- ELSE '文档审核中'
- END AS 文档是否审核,CASE
- WHEN a.is_status = 0 THEN ''
- ELSE '屏蔽中'
- END AS 正常或者屏蔽 from ey_all_url a order by a.group_id asc";
-
- }
-
- /*
- * 文章 加入 标签
- */
- public function getIndex11_1($str="wthz",$typeid=111,$pasize=12)
- {
-
- //根据tid 查询
- $cat = Db::name('arctype')->where(['parent_id'=>369,'article_id'=>$typeid])->find();
- if(empty($cat)){
- $cat_id = 371;
- }else{
- $cat_id = $cat['id'];
- }
-
- //加入区域 只调用主站的标签
- $tagList = Db::name('archives')->where([
- 'typeid'=>$cat_id,'status'=>1,'is_del'=>0,
- 'province_id' => 0
- ])->select();
-
- $url = [];
- foreach ($tagList as $index=>$row){
-
- //seo_number 并没有这个字段 arcrank 假设没有 先不管了
- //主站是没有区域 加入区域0
- $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'product_tag_id'=>$row['aid'],'province_id' => 0])->count();
-
- $desc = '';
- if((int)$list === 0){
- $list = 1; //假设有一条数据
- $desc = '---list_is_null)';
- }
- $page = ceil($list/$pasize);
- for ($i=1;$i<=$page;$i++){
- if($i === 1){
- $url[] = 'https://www.zc10000.com/'.$str.'/tag'.$row['aid'].$desc;
- }else{
- $url[] = 'https://www.zc10000.com/' . $str . '/tag' . $row['aid'] . '-' . $i.$desc;
- }
- }
- }
- return $url;
- }
-
- /*
- * 文章 加入区域和标签
- */
- public function getIndex12_1($str="wthz",$typeid=111,$pasize=12)
- {
- //根据tid 查询
- $cat = Db::name('arctype')->where(['parent_id'=>369,'article_id'=>$typeid])->find();
- if(empty($cat)){
- $cat_id = 371;
- }else{
- $cat_id = $cat['id'];
- }
- /*
- * 原先是一个标签拥有多个省份
- * 现在改为 每个省 对应 有哪些标签
- */
-
- $url = [];
- $area = Db::name('citysite')->where(['is_open'=>1,'status'=>1,'level'=>1])->select();
- foreach ($area as $key=>$item){
-
- $tagList = Db::name('archives')->where([
- 'typeid'=>$cat_id,'status'=>1,'is_del'=>0,
- 'province_id' => $item['id']
- ])->select();
-
- foreach ($tagList as $index=>$row){
- //seo_number 并没有这个字段 arcrank 假设没有 先不管了
- $list = Db::name('archives')->where(['typeid'=>$typeid,'status'=>1,'is_del'=>0,'arcrank'=>0,'province_id'=>$item['id'],'product_tag_id'=>$row['aid']])->count();
-
- $desc = '';
- if((int)$list === 0){
- $list = 1; //假设有一条数据
- $desc = '---list_is_null)';
- }
- $page = ceil($list/$pasize);
- for ($i=1;$i<=$page;$i++){
- if($i === 1){
- $url[] = 'https://'.$item['domain'].'.zc10000.com/'.$str.'/tag'.$row['aid'].$desc;
- }else{
- $url[] = 'https://' . $item['domain'] . '.zc10000.com/' . $str . '/tag' . $row['aid'] . '-' . $i.$desc;
- }
- }
-
- //查询城市
- $collect = Db::name('citysite')->where(['parent_id'=>$item['id']])->select();
- foreach ($collect as $key2=>$item2){
-
- //查询
- $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();
-
- $desc = '';
- if((int)$list === 0){
- $list = 1; //假设有一条数据
- $desc = '---list_is_null)';
- }
- $page = ceil($list/$pasize);
- for ($i=1;$i<=$page;$i++){
- if($i === 1){
- $url[] = 'https://'.$item['domain'].'.zc10000.com/'.$item2['domain'].'/'.$str.'/tag'.$row['aid'].$desc;
- }else{
- $url[] = 'https://' . $item['domain'] . '.zc10000.com/'.$item2['domain'].'/' . $str . '/tag' . $row['aid'] . '-' . $i.$desc;
- }
- }
- }
- }
- }
- return $url;
- }
-
- /*
- * 按字母输出所有城市
- * https://www.zc10000.com/api/other/getAllCity
- */
- public function getAllCity(){
- $list = Db::name('region')->where(['level'=>2])->order('initial asc,parent_id asc')
- //->limit(2)
- ->select();
- //dump($list);
- //'北京|beijing|bj'
- $data = [];
- $pinyin = new Pinyin();
- //dump($pinyin);
- foreach ($list as $key=>$row){
- $chinese = str_replace('市','',$row['name']);
- $a = $pinyin->convert($chinese);
- $str = '';
- foreach ($a as $index => $item){
- $str = $str.$item;
- }
- $b = $pinyin->abbr($chinese);
- $h = $row['name'].'|'.$str.'|'.$b;
- $data[] = $h;
- echo '\''.$h.'\',';
- }
- }
-
- /*
- * 校验文章和序列号记录 状态
- * aid是唯一的 就不需要 分类查询了
- * 以后按定时任务 分页处理
- * https://www.zc10000.com/api/other/rtArticleIsdel
- */
- public function rtArticleIsdel(){
-
- //针对 文章 论文 文档
- $list = Db::name('seo_number')
- ->where('type',in,[2,4,5])
- ->where(['is_del'=>0])
- ->select();
-
- foreach ($list as $key=>$item){
- //查询对应的有没有被删除 更新序列号记录
- $one = Db::name('archives')->where(['aid'=>$item['aid']])->find();
- $data = [
- 'is_del' => (int)$one['is_del'],
- 'is_kan' => (int)$one['arcrank'], // 0正常 1审核
- 'status' => (int)$one['status'],
- ];
- $res = Db::name('seo_number')->where(['id'=>$item['id']])->update($data);
- echo '文档ID: '.$item['id'].'-类型:'.$item['type'].'-'.$res.'<br/>';
- }
- }
-
-
- /*
- * https://www.zc10000.com/api/other/rtArticleIsdelCount
- */
- public function rtArticleIsdelCount(){
-
- //针对 文章 论文 文档
- $list = Db::name('seo_number')
- ->where('type',in,[2,4,5])
- ->where(['is_del'=>1])
- ->select();
-
- foreach ($list as $key=>$item){
- //查询对应的有没有被删除 更新序列号记录
- $one = Db::name('archives')->where(['aid'=>$item['aid']])->find();
- echo '文档ID: '.$item['id'].'-类型:'.$item['type'].'-已删除:'.$one['is_del'].'<br/>';
- }
- }
-
- /*
- * 处理产品
- * https://www.zc10000.com/api/other/rtArticleIsdelPro
- */
- public function rtArticleIsdelPro(){
-
- //针对 文章 论文 文档
- $list = Db::name('seo_number')
- ->where('type','=',1)
- ->where(['tid'=>38,'is_del'=>0])
- ->select();
-
- foreach ($list as $key=>$item){
- //查询对应的有没有被删除 更新序列号记录
- $one = Db::name('arctype')->where(['id'=>$item['aid']])->find();
- $data = [
- 'is_del' => $one['is_del'],
- 'status' => $one['status'],
- ];
- $res = Db::name('seo_number')->where(['id'=>$item['id']])->update($data);
- echo '文档ID: '.$item['id'].'-类型:'.$item['type'].'-'.$res.'<br/>';
- }
- }
-
- /*
- * https://www.zc10000.com/api/other/rtArticleIsdelProSon
- */
- public function rtArticleIsdelProSon(){
-
- //针对 文章 论文 文档
- $list = Db::name('seo_number')
- ->where('type','=',1)
- ->where('tid','<>',38)
- ->where(['is_del'=>0])
- ->select();
-
- foreach ($list as $key=>$item){
- //查询对应的有没有被删除 更新序列号记录
- $one = Db::name('arctype_cat')->where(['id'=>$item['aid']])->find();
- $data = [
- 'is_del' => $one['is_del'],
- 'status' => $one['status'],
- ];
- $res = Db::name('seo_number')->where(['id'=>$item['id']])->update($data);
- echo '文档ID: '.$item['id'].'-类型:'.$item['type'].'-'.$res.'<br/>';
- }
- }
-
- /*
- * 删除没有内容的文章
- * https://www.zc10000.com/api/other/delArticle
- */
- public function delArticle(){
-
- //文章 论文 文档等
- $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();
-
- foreach ($list as $key=>$item){
- //查询对应的有没有被删除 更新序列号记录
- $one = Db::name('zczygz_content')->where(['aid'=>$item['aid']])->find();
- if(empty($one['content_5'])){
- //删除文章
- Db::name('archives')->where(['aid'=>$item['aid']])->update(['is_del'=>1]);
-
- //序列号
- $res = Db::name('seo_number')
- ->where('type','in',[2,4,5])
- ->where(['aid'=>$item['aid']])->update(['is_del'=>1]);
-
- echo '文档ID: '.$item['aid'].'-'.$res.'<br/>';
- }
- }
-
- }
-
- /*
- * 生成地图文件后 再次按域名 生成新的文件
- * https://www.zc10000.com/api/other/urlMapHandle?type=xml
- */
- public function urlMapHandle(){
-
- /*
- * all_url 表 已经 更新地图文件的时候 写入链接状态
- */
- //读取数据库
- $list = Db::name('all_url')->where('is_del','=',0)->order('group_id asc')->select();
- $file = [];
- foreach ($list as $key=>$item){
- $url = explode('.',$item['url']);
- $domain = str_replace('https://','',$url[0]);
- $file[$domain][] = $item['url'];
- }
-
- //dump($file);
- $type = request()->get('type','xml');
- foreach ($file as $index => $row){
- //创建文件
- $this->jk($row,$index,$type);
- }
-
- }
-
- public function jk($list,$name,$type){
- switch ($type) {
- case 'xml':
- header('Content-type: text/xml');
- $xmlWriter = new \XMLWriter();
- $xmlWriter->openMemory();
- $xmlWriter->startDocument('1.0', 'UTF-8');
- $xmlWriter->startElement('urlset');
- $xmlWriter->writeAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
- $xmlWriter->writeAttribute('xmlns:mobile', 'http://www.google.com/schemas/sitemap-mobile/1.0');
- break;
- case 'txt':
- $txt = '';
- break;
- case 'html':
- $html = '
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>职称网_网站地图</title>
- </head>
- <style>
- * {
- margin: 0px;
- padding: 0px;
- }
- a {
- color: grey;
- text-decoration: none;
- }
- h1 a {
- color: Black;
- }
- h1 {
- font-size: 15px;
- display: block;
- width: 1200px;
- margin: 0 auto;
- border: 1px solid #eee;
- padding: 10px;
- color: Black;
- }
- h2 {
- color: Black;
- font-size: 16px;
- margin-bottom: 10px;
- }
- a:hover {
- color: Black;
- text-decoration: underline;
- }
- .content {
- width: 1200px;
- border: 1px solid #eee;
- margin: 0 auto;
- padding: 10px;
- margin-top: 10px;
- color: #999;
- overflow: hidden;
- }
- li {
- text-indent: 20px;
- list-style: disc;
- }
- .content li {
- width: 285px;
- text-indent: 5px;
- float: left;
- list-style: none;
- height: 30px;
- }
- .content li a {
- display: block;
- height: 25px;
- overflow: hidden;
- }
- </style>
- <body>
- <h1>
- <a href="https://www.zc10000.com/">职称网</a>
- </h1>
-
- <div class="content">
- <h2>分类</h2>
- <ul>';
- break;
- default:
- // 如果没有匹配的值
- }
- //写入文件
- switch ($type) {
- case 'xml':
- foreach ($list as $k=>$value){
- $xmlWriter = $this->buildXml($xmlWriter,$value,date('Y-m-d',time()));
- }
- break;
- case 'txt':
- foreach ($list as $k=>$value){
- $txt .= $value."\r\n";
- }
- break;
- case 'html':
- foreach ($list as $k=>$value){
- //$html .= '<li><a target="_blank" href="'.$value.'">'.$html_a[$k].'</a></li>';
- }
- $html .= "</ul></div>";
- break;
- default:
- // 如果没有匹配的值
- }
-
- //创建目录
- $dir = './sitemaps/'.$name;
- if (!is_dir($dir)) {
- mkdir($dir, 0777, true);
- }
- //创建文件
- switch ($type) {
- case 'xml':
- // ... 添加其他页面的URL
- $xmlWriter->endElement();
- $xmlWriter->endDocument();
- //var_dump($xmlWriter->outputMemory(true));
- file_put_contents($dir.'/sitemap.xml', $xmlWriter->outputMemory(true));
- break;
- case 'txt':
- file_put_contents($dir.'/sitemap.txt',$txt);
- break;
- case 'html':
-
- $html .= '
- <div class="content">
- <h2>最新tags</h2>
- <ul>
- <!--<li><a target="_blank" href="https://www.zc10000.com/index.php?m=home&c=Tags&a=lists&tagid=69">建筑工程师</a></li>-->
- </ul>
- </div>
-
- </body>
- </html>';
-
- file_put_contents($dir.'/sitemap.html',$html);
- break;
- default:
- // 如果没有匹配的值
- }
- }
-
- /*
- * https://www.zc10000.com/api/other/iop
- */
- public function iop()
- {
- $list = Db::name('zczygz_content')
- //->where(['typeid'=>1232])
- ->select();
- foreach ($list as $key=>$item){
-
- if(!empty($item['down'])){
- $file = explode('.',$item['down']);
- $ext = end($file);
-
- Db::name('archives')
- ->where(['aid'=>$item['aid']])
- ->update(['ext'=>$ext]);
- }
- }
- }
- }
|