123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?php
- namespace App\Http\Controllers\Wechat\OfficialAccount;
- use App\Http\Controllers\Channel\BaseController as ChannelBaseController;
- use App\Modules\OfficialAccount\Services\CustomSendStatsService;
- use App\Http\Controllers\Channel\OfficialAccount\Transformers\CustomSendStatsTransformers;
- use Illuminate\Http\Request;
- class CustomSendStatsController extends ChannelBaseController
- {
-
-
- function customSendDayStatsByChannelAndFrom(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");
- }
- $from = $request->has('from') ? $request->input('from') : '';
- if(empty($from)) {
- return response()->error("PARAM_EMPTY");
- }
- $customMsgService = CustomSendStatsService::customSendDayStatsByChannelAndFrom($distribution_channel_id,$from);
- if (!empty($customMsgService)) {
-
- return response()->pagination(new CustomSendStatsTransformers(), $customMsgService);
- }else{
- return response()->success(['data'=>0]);
- }
-
- }
-
- function customSendStatsByChannelAndFrom(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");
- }
- $from = $request->has('from') ? $request->input('from') : '';
- if(empty($from)) {
- return response()->error("PARAM_EMPTY");
- }
- $customMsgService = CustomSendStatsService::customSendStatsByChannelAndFrom($distribution_channel_id,$from);
- if (!empty($customMsgService)) {
-
- return response()->item(new CustomSendStatsTransformers(), $customMsgService);
- }else{
- return response()->success(['data'=>0]);
- }
-
- }
-
- }
|