/** * ChannelPriceModel::delChannelPrice() * 运费价目删除 * @param integer $id 运费价目ID * @param string $tab 运费价目表名 * @return bool */ public static function delChannelPrice($tab, $id) { self::initDB(); $sql = "UPDATE `" . self::$prefixfee . $tab . "` SET is_delete = 1 WHERE id = {$id}"; $query = self::$dbConn->query($sql); if ($query) { $rows = self::$dbConn->affected_rows(); if ($rows) { return $rows; } else { self::$errCode = 30001; self::$errMsg = "删除数据失败"; return false; } } else { self::$errCode = 30000; self::$errMsg = "执行SQL语句失败!"; return false; } }
public function view_modify() { $this->smarty->assign('title', '修改运费价目'); $id = isset($_GET['id']) ? intval(trim($_GET['id'])) : 0; $chid = isset($_GET['chid']) ? intval($_GET['chid']) : 0; //渠道ID $chname = isset($_GET['chname']) ? post_check($_GET['chname']) : ""; //渠道别名 if (empty($id) || !is_numeric($id) || empty($chname)) { redirect_to("index.php?mod=channelPrice&act=index"); exit; } if (in_array($chname, array('ups_calcfree', 'usps_calcfree', 'usps_first_class', 'ups_ground_commercia', 'sv_sure_post'))) { $zoneList = CountriesUsazoneModel::listZone(); $this->smarty->assign('zoneList', $zoneList); //分区列表 } $channelPrice = new ChannelPriceAct(); $res = $channelPrice->actModify($chname, $id); $carrierId = ChannelPriceModel::getCarrierId($chid); if (in_array($chname, array('usps_first_class', 'ups_ground_commercia', 'sv_sure_post'))) { $weights = explode("-", $res['pr_kilo_next']); $minW = $weights[0]; $maxW = $weights[1]; } $this->smarty->assign('chid', $chid); $this->smarty->assign('carrierId', $carrierId); $this->smarty->assign('pr_group', $res['pr_group']); $this->smarty->assign('pr_kilo', $res['pr_kilo']); $this->smarty->assign('pr_discount', $res['pr_discount']); $this->smarty->assign('pr_handlefee', $res['pr_handlefee']); $this->smarty->assign('pr_country', stripslashes($res['pr_country'])); $this->smarty->assign('pr_kilo_next', $res['pr_kilo_next']); $this->smarty->assign('weight_from', $minW); $this->smarty->assign('weight_to', $maxW); $this->smarty->assign('pr_file', $res['pr_file']); $this->smarty->assign('pr_isfile', $res['pr_isfile']); $this->smarty->assign('pr_air', $res['pr_air']); $this->smarty->assign('pr_other', $res['pr_other']); $this->smarty->assign('id', $res['id']); $this->smarty->assign('chname', $chname); if ($chname == 'hkpostsf_hk' || $chname == 'hkpostrg_hk') { $this->smarty->display('channelPriceModifyHk.htm'); } else { if ($chname == 'ems_shenzhen') { $this->smarty->display('channelPriceModifyEms.htm'); } else { if (in_array($chname, array('eub_shenzhen', 'eub_fujian', 'eub_jiete'))) { $this->smarty->display('channelPriceModifyEub.htm'); } else { if ($chname == 'dhl_shenzhen') { $this->smarty->display('channelPriceModifyDhl.htm'); } else { if ($chname == 'fedex_shenzhen') { $this->smarty->display('channelPriceModifyFedex.htm'); } else { if ($chname == 'globalmail_shenzhen') { $this->smarty->display('channelPriceModifyGlobalmail.htm'); } else { if (in_array($chname, array('ups_us', 'ups_uk', 'ups_fr', 'ups_ger'))) { $this->smarty->display('channelPriceModifyUpsus.htm'); } else { if ($chname == 'ups_calcfree') { $this->smarty->display('channelPriceModifyUps.htm'); } else { if ($chname == 'usps_calcfree') { $this->smarty->display('channelPriceModifyUsps.htm'); } else { if (in_array($chname, array('sto_shenzhen', 'zto_shenzhen', 'yto_shenzhen', 'yundaex_shenzhen', 'best_shenzhen', 'jym_shenzhen', 'gto_shenzhen'))) { $countrylist = TransOpenApiModel::getCountriesChina(); //中国城市名称列表 $this->smarty->assign('countrylist', $countrylist); $this->smarty->display('channelPriceModifyChina.htm'); } else { if (in_array($chname, array('ruston_packet_py', 'ruston_packet_gh', 'ruston_large_package'))) { $this->smarty->display('channelPriceModifyRuston.htm'); } else { if (in_array($chname, array('sg_dhl_gm_gh', 'sg_dhl_gm_py'))) { $this->smarty->display('channelPriceModifySGDHLGM.htm'); } else { if (in_array($chname, array('ruishi_xb_py', 'ruishi_xb_gh'))) { $this->smarty->display('channelPriceModifyRuishi.htm'); } else { if (in_array($chname, array('bilishi_xb_py', 'bilishi_xb_gh'))) { $this->smarty->display('channelPriceModifyBilishi.htm'); } else { if ($chname == 'usps_first_class') { $this->smarty->display('channelPriceModifySVUSPS.htm'); } else { if ($chname == 'ups_ground_commercia') { $this->smarty->display('channelPriceModifySVUPS.htm'); } else { if ($chname == 'sv_sure_post') { $this->smarty->display('channelPriceModifySVSurePost.htm'); } else { if (in_array($chname, array('aoyoubao_py', 'aoyoubao_gh'))) { $this->smarty->display('channelPriceModifyAyb.htm'); } else { $this->smarty->display('channelPriceModify.htm'); } } } } } } } } } } } } } } } } } } }
/** * ChannelPriceAct::act_delChannelPrice() * 删除运费价目 * @param int $id 运费价目ID * @return bool */ public function act_delChannelPrice() { $id = isset($_POST["id"]) ? intval(trim($_POST["id"])) : 0; $chname = isset($_POST["chname"]) ? $_POST["chname"] : ""; $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; if (!AuthUser::checkLogin($mod, $act)) { self::$errCode = 30002; self::$errMsg = "对不起,您无数据删除权限!"; return false; } if (empty($id) || !is_numeric($id)) { self::$errCode = 30000; self::$errMsg = "运费价目ID有误!"; return false; } if (!in_array($chname, self::$chnameArr)) { self::$errCode = 30001; self::$errMsg = "渠道运费参数有误!"; return false; } $res = ChannelPriceModel::delChannelPrice($chname, $id); self::$errCode = ChannelPriceModel::$errCode; self::$errMsg = ChannelPriceModel::$errMsg; if (empty(self::$errCode)) { $cacheFee = TransOpenApiModel::updateCacheTableFee($chname, $data); } return $res; }