当前位置: 首页>>代码示例>>PHP>>正文


PHP Utility::getArrayForResults方法代码示例

本文整理汇总了PHP中Utility::getArrayForResults方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::getArrayForResults方法的具体用法?PHP Utility::getArrayForResults怎么用?PHP Utility::getArrayForResults使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utility的用法示例。


在下文中一共展示了Utility::getArrayForResults方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadList

 /**
  * load文件并给与权限判断
  */
 protected static function loadList($p_where = null, $p_order = null, $p_pageIndex = null, $p_pageSize = null, &$p_countThis = null, $isDetail = false)
 {
     $tmpResult = parent::loadList($p_where, $p_order, $p_pageIndex, $p_pageSize, $p_countThis, $isDetail);
     if (is_array($tmpResult) && array_key_exists('errorCode', $tmpResult)) {
         return $tmpResult;
     }
     switch ($auth = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), $isDetail ? 'detail' : 'list', $tmpResult)) {
         case 'admin':
             //有管理权限
         //有管理权限
         case 'self':
             //作者
             break;
         case 'normal':
             //正常用户
         //正常用户
         case 'draft':
             //未激活
         //未激活
         case 'pending':
             //待审禁言
         //待审禁言
         case 'disabled':
             //封号
         //封号
         case 'visitor':
             //游客
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您没有权限执行该操作');
             break;
         case 'empty':
             //空
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_DATA_EMPTY, '不存在对应数据');
             break;
         default:
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您没有权限执行该操作');
             break;
     }
     PersonModel::$authViewDisabled = static::$authViewDisabledList[$auth];
     return $tmpResult;
 }
开发者ID:alonexy,项目名称:lea,代码行数:43,代码来源:PersonController.php

示例2: actionUploadMultipleFiles

 /**
  * 一次选中多个文件进行上传,请使用name="files[]" multiple="multiple"上传
  * <input type="file" accept="image/gif, image/jpeg, image/png, image/jpg" name="files[]" multiple="multiple">
  * @return string[] 多个来自七牛的预览网址
  */
 public static function actionUploadMultipleFiles()
 {
     $fileSizeMax = 5 * 1024 * 1024;
     $fileTypeAllowed = array('jpg', 'png', 'jpeg', 'gif', 'doc', 'docx', 'pdf');
     if (!array_key_exists('files', $_FILES) || count($_FILES['files']) == 0) {
         return Utility::getArrayForResults(RUNTIME_CODE_ERROR_UNKNOWN, '没有发现上传的文件,请检查。');
     }
     $upload_file = $_FILES['files'];
     $previewUrls = array();
     for ($i = 0; $i < count($upload_file['name']); $i++) {
         if ($upload_file["size"][$i] > 0) {
             $file_tmp_path = $upload_file["tmp_name"][$i];
             $file_type = pathinfo($upload_file["name"][$i], PATHINFO_EXTENSION);
             if (isset($fileTypeAllowed) && !in_array(strtolower($file_type), $fileTypeAllowed)) {
                 Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '提示:不支持上传该' . $file_type . '类型的文件,支持:' . implode('、', $fileTypeAllowed));
             }
             if ($upload_file["size"] > $fileSizeMax) {
                 Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '错误,文件大小不可超过' . $fileSizeMax . '字节。');
             }
             if ($upload_file["size"][$i] > 5 * 1024 * 1024) {
                 return Utility::getArrayForResults(RUNTIME_CODE_ERROR_UNKNOWN, '错误,文件大小不可超过5MB。');
             }
             $file_tmp_path_type = $file_tmp_path . '.' . $file_type;
             rename($file_tmp_path, $file_tmp_path_type);
             $previewUrls[] = W2Qiniu::uploadAndReturnQiniuPreviewUrl($file_tmp_path_type);
         }
     }
     return Utility::getArrayForResults(RUNTIME_CODE_OK, '', $previewUrls);
 }
开发者ID:alonexy,项目名称:lea,代码行数:34,代码来源:QiniuController.php

