Example #1
0
 public function act_addPlatIds()
 {
     $infos = isset($_POST['infos']) ? $_POST['infos'] : '';
     $uid = isset($_POST['uid']) ? intval($_POST['uid']) : 0;
     if (empty($uid)) {
         self::$errCode = 402;
         self::$errMsg = '被修改人id有误!';
         return;
     }
     $insertData = array();
     if (!empty($infos)) {
         $datas = explode(',', $infos);
         foreach ($datas as $data) {
             $idInfo = explode('*', $data);
             $insertData[$idInfo[1]][] = $idInfo[0];
         }
     }
     if (empty($insertData)) {
         $data = '';
     } else {
         $data = json_encode($insertData);
     }
     if (UserCompetenceModel::insertPlatData($uid, $data)) {
         self::$errCode = 0;
         self::$errMsg = '权限设置成功';
         return true;
     } else {
         self::$errCode = 403;
         self::$errMsg = '权限设置失败';
         return false;
     }
 }
Example #2
0
 /**
  * UserCompetenceAct::listAcc()
  * 查看所有采购帐号
  * @return array 
  */
 public function listAcc()
 {
     global $dbConn;
     $res = CommonAct::actGetPurchaseList(true);
     self::$errCode = CommonAct::$errCode;
     self::$errMsg = CommonAct::$errMsg;
     $type = $_POST["type"];
     $userIdArr = $_POST['userIdArr'];
     if ($type == "all" && count($userIdArr) > 1) {
         //批量添加
         $access_id = 0;
     } else {
         $sql = "SELECT power_ids from ph_purchases_access where user_id={$userIdArr[0]}";
         $sql = $dbConn->execute($sql);
         $powerInfo = $dbConn->fetch_one($sql);
         $access_id = $powerInfo['power_ids'];
     }
     $data = array("access_id" => $access_id, "data" => $res);
     return json_encode($data);
 }
Example #3
0
 /**
  * UserCompetenceAct::act_delUserCompetence()
  * 删除用户开放授权
  * @param int $gid 开放权限ID
  * @return  bool
  */
 public function act_delUserCompetence()
 {
     $gid = isset($_POST["id"]) ? intval(trim($_POST["id"])) : 0;
     $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : "";
     $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : "";
     if (!AuthUser::checkLogin($mod, $act)) {
         self::$errCode = 30001;
         self::$errMsg = "对不起,您无数据删除权限!";
         return false;
     }
     if (empty($gid) || !is_numeric($gid)) {
         self::$errCode = 30000;
         self::$errMsg = "开放用户权限ID有误!";
         return false;
     }
     $res = UserCompetenceModel::delUserCompetence($gid);
     self::$errCode = UserCompetenceModel::$errCode;
     self::$errMsg = UserCompetenceModel::$errMsg;
     return $res;
 }
Example #4
0
 function act_updateOrderEditOptions()
 {
     //global $memc_obj; //调用memcache获取sku信息
     $idArr = $_POST['idArr'];
     $uid = $_POST['uid'];
     $data = array();
     $idStr = implode(',', $idArr);
     $data['visible_editorder'] = $idStr;
     $rtn = OmAccountModel::addUserCompense($uid, $data);
     self::$errCode = OmAccountModel::$errCode;
     self::$errMsg = OmAccountModel::$errMsg;
     return $rtn;
 }