public function view_shipFee() { $data = TrackShipFeeAct::actShipFee(); $this->smarty->assign('title', "Logistices Estimate Result"); $this->smarty->assign('keywords', "Logistices Estimate Result"); $this->smarty->assign('description', "Logistices Estimate Result"); $this->smarty->assign('country', $data['country']); $this->smarty->assign('addId', $data['addId']); $this->smarty->assign('unit', $data['unit']); $this->smarty->assign('unitW', $data['unitW']); $this->smarty->assign('longs', $data['longs']); $this->smarty->assign('widths', $data['widths']); $this->smarty->assign('heights', $data['heights']); $this->smarty->assign('weights', $data['weights']); $this->smarty->assign('openFees', $data['openFees']); $this->smarty->assign('maxItem', $data['maxItem']); $this->smarty->assign('moreItem', $data['moreItem']); $this->smarty->assign('topNum', $data['topNum']); $this->smarty->assign('countrys', $data['countrys']); $this->smarty->assign('version', C("SYSTEM_VERSION")); $this->smarty->display('trackShipFeeOk.htm'); }
/** * TrackShipFeeAct::actGetShipFee() * 获取接口运费信息 * @param string $addId 发货地址ID * @param string $country 国家 * @param string $realWeight 重量 * @return array; */ public function actGetShipFee($addId, $country, $realWeight, $is_new = 0) { $key = md5($addId . $country . $realWeight); $cacheName = md5("track_ship_fee_" . $key); $memc_obj = new Cache(C('CACHEGROUP')); $shipFeeInfo = $memc_obj->get_extral($cacheName); if (!empty($shipFeeInfo) && empty($is_new)) { return unserialize($shipFeeInfo); } else { $shipFeeInfo = TrackShipFeeModel::calcOpenShipFee($addId, $country, $realWeight, '', '', $apiToken, $noShipId, $weightFlag); self::$errCode = TrackShipFeeModel::$errCode; self::$errMsg = TrackShipFeeModel::$errMsg; $isok = $memc_obj->set_extral($cacheName, serialize($shipFeeInfo), 86400); if (!$isok) { self::$errCode = 308; self::$errMsg = 'memcache缓存出错!'; //return false; } return $shipFeeInfo; } }