示例3: actionList

 public static function actionList()
 {
     switch ($auther = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), 'list')) {
         case 'admin':
             //有管理权限
             if (Utility::getCurrentUserID('uid') != null) {
                 $p_where['userid'] = W2HttpRequest::getRequestInt('uid');
             }
             //管理员可以筛选用户
             if (W2HttpRequest::getRequestInt('jobareaid') != null) {
                 $p_where['jobareaid'] = W2HttpRequest::getRequestInt('jobareaid');
             }
             //管理员可以筛选地区
             if (W2HttpRequest::getRequestString('jobstartdate') != null) {
                 $p_where['jobstartdate >= \'%s\''] = W2HttpRequest::getRequestString('jobstartdate');
             }
             //管理员可以筛选开始时间
             if (W2HttpRequest::getRequestString('jobenddate') != null) {
                 $p_where['jobenddate <= \'%s\''] = W2HttpRequest::getRequestString('jobenddate');
             }
             //管理员可以筛选结束时间
             break;
         case 'self':
             //作者
         //作者
         case 'normal':
             //正常用户
             $p_where['userID'] = Utility::getCurrentUserID('userid');
         case 'draft':
             //未激活
         //未激活
         case 'pending':
             //待审禁言
         //待审禁言
         case 'disabled':
             //封号
         //封号
         case 'visitor':
             //游客
             break;
         default:
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您没有权限执行该操作');
             break;
     }
     $_order = W2HttpRequest::getRequestString('order', false, '');
     switch (strtolower($_order)) {
         case 'id':
         case 'userid':
             //用户ID
         //用户ID
         case 'jobAreaID':
             //地区ID
         //地区ID
         case 'jobStartDate':
             //开始时间
         //开始时间
         case 'jobEndDate':
             //结束时间
             $p_order = $_order;
             break;
         case '':
         case 'default':
             $p_order = 'id';
             break;
         default:
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '请使用可选的排序方案。');
             break;
     }
     $p_countThis = -1;
     return static::aList($p_where, $p_order, $p_pageIndex = null, $p_pageSize = null, $p_countThis, $isDetail = false);
 }
开发者ID:alonexy,项目名称:lea,代码行数:71,代码来源:JiaQiController.php

示例4: actionList

 public static function actionList()
 {
     $p_where['status'] = STATUS_NORMAL;
     //默认列表页只筛选STATUS_NORMAL状态的数据
     //根据权限不同,支持的筛选功能也可以不同
     switch ($auther = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), 'list')) {
         case 'admin':
             //有管理权限
             $p_where['status'] = W2HttpRequest::getRequestInt('status');
             //管理员可以筛选状态'
             $p_where['userID'] = W2HttpRequest::getRequestInt('uid');
             //管理员可以筛选用户ID'
             break;
         case 'self':
             //作者
             $p_where['userID'] = Utility::getCurrentUserID();
             break;
         case 'normal':
             //正常用户
         //正常用户
         case 'draft':
             //未激活
         //未激活
         case 'pending':
             //待审禁言
         //待审禁言
         case 'disabled':
             //封号
         //封号
         case 'visitor':
             //游客
             break;
         default:
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您没有权限执行该操作');
             break;
     }
     $_order = W2HttpRequest::getRequestString('order', false, '');
     switch (strtolower($_order)) {
         case 'id':
         case 'userid':
             //发布用户ID
         //发布用户ID
         case 'status':
             //0: 不存在  1: 正常 2: 草稿  3:待审
         //0: 不存在  1: 正常 2: 草稿  3:待审
         case 'createtime':
             //创建时间
         //创建时间
         case 'modifytime':
             //修改时间
             $p_order = $_order;
             break;
         case '':
         case 'default':
             $p_order = 'id';
             break;
         default:
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '请使用可选的排序方案。');
             break;
     }
     $p_countThis = -1;
     return static::aList($p_where, $p_order, $p_pageIndex = null, $p_pageSize = null, $p_countThis, $isDetail = false);
 }
开发者ID:alonexy,项目名称:lea,代码行数:63,代码来源:ReportController.php

示例5: actionCheckVerifyCode

 public static function actionCheckVerifyCode()
 {
     $isRight = SmsVerifyHandler::isSmsVerifyRight(W2HttpRequest::getRequestTelephone('telephone'), W2HttpRequest::getRequestString('verifycode'));
     if ($isRight) {
         return Utility::getArrayForResults(RUNTIME_CODE_OK, '', true, '正确');
     } else {
         return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '验证码错误');
     }
 }
开发者ID:alonexy,项目名称:lea,代码行数:9,代码来源:SmsVerifyController.php

