Пример #1
0
 /**
  * 通过运输方式id获取对应的渠道
  * @return array $channellist
  * @author czq
  */
 public function act_getChannel()
 {
     $transportId = isset($_POST['transportId']) ? intval($_POST['transportId']) : '';
     if (empty($transportId)) {
         $errCode = 101;
         $errMsg = '未获取运输方式id';
         return false;
     }
     $channellist = CommonModel::getCarrierChannelByIds($transportId);
     //获取国家渠道信息
     self::$errCode = 200;
     self::$errMsg = '获取运输渠道成功!';
     return $channellist;
 }
Пример #2
0
 /**
  * 编辑一个分渠道
  * @author czq
  */
 public function view_edit()
 {
     if ($_POST['submit']) {
         $id = intval($_POST['id']);
         $data = array('title' => $_POST['title'], 'channelName' => $_POST['channelName'], 'transportId' => $_POST['transportId'], 'channelId' => $_POST['channelId'], 'partition' => $_POST['partition'], 'is_delete' => 0);
         WhChannelPartitionModel::update($data, $id);
         header("location:index.php?mod=whChannelPartition&act=index");
     } else {
         $id = intval($_GET['id']);
         $data = WhChannelPartitionModel::find($id);
         $transportlist = CommonModel::getShipingTypeList();
         //获取运输方式
         $channellist = CommonModel::getCarrierChannelByIds($data['transportId']);
         //获取国家渠道信息
         $this->smarty->assign('data', $data);
         $this->smarty->assign('transportlist', $transportlist);
         $this->smarty->assign('channellist', $channellist);
         $this->smarty->display('whChannelPartitionEdit.htm');
     }
 }
Пример #3
0
 public function view_edit()
 {
     if ($_POST['submit']) {
         $id = intval($_POST['id']);
         $data = array('title' => $_POST['title'], 'shortTitle' => $_POST['shortTitle'], 'transportId' => $_POST['transportId'], 'channelId' => $_POST['channelId'], 'channelName' => isset($_POST['channelName']) ? $_POST['channelName'] : '', 'partition' => $_POST['partition'], 'priority' => $_POST['priority'], 'countryWhiteList' => json_encode($_POST['countryWhiteList']), 'backAddress' => $_POST['backAddress'], 'modifiedtime' => time(), 'editUserId' => $_SESSION['userId'], 'status' => intval($_POST['status']));
         WhTransportPartitionModel::update($data, $id);
         header("location:index.php?mod=whTransportPartition&act=index");
     } else {
         $id = intval($_GET['id']);
         $data = WhTransportPartitionModel::find($id);
         $data['countryWhiteList'] = json_decode($data['countryWhiteList'], true);
         $transportlist = CommonModel::getShipingTypeList();
         //获取运输方式
         $countrylist = CommonModel::getCountryList();
         //获取国建列表
         $channellist = CommonModel::getCarrierChannelByIds($data['transportId']);
         //获取国家渠道信息
         $this->smarty->assign('data', $data);
         $this->smarty->assign('countrylist', $countrylist);
         $this->smarty->assign('transportlist', $transportlist);
         $this->smarty->assign('channellist', $channellist);
         $this->smarty->display('whTransportPartition_edit.htm');
     }
 }