has('distribution_channel_id') ? $request->input('distribution_channel_id') : ''; if(empty($distribution_channel_id)) { return response()->error("PARAM_EMPTY"); } \Log::info('-------------------获取当前渠道下的所有服务号-----------------------------------'); \Log::info($distribution_channel_id); $officialAccount['distribution_channel_id'] = $distribution_channel_id; $officialAccountService = OfficialAccountService::allOfficialAccountBydistributionChannelId($officialAccount); return response()->collection(new OfficialAccountTransformer(), $officialAccountService); } /** * @apiVersion 1.0.0 * @api {GET} OfficialAccount/officialAccountCountByChannelId 通过渠道Id获取公众号数量 * @apiGroup OfficialAccount * @apiName officialAccountCountByChannelId * @apiParam {String} distribution_channel_id 分销渠道id. * @apiSuccess {Number} official_num 公众号数量. * @apiSuccessExample {json} Success-Response: * * { * "code": 0, * "msg": "", * "data": { * "official_num": 2, * } * } */ function officialAccountCountByChannelId(Request $request) { $distribution_channel_id = $request->has('distribution_channel_id') ? $request->input('distribution_channel_id') : ''; if(empty($distribution_channel_id)) { return response()->error("PARAM_EMPTY"); } $officialAccount['distribution_channel_id'] = $distribution_channel_id; $officialAccountService = OfficialAccountService::officialAccountCountByChannelId($officialAccount); return response()->success(['official_num'=>$officialAccountService]); } }