示例6: actionList

 public static function actionList()
 {
     $status = W2HttpRequest::getRequestInt('status');
     $p_where = array();
     switch ($auther = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), 'list')) {
         case 'admin':
             //有管理权限
             $p_where['bossID'] = W2HttpRequest::getRequestInt('userid');
             $p_where['status'] = W2HttpRequest::getRequestInt('status', null, true, false, STATUS_NORMAL);
             //管理员可以筛选数据状态
             break;
         case 'self':
             //作者
         //作者
         case 'normal':
             //正常用户
             $p_where['bossID'] = Utility::getCurrentUserID();
             if ($status == 0) {
                 $p_where['status'] = STATUS_NORMAL;
             } else {
                 $p_where['status'] = W2HttpRequest::getRequestInt('status', null, true, false, STATUS_NORMAL);
                 //用户可以筛选数据状态
             }
             break;
         case 'draft':
             //未激活
         //未激活
         case 'pending':
             //待审禁言
         //待审禁言
         case 'disabled':
             //封号
         //封号
         case 'visitor':
             //游客
             break;
         default:
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您没有权限执行该操作');
             break;
     }
     $_order = W2HttpRequest::getRequestString('order', false, '');
     switch (strtolower($_order)) {
         case 'id':
         case 'userid':
             //用户ID
         //用户ID
         case 'bossid':
             //技能名称 认证后不可更改
         //技能名称 认证后不可更改
         case 'missionid':
             //技能认证日期
         //技能认证日期
         case 'countdays':
             //认证机构
         //认证机构
         case 'status':
             //认证状态 0未认证 1已认证 2认证失败
             $p_order = $_order;
             break;
         case '':
         case 'default':
             $p_order = 'id';
             break;
         default:
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '请使用可选的排序方案。');
             break;
     }
     $p_countThis = -1;
     return static::aList($p_where, $p_order, $p_pageIndex = null, $p_pageSize = null, $p_countThis, $isDetail = false);
 }
开发者ID:alonexy,项目名称:lea,代码行数:70,代码来源:RemindController.php

示例7: pushMessage

 /**
  * 推送接口
  * @param  int     $push_type       1单个设备 2部分人(*常用) 3所有人
  * @param  int     $device_type 设备类型 1:浏览器设备 2:pc设备 3:Android设备 4:ios设备 5:windows phone设备
  * @param  string  $title        标题(仅安卓)
  * @param  string  $content      留言正文
  * @param  int     $customtype   自定义类型,t
  * @param  string  $customvalue  自定义值,v
  * @param  string  $p_buserid 用户推送ID,百度里是buserid
  * @param  string  $tag_name     指定标签
  * @return array                 results
  */
 public static function pushMessage($push_type, $device_type, $title = '', $content, $customtype = null, $customvalue = null, $p_buserid = null, $tag_name = null)
 {
     $message_keys = uniqid();
     //函数基于以微秒计的当前时间,生成一个唯一的 ID。
     $channel = new Channel(W2PUSH::$API_KEY, W2PUSH::$SECRET_KEY);
     if (isset($tag_name)) {
         $optional[Channel::TAG_NAME] = $tag_name;
     }
     $optional[Channel::MESSAGE_TYPE] = 1;
     //通知
     $optional[Channel::DEPLOY_STATUS] = static::$DEPLOY_STATUS;
     //1 测试状态  2生产状态
     switch ($push_type) {
         case 1:
             if ($p_buserid === null) {
                 return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '请传入正确的用户推送ID');
             }
             $optional[Channel::USER_ID] = $p_buserid;
         case 2:
             $optional[Channel::DEVICE_TYPE] = $device_type;
             if ($device_type == 4) {
                 $messages = '{' . '"aps":{' . '"alert":"' . $content . '",' . '"sound":"",' . '"badge":1' . '}';
                 if (isset($customtype, $customvalue)) {
                     $messages .= ',"t":' . intval($customtype) . ',"v":"' . $customvalue . '"';
                 }
                 $messages .= '}';
             } else {
                 if ($device_type == 3) {
                     $messages = '{' . '"title": "' . $title . '",' . '"description": "' . $content . '",' . '"notification_builder_id": 0,' . '"notification_basic_style": 7,' . '"open_type": 2,' . '"net_support" : 1,' . '"pkg_content" : ",' . '"custom_content": {"t":' . intval($customtype) . ',"v":"' . $customvalue . '"}' . '}';
                 } else {
                     return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '请传入正确的设备类型,iOS 还是 安卓');
                 }
             }
             $ret = $channel->pushMessage($push_type, $messages, $message_keys, $optional);
             break;
         case 3:
             $ret = $channel->pushMessage($push_type, $messages, $message_keys);
             break;
         default:
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, 'push_type 1:单个人 2部分人 3所有人');
     }
     if (false === $ret) {
         $ret = array();
         $ret[] = 'WRONG, ' . __FUNCTION__ . ' ERROR!!!!!';
         $ret[] = 'ERROR NUMBER: ' . $channel->errno();
         $ret[] = 'ERROR MESSAGE: ' . $channel->errmsg();
         $ret[] = 'REQUEST ID: ' . $channel->getRequestId();
     }
     return Utility::getArrayForResults(RUNTIME_CODE_OK, '', array('push_type' => $push_type, 'messages' => $messages, 'message_keys' => $message_keys, 'optional' => $optional, 'result' => $ret));
 }
