Esempio n. 1
0
 /**
  * CarrierPlatFormAct::act_updateCarrierPlatForm()
  * 修改运输平台
  * @param int $ship_id 运输方式ID
  * @param int $plat_id 平台ID
  * @param string $ship_name 运输名
  * @param string $ship_service 服务名
  * @return  bool
  */
 public function act_updateCarrierPlatForm()
 {
     $id = isset($_POST["id"]) ? intval(trim($_POST["id"])) : 0;
     $carrierId = isset($_POST["ship_id"]) ? abs(intval($_POST["ship_id"])) : 0;
     $platId = isset($_POST["plat_id"]) ? abs(intval($_POST["plat_id"])) : 0;
     $ship_name = isset($_POST["ship_name"]) ? post_check($_POST["ship_name"]) : "";
     $ship_service = isset($_POST["ship_service"]) ? post_check($_POST["ship_service"]) : "";
     $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : "";
     $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : "";
     if (!AuthUser::checkLogin($mod, $act)) {
         self::$errCode = 10001;
         self::$errMsg = "对不起,您无数据编辑权限!";
         return false;
     }
     if (empty($carrierId)) {
         self::$errCode = 10000;
         self::$errMsg = "运输方式选择有误!";
         return false;
     }
     if (empty($platId)) {
         self::$errCode = 10001;
         self::$errMsg = "平台选择有误!";
         return false;
     }
     if (empty($ship_name)) {
         self::$errCode = 10002;
         self::$errMsg = "运输名有误!";
         return false;
     }
     if (empty($ship_service)) {
         self::$errCode = 10003;
         self::$errMsg = "服务名有误!";
         return false;
     }
     $uid = $_SESSION[C('USER_AUTH_SYS_ID')];
     $data = array("carrierId" => $carrierId, "platId" => $platId, "shipName" => $ship_name, "shipService" => $ship_service, "modifyTime" => time(), "modifyUserId" => $uid);
     $res = CarrierPlatFormModel::updateCarrierPlatForm($id, $data);
     self::$errCode = CarrierPlatFormModel::$errCode;
     self::$errMsg = CarrierPlatFormModel::$errMsg;
     return $res;
 }