예제 #1
0
 public function view_modify()
 {
     $this->smarty->assign('title', '修改运输平台');
     $id = isset($_GET['id']) ? intval(trim($_GET['id'])) : 0;
     if (empty($id) || !is_numeric($id)) {
         redirect_to("index.php?mod=carrierPlatForm&act=index");
         exit;
     }
     $carrierPlatForm = new CarrierPlatFormAct();
     $res = $carrierPlatForm->actModify($id);
     $carrierList = TransOpenApiModel::getCarrier(2);
     $this->smarty->assign('lists', $carrierList);
     //运输方式列表
     $platFormlist = TransOpenApiModel::getPlatForm("ALL");
     //平台列表
     $this->smarty->assign('platFormlist', $platFormlist);
     $this->smarty->assign('ship_id', $res['carrierId']);
     $this->smarty->assign('plat_id', $res['platId']);
     $this->smarty->assign('ship_name', $res['shipName']);
     $this->smarty->assign('ship_service', $res['shipService']);
     $this->smarty->assign('id', $res['id']);
     $this->smarty->display('carrierPlatFormModify.htm');
 }
예제 #2
0
 /**
  * TransOpenApiAct::act_getPlatForm()
  * 获取运输方式平台列表并存入memcache
  * @param string $type ALL 获取全部,其它待定
  * @param int $is_new 是否强制更新,默认0不强制
  * @return  json string
  */
 public function act_getPlatForm()
 {
     $type = isset($_REQUEST['type']) ? post_check($_REQUEST['type']) : "";
     if (!in_array($type, array("ALL"))) {
         self::$errCode = 307;
         self::$errMsg = 'type 参数传递错误!';
         return false;
     }
     $cacheName = md5("trans_plat_form_list_" . $type);
     $memc_obj = new Cache(C('CACHEGROUP'));
     $platFormInfo = $memc_obj->get_extral($cacheName);
     if (!empty($platFormInfo) && empty($is_new)) {
         return unserialize($platFormInfo);
     } else {
         $platFormInfo = TransOpenApiModel::getPlatForm($type);
         $isok = $memc_obj->set_extral($cacheName, serialize($platFormInfo));
         if (!$isok) {
             self::$errCode = 306;
             self::$errMsg = 'memcache缓存出错!';
             //return false;
         }
         return $platFormInfo;
     }
 }
예제 #3
0
 public function view_modify()
 {
     $this->smarty->assign('title', '修改运输方式');
     $id = isset($_GET['id']) ? intval(trim($_GET['id'])) : 0;
     if (empty($id) || !is_numeric($id)) {
         redirect_to("index.php?mod=carrierManage&act=index");
         exit;
     }
     $carrierManage = new CarrierManageAct();
     $res = $carrierManage->actModify($id);
     $this->smarty->assign('cn_name', $res['carrierNameCn']);
     $this->smarty->assign('en_name', $res['carrierNameEn']);
     $this->smarty->assign('ship_ali', $res['carrierAli']);
     $this->smarty->assign('ship_abb', $res['carrierAbb']);
     $this->smarty->assign('ship_index', $res['carrierIndex']);
     $this->smarty->assign('ship_logo', $res['carrierLogo']);
     $this->smarty->assign('ship_type', $res['type']);
     $this->smarty->assign('min_weight', $res['weightMin']);
     $this->smarty->assign('max_weight', $res['weightMax']);
     $this->smarty->assign('ship_day', $res['timecount']);
     $this->smarty->assign('ship_note', $res['note']);
     $this->smarty->assign('is_track', $res['is_track']);
     $this->smarty->assign('id', $res['id']);
     $platFormlist = TransOpenApiModel::getPlatForm("ALL");
     //平台列表
     $this->smarty->assign('platFormlist', $platFormlist);
     $res = CarrierManageModel::listCarrierPlatForm($id);
     //运输方式对应平台列表
     $platList = array();
     foreach ($res as $v) {
         array_push($platList, $v['platformId']);
     }
     $this->smarty->assign('platList', $platList);
     $addrlist = TransOpenApiModel::getShipAddress();
     //发货地列表
     $this->smarty->assign('addrlist', $addrlist);
     $res = ShippingAddressModel::getAddByCarrierId($id);
     $ship_add = isset($res['id']) ? $res['id'] : 0;
     $this->smarty->assign('ship_add', $ship_add);
     $this->smarty->display('carrierManageModify.htm');
 }