开发者ID:alonexy,项目名称:lea,代码行数:62,代码来源:W2PUSHBAIDU.php

示例8: pushMessage

 /**
  * 推送接口
  * @param  int     $push_type       1单个设备 2部分人(*常用)
  * @param  int     $device_type 设备类型 1:浏览器设备 2:pc设备 3:Android设备 4:ios设备 5:windows phone设备
  * @param  string  $title        标题(仅安卓)
  * @param  string  $content      留言正文
  * @param  int     $customtype   自定义类型,t
  * @param  string  $customvalue  自定义值,v
  * @param  string  $p_deviceToken 用户推送ID,百度里是buserid
  * @param  string  $tag_name     指定标签
  * @return array                 results
  */
 public static function pushMessage($push_type, $device_type, $title = '', $content, $customtype = null, $customvalue = null, $p_deviceToken = null, $tag_name = null)
 {
     $notification = new W2PUSH();
     $notification->setAppMasterSecret(W2PUSH::$SECRET_KEY);
     $params = $notification->getData();
     $params['appkey'] = W2PUSH::$API_KEY;
     $params['timestamp'] = strval(time());
     if ($device_type == 4) {
         $params['payload'] = array('aps' => array('alert' => $content));
         if (isset($customtype, $customvalue)) {
             $params['payload']['t'] = intval($customtype);
             $params['payload']['v'] = $customvalue;
         }
     } else {
         if ($device_type == 3) {
             if ($title == '') {
                 $title = $content;
             }
             $params['payload'] = array();
             $params['payload']['display_type'] = 'notification';
             $params['payload']['body'] = array();
             $params['payload']['body']['ticker'] = $title;
             $params['payload']['body']['title'] = $title;
             $params['payload']['body']['text'] = $content;
             $params['payload']['body']['after_open'] = 'go_app';
             if (isset($customtype, $customvalue)) {
                 $params['payload']['extra'] = array();
                 $params['payload']['extra']['t'] = intval($customtype);
                 $params['payload']['extra']['v'] = $customvalue;
             }
         } else {
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '请传入正确的设备类型,iOS 还是 安卓');
         }
     }
     $params['production_mode'] = static::$DEPLOY_STATUS == 2;
     //是否正式环境
     switch ($push_type) {
         case 1:
             $p_deviceToken = is_array($p_deviceToken) ? $p_deviceToken : explode(',', $p_deviceToken);
             if (count($p_deviceToken) == 0 || count($p_deviceToken) == 1 && $p_deviceToken[0] == null) {
                 return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '请传入正确的用户推送ID');
             } else {
                 if (count($p_deviceToken) < 500) {
                     if (count($p_deviceToken) > 1) {
                         $params['type'] = 'listcast';
                     } else {
                         $params['type'] = 'unicast';
                     }
                     $params['device_tokens'] = implode(',', $p_deviceToken);
                 } else {
                     $params['type'] = 'filecast';
                     $notification->uploadContents(implode("\n", $p_deviceToken));
                 }
             }
             break;
         case 2:
             $params['type'] = 'groupcast';
             $params['filter'] = array('where' => array('and' => array()));
             if ($tag_name != null) {
                 $tag_name = is_array($tag_name) ? $tag_name : explode(',', $tag_name);
                 foreach ($tag_name as $tag) {
                     $params['filter']['where']['and'][] = array('tag' => $tag);
                 }
             }
             break;
         default:
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, 'push_type 1:单个人 2部分人 3所有人');
     }
     $notification->setData($params);
     try {
         $ret = $notification->send();
     } catch (Exception $e) {
         $ret = 'Caught exception: ' . $e->getMessage();
     }
     return Utility::getArrayForResults(RUNTIME_CODE_OK, '', array('push_type' => $push_type, 'messages' => $params['payload'], 'message_keys' => $params['timestamp'], 'optional' => $params, 'result' => $ret));
 }
开发者ID:alonexy,项目名称:lea,代码行数:88,代码来源:W2PUSHUMENG.php

