注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

面包会有的

php asp 高端网站开发 微信网站开发 视频会议软硬件

 
 
 

日志

 
 

shopnc二次开发--当点击左上角的商品分类时  

2015-09-12 11:01:27|  分类: shopnc |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |


此次测试,点击“服饰鞋帽”,地址栏的地址为:
http://192.168.1.121/shopnc_b2b2c/web/shop/index.php?act=search&op=index&cate_id=1
在控制器文件search.php的方法public function indexOp(){}中,添加调试代码:
shopnc二次开发--当点击左上角的商品分类时 - 加菲 - 加菲
 

header("Content-type:text/html;charset=utf-8");var_dump($data_attr);exit;

浏览器中点击左上角的“服饰鞋帽”,会输出如下调试信息。

shopnc二次开发--当点击左上角的商品分类时 - 加菲 - 加菲
 
这样比较乱,查看源代码,看着会比较直观:
shopnc二次开发--当点击左上角的商品分类时 - 加菲 - 加菲
 
shop/control/search.php
array(9) {
  ["gc_id"]=>
  string(1) "1"
  ["gc_name"]=>
  string(16) "0010服饰鞋帽"
  ["type_id"]=>
  string(1) "0"
  ["gc_parent_id"]=>
  string(1) "0"
  ["gc_sort"]=>
  string(3) "250"
  ["depth"]=>
  int(1)
  ["child"]=>
  string(17) "9,4,5,6,7,8,11,10"
  ["childchild"]=>
  string(472) "16,34,33,32,19,18,17,15,14,13,12,30,20,21,23,31,29,28,22,27,26,24,25,1053,40,57,56,55,50,49,48,47,46,45,44,43,42,41,39,38,37,36,51,35,54,53,52,69,73,58,59,60,63,61,62,71,70,64,65,66,67,68,72,87,85,88,84,83,82,89,81,80,79,78,77,76,75,74,86,101,102,92,93,91,95,96,97,98,99,100,90,103,104,105,106,94,116,107,108,109,110,111,112,113,114,115,117,118,124,131,122,121,120,119,123,125,136,135,134,133,132,130,129,128,127,126,146,137,144,139,138,141,142,150,149,148,147,143,145,140"
  ["gcid_array"]=>
  array(149) {
    [0]=>
    int(1)
    [1]=>
    string(1) "9"
    [2]=>
    string(1) "4"
    [3]=>
    string(1) "5"
    [4]=>
    string(1) "6"
    [5]=>
    string(1) "7"
    [6]=>
    string(1) "8"
    [7]=>
    string(2) "11"
    [8]=>
    string(2) "10"
    [9]=>
    string(2) "16"
    [10]=>
    string(2) "34"
    [11]=>
    string(2) "33"
    [12]=>
    string(2) "32"
    [13]=>
    string(2) "19"
    [14]=>
    string(2) "18"
    [15]=>
    string(2) "17"
    [16]=>
    string(2) "15"
    [17]=>
    string(2) "14"
    [18]=>
    string(2) "13"
    [19]=>
    string(2) "12"
    [20]=>
    string(2) "30"
    [21]=>
    string(2) "20"
    [22]=>
    string(2) "21"
    [23]=>
    string(2) "23"
    [24]=>
    string(2) "31"
    [25]=>
    string(2) "29"
    [26]=>
    string(2) "28"
    [27]=>
    string(2) "22"
    [28]=>
    string(2) "27"
    [29]=>
    string(2) "26"
    [30]=>
    string(2) "24"
    [31]=>
    string(2) "25"
    [32]=>
    string(4) "1053"
    [33]=>
    string(2) "40"
    [34]=>
    string(2) "57"
    [35]=>
    string(2) "56"
    [36]=>
    string(2) "55"
    [37]=>
    string(2) "50"
    [38]=>
    string(2) "49"
    [39]=>
    string(2) "48"
    [40]=>
    string(2) "47"
    [41]=>
    string(2) "46"
    [42]=>
    string(2) "45"
    [43]=>
    string(2) "44"
    [44]=>
    string(2) "43"
    [45]=>
    string(2) "42"
    [46]=>
    string(2) "41"
    [47]=>
    string(2) "39"
    [48]=>
    string(2) "38"
    [49]=>
    string(2) "37"
    [50]=>
    string(2) "36"
    [51]=>
    string(2) "51"
    [52]=>
    string(2) "35"
    [53]=>
    string(2) "54"
    [54]=>
    string(2) "53"
    [55]=>
    string(2) "52"
    [56]=>
    string(2) "69"
    [57]=>
    string(2) "73"
    [58]=>
    string(2) "58"
    [59]=>
    string(2) "59"
    [60]=>
    string(2) "60"
    [61]=>
    string(2) "63"
    [62]=>
    string(2) "61"
    [63]=>
    string(2) "62"
    [64]=>
    string(2) "71"
    [65]=>
    string(2) "70"
    [66]=>
    string(2) "64"
    [67]=>
    string(2) "65"
    [68]=>
    string(2) "66"
    [69]=>
    string(2) "67"
    [70]=>
    string(2) "68"
    [71]=>
    string(2) "72"
    [72]=>
    string(2) "87"
    [73]=>
    string(2) "85"
    [74]=>
    string(2) "88"
    [75]=>
    string(2) "84"
    [76]=>
    string(2) "83"
    [77]=>
    string(2) "82"
    [78]=>
    string(2) "89"
    [79]=>
    string(2) "81"
    [80]=>
    string(2) "80"
    [81]=>
    string(2) "79"
    [82]=>
    string(2) "78"
    [83]=>
    string(2) "77"
    [84]=>
    string(2) "76"
    [85]=>
    string(2) "75"
    [86]=>
    string(2) "74"
    [87]=>
    string(2) "86"
    [88]=>
    string(3) "101"
    [89]=>
    string(3) "102"
    [90]=>
    string(2) "92"
    [91]=>
    string(2) "93"
    [92]=>
    string(2) "91"
    [93]=>
    string(2) "95"
    [94]=>
    string(2) "96"
    [95]=>
    string(2) "97"
    [96]=>
    string(2) "98"
    [97]=>
    string(2) "99"
    [98]=>
    string(3) "100"
    [99]=>
    string(2) "90"
    [100]=>
    string(3) "103"
    [101]=>
    string(3) "104"
    [102]=>
    string(3) "105"
    [103]=>
    string(3) "106"
    [104]=>
    string(2) "94"
    [105]=>
    string(3) "116"
    [106]=>
    string(3) "107"
    [107]=>
    string(3) "108"
    [108]=>
    string(3) "109"
    [109]=>
    string(3) "110"
    [110]=>
    string(3) "111"
    [111]=>
    string(3) "112"
    [112]=>
    string(3) "113"
    [113]=>
    string(3) "114"
    [114]=>
    string(3) "115"
    [115]=>
    string(3) "117"
    [116]=>
    string(3) "118"
    [117]=>
    string(3) "124"
    [118]=>
    string(3) "131"
    [119]=>
    string(3) "122"
    [120]=>
    string(3) "121"
    [121]=>
    string(3) "120"
    [122]=>
    string(3) "119"
    [123]=>
    string(3) "123"
    [124]=>
    string(3) "125"
    [125]=>
    string(3) "136"
    [126]=>
    string(3) "135"
    [127]=>
    string(3) "134"
    [128]=>
    string(3) "133"
    [129]=>
    string(3) "132"
    [130]=>
    string(3) "130"
    [131]=>
    string(3) "129"
    [132]=>
    string(3) "128"
    [133]=>
    string(3) "127"
    [134]=>
    string(3) "126"
    [135]=>
    string(3) "146"
    [136]=>
    string(3) "137"
    [137]=>
    string(3) "144"
    [138]=>
    string(3) "139"
    [139]=>
    string(3) "138"
    [140]=>
    string(3) "141"
    [141]=>
    string(3) "142"
    [142]=>
    string(3) "150"
    [143]=>
    string(3) "149"
    [144]=>
    string(3) "148"
    [145]=>
    string(3) "147"
    [146]=>
    string(3) "143"
    [147]=>
    string(3) "145"
    [148]=>
    string(3) "140"
  }
}


