# bay_common **Repository Path**: ltfish/bay_common ## Basic Information - **Project Name**: bay_common - **Description**: No description available - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-05-07 - **Last Updated**: 2021-06-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 81号兵站公共composer 环境安装: 必备扩展(openssl/redis/pdo/mongodb/memcached/msgpack) 使用方法: # 1、第一步在composer文件中引入该包 ```json { "require": { "bay/common": "dev-master" }, "repositories": { "0": { "type": "git", "secure-http": false, "url": "https://gitee.com/ltfish/bay_common.git", "reference": "dev" } } } ``` # 配置 ```env #发送消息请求地址 MNS_endPoint= #appid MNS_accessId= #appkey MNS_accessKey= #oss文件上传 Oss_endPoint= Oss_accessId= Oss_accessKey= ``` # MNS使用 ```php topic($topic, json_encode($message)); return $this->success($res); } /** * 文件上传 * @throws \Exception */ public function upLoad(){ $oss=new UpLoadFile(); $filePath="/temp/1.jpg"; $fileName=time().random_bytes(4)."jpg"; $oss->upLoadFile("city-app-v1",$fileName,$filePath); } } ``` # 嵌套demo ```php get()->toArray(); $typeIds = array_column($types, "id"); $some = $res->whereIn("type", $typeIds)->get()->toArray(); $r = CommonHelper::arrayChangeMultiKey($some, "type"); foreach ($types as &$v) { $v->messages = $r[$v->id] ?? []; } return $this->success($types); } } ```