示例9: actionList

 public static function actionList()
 {
     $p_where = array();
     $p_where['status'] = STATUS_NORMAL;
     //根据权限不同,支持的筛选功能也可以不同
     switch ($auther = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), 'list')) {
         case 'admin':
             //有管理权限
             $p_where['status'] = W2HttpRequest::getRequestInt('status');
             //管理员可以筛选状态
         //管理员可以筛选状态
         case 'self':
             //作者
         //作者
         case 'normal':
             //正常用户
             $p_where['areaId'] = W2HttpRequest::getRequestInt('areaId');
             //用户可以筛选地区
             $p_where['schoolName like \'%%%s%%\''] = W2HttpRequest::getRequestString('schoolName');
             //用户可以筛选学校
             $p_where['jiben'] = W2HttpRequest::getRequestString('jiben');
             //用户可以筛选本科类别
         //用户可以筛选本科类别
         case 'draft':
             //未激活
         //未激活
         case 'pending':
             //待审禁言
         //待审禁言
         case 'disabled':
             //封号
         //封号
         case 'visitor':
             //游客
             break;
         default:
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您没有权限执行该操作');
             break;
     }
     $p_countThis = -1;
     return static::aList($p_where, $p_order = null, $p_pageIndex = null, $p_pageSize = null, $p_countThis, $isDetail = false);
 }
开发者ID:alonexy,项目名称:lea,代码行数:42,代码来源:SchoolController.php

示例10: actionList1

 public static function actionList1()
 {
     $p_where = array();
     $p_where['status'] = STATUS_NORMAL;
     //根据权限不同,支持的筛选功能也可以不同
     switch ($auther = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), 'list')) {
         case 'admin':
             //有管理权限
             $p_where['status'] = W2HttpRequest::getRequestInt('status');
             //管理员可以筛选状态
         //管理员可以筛选状态
         case 'self':
             //作者
         //作者
         case 'normal':
             //正常用户
             $fid = W2HttpRequest::getRequestInt('fid');
             if (empty($fid)) {
                 $p_where['fID'] = 0;
             } else {
                 $p_where['fID'] = $fid;
             }
             $p_where['majorname like \'%%%s%%\''] = W2HttpRequest::getRequestString('majorname');
         case 'draft':
             //未激活
         //未激活
         case 'pending':
             //待审禁言
         //待审禁言
         case 'disabled':
             //封号
         //封号
         case 'visitor':
             //游客
             break;
         default:
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您没有权限执行该操作');
             break;
     }
     $a = MajorHandler::getList($p_where, $content = array());
     var_dump($a);
     //     	$p_countThis = -1;
     //     	return static::aList($p_where,$p_order = null,$p_pageIndex=null,$p_pageSize=null,$p_countThis,$isDetail = false);
 }
开发者ID:alonexy,项目名称:lea,代码行数:44,代码来源:MajorController.php

