get('channel_id'); $uid_str = $request->get('uid', ''); $start_time = $request->get('start_time', ''); $end_time = $request->get('end_time', ''); $service = new UserService; if ($uid_str) { $uids = explode(',', $uid_str); $uids = count($uids) > 100 ? collect($uids)->take(100) : $uids; $result = $service->companyAuthUsers($channel_id, $start_time, $end_time, $uids); } else { $result = $service->companyAuthUsers($channel_id, $start_time, $end_time); } return response()->pagination(new UserTransformer, $result); } /** * @api {post} company/auth/users/subscribes 用户关注记录 * @apiVersion 1.0.0 * @apiName subscribeRecords * @apiGroup User * @apiParam {String} channel_id 站点id * @apiParam {String} uid 用户uid,','分隔;最多不超过100个 * @apiParam {Int} page 分页页码 * @apiParam {String} app_id 分配好的{app_id} * @apiParam {String} nonce_str 随机字符串 * @apiParam {String} timestamp 时间戳 * @apiParam {String} sign 签名 规则同微信支付签名MD5(排序好的请求字符串&key=分配好的{app_secret}) * @apiSuccess {int} code 状态码 * @apiSuccess {String} msg 信息 * @apiSuccess {Object} data 结果集 * @apiSuccess {Object} list 数据结果 * @apiSuccess {Object} meta 分页信息 * @apiSuccess {Int} total 分页总数 * @apiSuccess {Int} uid 用户ID * @apiSuccess {Int} distribution_channel_id 站点ID * @apiSuccess {String} appid 关注app_id * @apiSuccess {String} openid 关注open_id * @apiSuccess {Int} is_subscribed 是否关注 * @apiSuccess {String} subscribe_time 关注时间 * @apiSuccess {String} unsubscribe_time 取关时间 * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK *{ * "code": 0, * "msg": "", * "data": { * "list": [ * { * "id": 7475378, * "channel_id": 166, * "app_id": null, * "opend_id": "oq6ID0ovAjyxnWZRbm3YPz8Pz8nE", * "register_time": "2018-03-20 00:00:08", * "subscribe_time": "" * } * ], * "meta": { * "total": 1, * "per_page": 100, * "current_page": 1, * "last_page": 1, * "next_page_url": "", * "prev_page_url": "" * } * } *} */ public function subscribeRecords(ChannelQueryRequest $request) { $uid_str = $request->get('uid', ''); $channel_id = $request->get('channel_id'); $result = []; if ($uid_str) { $uids = explode(',', $uid_str); $uids = count($uids) > 100 ? collect($uids)->take(100) : $uids; $service = new UserService; $result = $service->findSubscribeRecords($channel_id, $uids); } return response()->pagination(new SubScribeRecordTransformer, $result); } }