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=trackWarnCarrier&act=index"); exit; } $trackWarnCarrier = new TrackWarnCarrierAct(); $res = $trackWarnCarrier->actModify($id); $erpCarrierList = TransOpenApiAct::act_getErpCarrierList(); $this->smarty->assign('shipErp', $erpCarrierList); //ERP运输方式列表 $carrierList = TransOpenApiModel::getCarrier(2); $this->smarty->assign('lists', $carrierList); //运输方式列表 $trackCarrierList = TransOpenApiModel::getTrackCarrierList(); $this->smarty->assign('shipTrack', $trackCarrierList); //跟踪号系统运输方式列表 $this->smarty->assign('carrier_name', $res['trackName']); $this->smarty->assign('ship_erp', $res['erpName']); $this->smarty->assign('ship_id', $res['carrierId']); $this->smarty->assign('id', $res['id']); $this->smarty->display('trackWarnCarrierModify.htm'); }
public function view_index() { $this->smarty->assign('title', '跟踪号信息报表导出'); $carrierList = TransOpenApiModel::getCarrier(2); $this->smarty->assign('carrierList', $carrierList); //运输方式列表 $statusList = C('TRACK_STATUS_DETAIL'); $this->smarty->assign('statusList', $statusList); //跟踪号状态列表 $this->smarty->display('trackWarnExport.htm'); }
public function view_index() { $this->smarty->assign('title', '跟踪号信息统计'); $carrierList = TransOpenApiModel::getCarrier(2); $this->smarty->assign('carrierList', $carrierList); //运输方式列表 $queryObj = new ShipfeeQueryModel(); $countrylist = $queryObj->getStandardCountryName(); //标准国家名称列表 $this->smarty->assign('countrylist', $countrylist); $this->smarty->display('trackWarnStat.htm'); }
/** * CarrierOpenAct::actIndex() * 列出符合条件的数据并分页显示 * @param string $condition 查询条件 * @param integer $curpage 页码 * @param integer $pagenum 每页个数 * @return array */ public function actIndex() { $data = array(); $carrierOpen = new CarrierOpenModel(); //接收参数生成条件 $curpage = isset($_GET['page']) ? abs(intval($_GET['page'])) : 1; $type = isset($_GET['type']) ? trim($_GET['type']) : ''; $key = isset($_GET['key']) ? post_check(trim($_GET['key'])) : ''; $carrierId = isset($_GET['carrierId']) ? intval($_GET['carrierId']) : 0; $condition = "1"; if ($type && $key) { if (!in_array($type, array('carrierAbb', 'carrierIndex'))) { redirect_to("index.php?mod=carrierOpen&act=index"); } $condition .= ' AND ' . $type . " = '" . $key . "'"; } if (!empty($carrierId)) { $condition .= " AND carrierId = '{$carrierId}'"; } //获取符合条件的数据并分页 $pagenum = 20; //每页显示的个数 $total = $carrierOpen->modListCount($condition); $res = $carrierOpen->modList($condition, $curpage, $pagenum); $page = new Page($total, $pagenum, '', 'CN'); $pageStr = ""; if ($res) { if ($total > $pagenum) { $pageStr = $page->fpage(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); } else { $pageStr = $page->fpage(array(0, 1, 2, 3)); } } else { $pageStr = '暂无数据'; } //封装数据返回 $data['key'] = $key; $data['type'] = $type; $data['lists'] = $res; $data['pages'] = $pageStr; $data['carriers'] = TransOpenApiModel::getCarrier(2); $data['carrierId'] = $carrierId; self::$errCode = CarrierOpenModel::$errCode; self::$errMsg = CarrierOpenModel::$errMsg; if (self::$errCode != 0) { show_message($this->smarty, self::$errMsg, ""); return false; } return $data; }
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=countriesShip&act=index"); exit; } $countriesShip = new CountriesShipAct(); $res = $countriesShip->actModify($id); $countriesList = TransOpenApiModel::getCountriesStandard(); $this->smarty->assign('countries', $countriesList); //标准国家列表 $carrierList = TransOpenApiModel::getCarrier(2); $this->smarty->assign('lists', $carrierList); //运输方式列表 $this->smarty->assign('carrier_name', $res['carrier_country']); $this->smarty->assign('en_name', $res['countryName']); $this->smarty->assign('ship_id', $res['carrierId']); $this->smarty->assign('id', $res['id']); $this->smarty->display('countriesShipModify.htm'); }
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'); }
/** * ChannelManageAct::actModify() * 返回某个渠道的信息 * @param int $id 查询ID * @return array */ public function actModify() { $data = array(); $id = isset($_GET['id']) ? intval(trim($_GET['id'])) : 0; if (empty($id)) { show_message($this->smarty, "运输方式ID不能为空?", ""); return false; } $data['id'] = $id; $data['lists'] = TransOpenApiModel::getCarrier(2); $data['res'] = ChannelManageModel::modModify($id); self::$errCode = ChannelManageModel::$errCode; self::$errMsg = ChannelManageModel::$errMsg; if (self::$errCode != 0) { show_message($this->smarty, self::$errMsg, ""); return false; } return $data; }
public function view_index() { $trackWarnInfo = new TrackWarnInfoAct(); $curpage = isset($_GET['page']) ? abs(intval($_GET['page'])) : 1; $countryId = isset($_GET['countryId']) ? intval($_GET['countryId']) : 0; $carrierId = isset($_GET['carrierId']) ? intval($_GET['carrierId']) : 0; $channelId = isset($_GET['channelId']) ? intval($_GET['channelId']) : 0; $type = isset($_GET['type']) ? trim($_GET['type']) : ''; $key = isset($_GET['key']) ? post_check(trim($_GET['key'])) : ''; $timeNode = isset($_GET['timeNode']) ? post_check(trim($_GET['timeNode'])) : ''; $warnLevel = isset($_GET['warnLevel']) ? intval($_GET['warnLevel']) : ''; $is_warn = isset($_GET['is_warn']) ? intval($_GET['is_warn']) : 1; $status = isset($_GET['status']) ? intval($_GET['status']) : -1; //读取用户细颗粒权限 $competences = $_SESSION['competences']; if (!empty($competences['competence'])) { $competences = json_decode($competences['competence'], true); } if (!in_array($carrierId, $competences['carrierId'])) { if (isset($competences['carrierId'])) { $carrierId = implode(",", $competences['carrierId']); } } if (!in_array($channelId, $competences['channelId'])) { if (isset($competences['channelId'])) { $channelId = implode(",", $competences['channelId']); } } $condition = "1"; if (!empty($countryId)) { $condition .= " AND countryId = '{$countryId}'"; } if ($status >= 0) { $condition .= " AND status = '{$status}'"; } if (!empty($carrierId)) { $condition .= " AND carrierId IN({$carrierId})"; } if (!empty($channelId)) { $condition .= " AND channelId IN({$channelId})"; } if (!empty($timeNode)) { if (!in_array($timeNode, array('scanTime', 'lastTime', 'trackTime'))) { redirect_to("index.php?mod=trackWarnInfo&act=index"); } $startTime = isset($_GET['startTime']) ? strtotime(trim($_GET['startTime']) . " 00:00:00") : strtotime(date("Y-m-d", time()) . " 00:00:00"); $endTime = isset($_GET['endTime']) ? strtotime(trim($_GET['endTime']) . " 23:59:59") : strtotime(date("Y-m-d", time()) . " 23:59:59"); if ($startTime && $endTime) { $condition .= ' AND ' . $timeNode . " BETWEEN '" . $startTime . "' AND " . "'" . $endTime . "'"; } } if ($type && $key) { if (!in_array($type, array('orderSn', 'trackNumber', 'recordId', 'platAccount', 'platForm'))) { redirect_to("index.php?mod=trackWarnInfo&act=index"); } $condition .= ' AND ' . $type . " = '" . $key . "'"; } if ($warnLevel === 0) { //全部节点预警 $condition .= " AND warnLevel > 0"; } elseif ($warnLevel === -1) { //没预警节点 $condition .= " AND warnLevel = 0"; } elseif (!empty($warnLevel)) { //某个预警节点 $warnStr = str_pad($warnStr, $warnLevel - 1, "_", STR_PAD_LEFT); switch ($is_warn) { case 1: $condition .= " AND warnLevel like '{$warnStr}1%'"; break; case 2: $condition .= " AND warnLevel like '{$warnStr}0%' AND nodeEff like '{$warnStr}1%'"; break; case 3: $condition .= " AND nodeEff like '{$warnStr}1%'"; break; default: $condition .= " AND warnLevel like '{$warnStr}1%'"; } } // 暂时下线以下条件 // if($condition == '1') { // $startTime = strtotime("-1 day"." 00:00:00"); // $endTime = strtotime(date('Y-m-d')." 23:59:59"); // $timeNode = 'scanTime'; // $condition .= " AND {$timeNode} BETWEEN {$startTime} AND {$endTime}"; // } // 获取符合条件的数据并分页 $pagenum = 20; //每页显示的个数 $res = $trackWarnInfo->actList($condition, $curpage, $pagenum); $total = $trackWarnInfo->actListCount($condition); //页面总数量 $startTimeValue = $startTime ? date('Y-m-d', $startTime) : ''; $endTimeValue = $endTime ? date('Y-m-d', $endTime) : ''; $page = new Page($total, $pagenum, '', 'CN'); $pageStr = ""; if ($res) { if ($total > $pagenum) { $pageStr = $page->fpage(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); } else { $pageStr = $page->fpage(array(0, 1, 2, 3)); } } else { $pageStr = '暂无数据'; } $queryObj = new ShipfeeQueryModel(); $countrylist = $queryObj->getStandardCountryName(); //标准国家名称列表 $carrierList = TransOpenApiModel::getCarrier(2); $statusList = C('TRACK_STATUS_DETAIL'); //替换页面内容变量 $this->smarty->assign('title', '运输方式跟踪号预警管理'); $this->smarty->assign('key', $key); //关键词 $this->smarty->assign('type', $type); //条件选项 $this->smarty->assign('countryId', $countryId); //国家ID $this->smarty->assign('carrierId', $carrierId); //运输方式ID $this->smarty->assign('status', $status); //跟踪号状态 $this->smarty->assign('is_warn', $is_warn); //跟踪号状态 $this->smarty->assign('lists', $res); //数据集 $this->smarty->assign('carrierList', $carrierList); //运输方式列表 $this->smarty->assign('countrylist', $countrylist); $this->smarty->assign('statusList', $statusList); //跟踪号状态列表 $this->smarty->assign('pageStr', $pageStr); //分页输出 $this->smarty->assign('timeNode', $timeNode); //时间条件 $this->smarty->assign('startTimeValue', $startTimeValue); //开始时间 $this->smarty->assign('endTimeValue', $endTimeValue); //结束时间 $this->smarty->display('trackWarnInfo.htm'); }
/** * TransOpenApiAct::act_getCarrier() * 获取运输方式列表并存入memcache * @param int $type 0非快递,1快递,2全部默认 * @param int $is_new 是否强制更新(默认0不强制) * @return json string */ public function act_getCarrier() { $type = isset($_REQUEST['type']) ? post_check($_REQUEST['type']) : 2; $is_new = isset($_REQUEST['is_new']) ? $_REQUEST['is_new'] : 0; if (!in_array($is_new, array(0, 1))) { self::$errCode = 10001; self::$errMsg = '强制更新参数有误!'; return false; } if (!in_array($type, array('0', '1', '2'))) { self::$errCode = 307; self::$errMsg = 'type 参数传递错误!'; return false; } $cacheName = md5("trans_carrier_list_" . $type); $memc_obj = new Cache(C('CACHEGROUP')); $carrierInfo = $memc_obj->get_extral($cacheName); if (!empty($carrierInfo) && empty($is_new)) { return unserialize($carrierInfo); } else { $carrierInfo = TransOpenApiModel::getCarrier($type); $isok = $memc_obj->set_extral($cacheName, serialize($carrierInfo)); if (!$isok) { self::$errCode = 306; self::$errMsg = 'memcache缓存出错!'; //return false; } return $carrierInfo; } }
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=trackWarnNode&act=index"); exit; } $trackWarnNode = new TrackWarnNodeAct(); $res = $trackWarnNode->actModify($id); $carrierList = TransOpenApiModel::getCarrier(2); $this->smarty->assign('lists', $carrierList); //运输方式列表 $this->smarty->assign('node_name', $res['nodeName']); $this->smarty->assign('node_key', $res['nodeKey']); $this->smarty->assign('node_days', $res['nodeDays']); $this->smarty->assign('ship_id', $res['carrierId']); $this->smarty->assign('node_chid', $res['channelId']); $this->smarty->assign('node_place', $res['nodePlace']); $this->smarty->assign('id', $res['id']); $this->smarty->display('trackWarnNodeModify.htm'); }
/** * TrackWarnCountryAct::actModify() * 返回某个目的地国家预警的信息 * @param int $id 查询ID * @return array */ public function actModify() { $data = array(); $id = isset($_GET['id']) ? intval(trim($_GET['id'])) : 0; if (empty($id)) { show_message($this->smarty, "ID不能为空?", ""); return false; } $data['id'] = $id; $data['lists'] = TransOpenApiModel::getCarrier(2); $data['tracks'] = TransOpenApiModel::getTrackCarrierList(); $data['res'] = TrackWarnCountryModel::modModify($id); if (empty($data['res'])) { show_message($this->smarty, "数据为空,请返回确认条件!", ""); return false; } self::$errCode = TrackWarnCountryModel::$errCode; self::$errMsg = TrackWarnCountryModel::$errMsg; if (self::$errCode != 0) { show_message($this->smarty, self::$errMsg, ""); return false; } return $data; }
/** * TrackNumberAct::actModify() * 返回某个跟踪号的信息 * @param int $id 查询ID * @return array */ public function actModify() { $data = array(); $id = isset($_GET['id']) ? intval(trim($_GET['id'])) : 0; if (empty($id)) { show_message($this->smarty, "ID不能为空?", ""); return false; } $data['id'] = $id; $data['countrys'] = TransOpenApiModel::getCountriesStandard(); $data['lists'] = TransOpenApiModel::getCarrier(2); $data['res'] = TrackNumberModel::modModify($id); self::$errCode = TrackNumberModel::$errCode; self::$errMsg = TrackNumberModel::$errMsg; if (self::$errCode != 0) { show_message($this->smarty, self::$errMsg, ""); return false; } $data['chList'] = TransOpenApiModel::getCarrierChannel($data['res']['carrierId']); return $data; }