示例11: reloadAreaList

 public static function reloadAreaList($areaList)
 {
     // var_export($areaList);
     $dataList = array();
     foreach ($areaList as $area) {
         $aM = (string) $area['areaMain'];
         $aS = (string) $area['areaSecond'];
         $aT = (string) $area['areaThird'];
         // $aS= $aS==0?$aM:$aS;
         // $aT= $aT==0?($aS==0?$aM:$aS):$aT;
         if (!array_key_exists($aM, $dataList)) {
             $dataList[$aM] = array();
             $dataList[$aM]['areaID'] = $aM;
             $dataList[$aM]['areaName'] = AreaHandler::loadAreaNameById($aM);
             $dataList[$aM]['areaNameLocal'] = AreaHandler::loadAreaNameById($aM);
             $dataList[$aM]['areaNameList'] = array(AreaHandler::loadAreaNameById($aM));
             $dataList[$aM]['areaIDList'] = AreaHandler::getAreaInfo($dataList[$aM]['areaID']);
             $dataList[$aM]['childs'] = array();
         }
         if ($aS > 0) {
             $dataList[$aM]['childs'][$aM] = array();
             $dataList[$aM]['childs'][$aM]['areaID'] = $aM;
             $dataList[$aM]['childs'][$aM]['areaName'] = AreaHandler::loadAreaNameById($aM);
             $dataList[$aM]['childs'][$aM]['areaNameLocal'] = '全部';
             $dataList[$aM]['childs'][$aM]['areaNameList'] = $dataList[$aM]['areaNameList'];
             $dataList[$aM]['childs'][$aM]['areaIDList'] = AreaHandler::getAreaInfo($dataList[$aM]['childs'][$aM]['areaID']);
             $dataList[$aM]['childs'][$aM]['childs'] = array();
             if (!array_key_exists($aS, $dataList[$aM]['childs'])) {
                 $dataList[$aM]['childs'][$aS] = array();
                 $dataList[$aM]['childs'][$aS]['areaID'] = $aS == 0 ? $aM : $aS;
                 $dataList[$aM]['childs'][$aS]['areaName'] = AreaHandler::loadAreaNameById($aS);
                 $dataList[$aM]['childs'][$aS]['areaNameLocal'] = AreaHandler::loadAreaNameById($aS);
                 $dataList[$aM]['childs'][$aS]['areaNameList'] = array_merge($dataList[$aM]['areaNameList'], array($dataList[$aM]['childs'][$aS]['areaNameLocal']));
                 $dataList[$aM]['childs'][$aS]['areaIDList'] = AreaHandler::getAreaInfo($dataList[$aM]['childs'][$aS]['areaID']);
                 $dataList[$aM]['childs'][$aS]['childs'] = array();
             }
             if ($aT > 0) {
                 $dataList[$aM]['childs'][$aS]['childs'][$aS] = array();
                 $dataList[$aM]['childs'][$aS]['childs'][$aS]['areaID'] = $aS;
                 $dataList[$aM]['childs'][$aS]['childs'][$aS]['areaName'] = AreaHandler::loadAreaNameById($aS);
                 $dataList[$aM]['childs'][$aS]['childs'][$aS]['areaNameLocal'] = '全部';
                 $dataList[$aM]['childs'][$aS]['childs'][$aS]['areaNameList'] = $dataList[$aM]['childs'][$aS]['areaNameList'];
                 $dataList[$aM]['childs'][$aS]['childs'][$aS]['areaIDList'] = AreaHandler::getAreaInfo($dataList[$aM]['childs'][$aS]['childs'][$aS]['areaID']);
                 $dataList[$aM]['childs'][$aS]['childs'][$aT] = array();
                 $dataList[$aM]['childs'][$aS]['childs'][$aT]['areaID'] = $aT == 0 ? $aS == 0 ? $aM : $aS : $aT;
                 $dataList[$aM]['childs'][$aS]['childs'][$aT]['areaName'] = AreaHandler::loadAreaNameById($aT);
                 $dataList[$aM]['childs'][$aS]['childs'][$aT]['areaNameLocal'] = AreaHandler::loadAreaNameById($aT);
                 $dataList[$aM]['childs'][$aS]['childs'][$aT]['areaNameList'] = array_merge($dataList[$aM]['childs'][$aS]['areaNameList'], array($dataList[$aM]['childs'][$aS]['childs'][$aT]['areaNameLocal']));
                 $dataList[$aM]['childs'][$aS]['childs'][$aT]['areaIDList'] = AreaHandler::getAreaInfo($dataList[$aM]['childs'][$aS]['childs'][$aT]['areaID']);
             }
         }
     }
     $outType = W2HttpRequest::getRequestString('outtype');
     if ($outType == 'array') {
         $result = array();
         foreach ($dataList as $data) {
             $data['subs'] = array();
             foreach ($data['childs'] as $areaSecond => $da) {
                 $da['subs'] = array();
                 foreach ($da['childs'] as $areaThird => $d) {
                     $da['subs'][] = $d;
                 }
                 unset($da['childs']);
                 $data['subs'][] = $da;
             }
             unset($data['childs']);
             $result[] = $data;
         }
         return Utility::getArrayForResults(RUNTIME_CODE_OK, '', $result);
     }
     return Utility::getArrayForResults(RUNTIME_CODE_OK, '', $dataList);
 }
开发者ID:alonexy,项目名称:lea,代码行数:72,代码来源:AreaController.php

