Ejemplo n.º 1
0
 /**
  * 增加一个分渠道
  * @author czq
  */
 public function view_add()
 {
     if ($_POST['submit']) {
         $data = array('title' => $_POST['title'], 'channelName' => $_POST['channelName'], 'transportId' => $_POST['transportId'], 'channelId' => $_POST['channelId'], 'partition' => $_POST['partition'], 'is_delete' => 0);
         WhChannelPartitionModel::insert($data);
         header("location:index.php?mod=whChannelPartition&act=index");
     } else {
         $transportlist = CommonModel::getShipingTypeList();
         $countrylist = CommonModel::getCountryList();
         $this->smarty->assign('countrylist', $countrylist);
         $this->smarty->assign('transportlist', $transportlist);
         $this->smarty->display('whChannelPartitionAdd.htm');
     }
 }
Ejemplo n.º 2
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');
     }
 }