Nenhuma descrição
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

zccat-detail.htm 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <?php
  2. //技术员、助理、中级、高级、正高级
  3. if(!empty($route_param['pa'])){
  4. /*if((int)$route_param['pa'] === 1){
  5. $level = '助理';
  6. }elseif((int)$route_param['pa'] === 2){
  7. $level = '中级';
  8. }elseif((int)$route_param['pa'] === 3){
  9. $level = '高级';
  10. }elseif((int)$route_param['pa'] === 4){
  11. $level = '正高级';
  12. }else{
  13. $level = '技术员';
  14. }*/
  15. $level33 = (int)$route_param['pa']; //级别对应排序即可
  16. $level = $level33;
  17. /*if((int)$level33 === 0){
  18. $level = 1;
  19. }else if((int)$level33 === 1){
  20. $level = 0;
  21. }else{
  22. $level = $level33;
  23. }*/
  24. }else{
  25. /*$level = '技术员';*/
  26. $level = 0;
  27. //$level = 1;
  28. }
  29. //查找文档id
  30. //var_dump($level);
  31. ?>
  32. <?php
  33. if($site == 'www'){
  34. $areaid = 10000;
  35. }else{
  36. //$sql = "SELECT id FROM ey_citysite WHERE domain = '$site'";
  37. //echo $sql;
  38. /*
  39. * {eyou:if condition='($site != "www")'}
  40. {eyou:sql sql='$sql' cachetime='3600' id='city'}
  41. {eyou:php}
  42. $areaid = $city['id'];
  43. {/eyou:php}
  44. {/eyou:sql}
  45. {/eyou:if}
  46. */
  47. //从area.htm获取到区域id
  48. $areaid = $area_id;
  49. }
  50. ?>
  51. <?php
  52. $num = (int)$route_param['catids'];
  53. $cid = $route_param['cid']?(int)$route_param['cid']:0;
  54. //var_dump($cid);
  55. if($cid > 0){
  56. $sql = "SELECT aid FROM ey_seo_number WHERE number=$cid and type=1 and tid=38 and topid=38 and parentid=38 and area_id=$areaid";
  57. }else{
  58. $sql = "SELECT aid FROM ey_seo_number WHERE number=$num and type=1 and tid=38 and topid=38 and parentid=38 and area_id=$areaid";
  59. }
  60. //echo $sql;
  61. ?>
  62. {eyou:sql sql='$sql' cachetime='3600' id='seo'}
  63. <?php
  64. if($cid > 0){
  65. //再查询一次
  66. $so_parent_id = $seo['aid'];
  67. $sql2 = "SELECT aid FROM ey_seo_number WHERE number=$num and type=1 and tid=$so_parent_id and topid=38 and parentid=$so_parent_id and area_id=0";
  68. }else{
  69. $route_param['catids'] = $seo['aid'];
  70. //var_dump($route_param);
  71. }
  72. ?>
  73. {/eyou:sql}
  74. {eyou:if condition='($cid > 0)'}
  75. <?php
  76. //var_dump($sql2);
  77. ?>
  78. {eyou:sql sql='$sql2' cachetime='3600' id='seo2'}
  79. <?php
  80. $route_param['catids'] = $seo2['aid'];
  81. //var_dump($route_param);
  82. ?>
  83. {/eyou:sql}
  84. {/eyou:if}
  85. <?php
  86. //栏目信息 获取二级或者三级
  87. //var_dump($route_param);
  88. ?>
  89. {eyou:assign name='catid' value="$route_param.catids"}
  90. {eyou:type typeid='$route_param.catids' empty='' id="catinfo"}
  91. {eyou:assign name='parentid' value="$catinfo.parent_id"}
  92. {eyou:assign name='catname' value="$catinfo.typename"}
  93. {/eyou:type}
  94. <?php
  95. //var_dump($catid);
  96. ?>
  97. {eyou:empty name='$parentid' /}
  98. <?php
  99. //查找小类 获取到parentid
  100. ?>
  101. {eyou:sql sql="SELECT id,parent_id,typename FROM ey_arctype_cat WHERE id = $catid" cachetime='3600' id='field2'}
  102. {eyou:assign name='parentid' value="$field2.parent_id"}
  103. {eyou:assign name='catname' value="$field2.typename"}
  104. {/eyou:sql}
  105. {/eyou:empty}
  106. <?php
  107. $level_pa = (int)$level+1; //对应后台 要加 1
  108. if((int)$parentid === 38){
  109. //大类 二级
  110. $sql = "select aid from ey_archives where typeid=".$catid." and product_id=0 and level=".$level_pa." and is_del=0";
  111. //echo $sql;
  112. ?>
  113. {eyou:sql sql="$sql" cachetime='3600' empty='' id='detail'}
  114. {eyou:assign name='aid' value="$detail.aid"}
  115. {eyou:arcview aid="$detail.aid" id="field"}
  116. <?php
  117. //获取到文档详情
  118. $eyou['field'] = $field;
  119. ?>
  120. {/eyou:arcview}
  121. {/eyou:sql}
  122. <?php
  123. }else{
  124. //小类 三级
  125. $sql = "select id,parent_id from ey_arctype_cat where id=".$catid." and is_del=0";
  126. ?>
  127. {eyou:sql sql="$sql" cachetime='3600' empty='' id='detail2'}
  128. <?php
  129. $sql2 = "select aid from ey_archives where typeid=".$detail2['parent_id']." and product_id=".$catid." and level=".$level_pa." and is_del=0";
  130. //echo $sql2;die;
  131. ?>
  132. {eyou:sql sql="$sql2" cachetime='3600' empty='' id='detail'}
  133. {eyou:assign name='aid' value="$detail.aid"}
  134. {eyou:arcview aid="$detail.aid" id="field"}
  135. <?php
  136. //获取到文档详情
  137. $eyou['field'] = $field;
  138. ?>
  139. {/eyou:arcview}
  140. {/eyou:sql}
  141. {/eyou:sql}
  142. <?php
  143. }
  144. ?>