示例12: actionEvaluationList

 public static function actionEvaluationList()
 {
     $p_where = array();
     $p_where['status'] = STATUS_NORMAL;
     //默认列表页只筛选STATUS_NORMAL状态的数据
     $p_where['missionStatus'] = 31;
     //0: 不存在  11: 接受报名并已预付款 21: 确认完成并付款  31:已评价
     $p_where['qualityRate'] = W2HttpRequest::getRequestInt('qualityrate');
     //服务质量评分
     $p_where['manneryRate'] = W2HttpRequest::getRequestInt('manneryrate');
     //服务态度评分
     $p_where['speedRate'] = W2HttpRequest::getRequestInt('speedrate');
     //服务速度评分
     $p_where['commentContent'] = W2HttpRequest::getRequestString('commentcontent', false);
     //评语留言
     $p_where['createTime >= \'%s\''] = W2HttpRequest::getRequestDateTime('createtimestart');
     //创建时间
     $p_where['createTime < \'%s\''] = W2HttpRequest::getRequestDateTime('createtimeend');
     //创建时间
     $p_where['modifyTime >= \'%s\''] = W2HttpRequest::getRequestDateTime('modifytimestart');
     //修改时间
     $p_where['modifyTime < \'%s\''] = W2HttpRequest::getRequestDateTime('modifytimeend');
     //修改时间
     switch ($auther = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), 'list')) {
         case 'admin':
             //有管理权限
             $p_where['userID'] = W2HttpRequest::getRequestInt('userid');
             //管理员可以筛选用户ID
             $p_where['id in (%s)'] = W2HttpRequest::getRequestArrayString('ids', false, true);
             $p_where['id'] = W2HttpRequest::getRequestInt('id');
             $p_where['jobID'] = W2HttpRequest::getRequestInt('jobid');
             //任务ID
             $p_where['status'] = W2HttpRequest::getRequestInt('status', null, true, false, STATUS_NORMAL);
             //管理员可以筛选数据状态
             $p_where['missionStatus'] = W2HttpRequest::getRequestInt('missionstatus');
             //0: 不存在  11: 接受报名并已预付款 21: 确认完成并付款  31:已评价
         //0: 不存在  11: 接受报名并已预付款 21: 确认完成并付款  31:已评价
         case 'self':
             //作者
         //作者
         case 'normal':
             //正常用户
             if ($auther == 'normal') {
                 $p_where['userID'] = Utility::getCurrentUserID();
                 //普通用户,默认只能筛选自己名下数据。
             }
         case 'draft':
             //未激活
         //未激活
         case 'pending':
             //待审禁言
         //待审禁言
         case 'disabled':
             //封号
         //封号
         case 'visitor':
             //游客
             break;
         default:
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您没有权限执行该操作');
             break;
     }
     $_order = W2HttpRequest::getRequestString('order', false, '');
     switch (strtolower($_order)) {
         case 'id':
         case 'userid':
             //用户ID
         //用户ID
         case 'jobid':
             //任务ID
         //任务ID
         case 'bossid':
             //雇主ID
         //雇主ID
         case 'qualityrate':
             //服务质量评分
         //服务质量评分
         case 'manneryrate':
             //服务态度评分
         //服务态度评分
         case 'speedrate':
             //服务速度评分
         //服务速度评分
         case 'commentcontent':
             //评语留言
         //评语留言
         case 'createtime':
             //创建时间
         //创建时间
         case 'modifytime':
             //修改时间
             $p_order = $_order;
             break;
         case '':
         case 'default':
             $p_order = 'id';
             break;
         default:
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '请使用可选的排序方案。');
             break;
//.........这里部分代码省略.........
开发者ID:alonexy,项目名称:lea,代码行数:101,代码来源:EvaluationListController.php

示例13: payAction

 /**
  * 操作用于金额,并记录
  * @param  int    $p_userID  用户ID
  * @param  string $p_payName 款项说明
  * @param  int    $p_payType 操作类型
  * @param  double $p_money   涉及金额
  * @param  int    $p_eventID 事件ID
  * @return PayLogModel            记录Model
  */
 public static function payAction($p_userID, $p_payName, $p_payType, $p_money, $p_eventID)
 {
     $userModel = UserHandler::loadModelById($p_userID);
     if (is_object($userModel)) {
         if ($p_money < 0 && $userModel->getMoney() + $p_money < 0) {
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_MONEY_OUT, '用户余额不足,无法扣款。');
         }
         if ($p_money != 0 && $p_payType > 100) {
             UserHandler::update(array('money = money ' . ($p_money > 0 ? '+' : '') . $p_money), array('id' => $userModel->getId()));
         }
         $tmpModel = new PayLogModel();
         $tmpModel->setCreateTime(date('Y-m-d H:i:s'));
         $tmpModel->setModifyTime(date('Y-m-d H:i:s'));
         $tmpModel->setUserID($p_userID);
         $tmpModel->setPayName($p_payName);
         $tmpModel->setPayType($p_payType);
         $tmpModel->setMoney($p_money);
         $tmpModel->setEventID($p_eventID);
         return static::saveModel($tmpModel);
     } else {
         return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '用户不存在');
     }
 }
开发者ID:alonexy,项目名称:lea,代码行数:32,代码来源:PayLogHandler.php

示例14: list