经过仔细的检查,会发现它的规律(实际从跟踪代码也应该是一样的效果)

/*
$data_attr由数组元素gc_id,gc_name,type_id,gc_parent_id,gc_sort,depth,child,childchild,gcid_array构成
gc_id:指定的某个一级分类ID,如服饰鞋帽
child:当前一级分类ID下的所有二级分类,各二级分类ID用逗号分隔,如,4,5,6,7,8,9,10,11,即女装、男装、内衣、运动、女鞋、男鞋、配饰、童装
childchild:三级分类,如"16,34,33,32,19,18,17,15,14,13,12,30,20,21,23,31,29,28,22,27,26,24,25,1053,40,57,56,55,50,49,48,47,46,45,44,43,42,41,39,38,37,36,51,35,54,53,52,69,73,58,59,60,63,61,62,71,70,64,65,66,67,68,72,87,85,88,84,83,82,89,81,80,79,78,77,76,75,74,86,101,102,92,93,91,95,96,97,98,99,100,90,103,104,105,106,94,116,107,108,109,110,111,112,113,114,115,117,118,124,131,122,121,120,119,123,125,136,135,134,133,132,130,129,128,127,126,146,137,144,139,138,141,142,150,149,148,147,143,145,140"
gcid_array:产品类的id,包括当前的商品一级分类ID,其下的二级商品分类ID,及各二级商品分类ID下的三级分类ID
*/


shopnc二次开发--当点击左上角的商品分类时 - 加菲 - 加菲
 
当点击左上角的每个大类时,都会有上图同样的结果。
  评论这张
 
阅读(180)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017