日期:2014-05-16 浏览次数:20379 次
function liulanrecordAction(){ // 记录最近浏览 $current_goods_id = $this->_request->getParam('current_goods_id'); $browse_history = $this->getGoodsBrowseHistory($current_goods_id,Seed_Cookie::getCookie('browse_history')); $expiretime = time() + 30*24*60*60; Seed_Cookie::setCookie('browse_history',$browse_history,$expiretime,$this->view->seed_Setting['cookie_path'],$this->view->seed_Setting['cookie_host']); //------------------------最近浏览过的商品------------------------ $my_browse = $this->_MyBrowse($browse_history); $json_my_browse = Zend_Json::encode($my_browse); //$json_my_browse = json_encode($my_browse); echo $json_my_browse; exit; }
$.get("<?php echo $this->baseUrl().'/index/liulanrecord';?>", {current_goods_id: "<?php echo $this->goods['goods_id']?>" }, function(data){ var key; var htm_str = ''; for (key in data){ htm_str += "<div>"; htm_str += "<p><a href="+data[key]['url']+" target='_blank'><img src="+data[key]['original_img']+" /></a></p>"; htm_str += "<p class='fred'><b>¥"+data[key]['shop_price']+"</b></p>"; htm_str += "</div>"; } document.getElementById('liulan').innerHTML = htm_str; },'json');