//加载配置文件
require_once __DIR__ . '/../config.php';
//常用常量
require_once AXAPI_ROOT_PATH . '/components/constants.php';
//数据库操作工具
require_once AXAPI_ROOT_PATH . '/lib/DBTool/DBModel.php';
//加载基础方法
require_once AXAPI_ROOT_PATH . '/components/Utility.php';
$results = Utility::getAuthForApiRequest();
if ($results['errorCode'] == RUNTIME_CODE_OK) {
    try {
        list($apiController, $apiAction) = explode("/", W2HttpRequest::getRequestString('r', false, '/'), 2);
        $method = new ReflectionMethod($apiController . 'Controller', 'action' . $apiAction);
        $results = $method->invoke(null, 0);
    } catch (Exception $e) {
        $results = Utility::getArrayForResults(RUNTIME_CODE_ERROR_UNKNOWN, $e->getMessage(), null, array('errorContent' => 'Error on line ' . $e->getLine() . ' in ' . $e->getFile() . ': ' . $e->getMessage() . ''));
    }
}
if (is_array($results) && array_key_exists('errorCode', $results)) {
    $data = $results['results'];
    if (is_object($results['results']) && is_subclass_of($results['results'], 'AbstractModel')) {
        $data = $results['results']->properties();
    } else {
        if (is_array($results['results']) && array_key_exists(0, $results['results'])) {
            $data = array();
            foreach ($results['results'] as $_key => $_value) {
                if (is_object($_value) && is_subclass_of($_value, 'AbstractModel')) {
                    $data[$_key] = $_value->properties();
                } else {
                    $data[$_key] = $_value;
                }
开发者ID:alonexy,项目名称:lea,代码行数:31,代码来源:index.php

示例15: getAuthForApiRequest

 public static function getAuthForApiRequest()
 {
     $isAuthed = false;
     $_HEADERS = Utility::getallheadersUcfirst();
     if (array_key_exists('Signature', $_HEADERS)) {
         //定义一个空的数组
         $tmpArr = array();
         //将所有头信息和数据组合成字符串格式:%s=%s,存入上面的数组
         foreach (array('Clientversion', 'Devicetype', 'Devicetoken', 'Requesttime', 'Userid', 'Logintime', 'Checkcode') as $_key) {
             if (array_key_exists($_key, $_HEADERS)) {
                 array_push($tmpArr, sprintf('%s=%s', $_key, $_HEADERS[$_key]));
             } else {
                 return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '请求信息错误', array('errorContent' => '缺少头信息:' . $_key));
             }
         }
         if (abs($_HEADERS['Requesttime'] - time()) > 7 * 24 * 60 * 60) {
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '该操作已过期,请重试。');
         }
         //同样的,将所有表单数据也组成字符串后,放入数组。(注:file类型不包含)
         foreach ($_REQUEST as $_key => $_value) {
             array_push($tmpArr, sprintf('%s=%s', $_key, $_value));
         }
         //最后,将一串约定好的密钥字符串也放入数组。(不同的项目甚至不同的版本中,可以使用不同的密钥)
         switch ($_HEADERS['Devicetype']) {
             case 1:
                 //浏览器设备
                 array_push($tmpArr, SECRET_HAX_BROWSER);
                 break;
             case 2:
                 //pc设备,服务器
                 array_push($tmpArr, SECRET_HAX_PC);
                 break;
             case 3:
                 //安卓
                 array_push($tmpArr, SECRET_HAX_ANDROID);
                 break;
             case 4:
                 //iOS
                 array_push($tmpArr, SECRET_HAX_IOS);
                 break;
             case 5:
                 //WP
                 array_push($tmpArr, SECRET_HAX_WINDOWS);
                 break;
             default:
                 array_push($tmpArr, SECRET_HAX_PC);
                 break;
         }
         //对数组进行自然排序
         sort($tmpArr, SORT_STRING);
         //将排序后的数组组合成字符串
         $tmpStr = implode($tmpArr);
         //对这个字符串进行MD5加密,即可获得Signature
         $tmpStr = md5($tmpStr);
         if ($tmpStr != $_HEADERS['Signature']) {
             $isAuthed = array('status' => false, 'tmpArr' => $tmpArr, 'tmpArrString' => implode($tmpArr), 'tmpArrMd5' => $tmpStr);
         } else {
             $isAuthed = true;
             // print('Success of auth');
         }
     } else {
         if (false) {
             $isAuthed = true;
         } else {
             return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '请求信息错误', array('errorContent' => '缺少头信息:' . 'signature'));
         }
     }
     if ($isAuthed === true) {
         return Utility::getArrayForResults(RUNTIME_CODE_OK, '', $isAuthed);
     } else {
         return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '校验失败', defined('IS_SQL_PRINT') && IS_SQL_PRINT ? $isAuthed : '');
     }
 }
开发者ID:alonexy,项目名称:lea,代码行数:73,代码来源:Utility.php


注:本文中的Utility::getArrayForResults方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。