123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388 |
- <?php
- /**
- * Created by PhpStorm.
- * User: shensong
- * Date: 2022/9/18
- * Time: 21:19
- */
- namespace App\Http\Controllers\Api;
- use App\Http\Controllers\Controller;
- use App\Service\ShortPlayDataTrendService;
- use Illuminate\Http\Request;
- class ShortPlayDataTrendController extends Controller
- {
- public function adqShortPlayDataTrendList(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'start_date' => 'required|date',
- 'end_date' => 'required|date',
- 'closing_date' => 'nullable|date',
- 'page' => 'required|numeric',
- 'page_size' => 'required|numeric',
- 'playlet_id' => 'nullable|numeric',
- 'plat_order_type' => 'nullable|in:0,1'
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $params['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['playlet_id'] = $request->input('playlet_id', null);
- $params['closing_date'] = $request->input('closing_date', null);
- $params['plat_order_type'] = $request->input('plat_order_type', null);
- $params['cost_cover_min'] = $request->input('cost_cover_min', null);
- $params['cost_cover_max'] = $request->input('cost_cover_max', null);
- $page = $request->input('page', 1);
- $pageSize = $request->input('page_size', 20);
- $sortField = $request->input('sort_field', 'ref_date');
- $sortType = $request->input('sort_type', 'desc');
- list($count, $list, $retrieveColumns) = ShortPlayDataTrendService::adqShortPlayDataTrendList($params, $page, $pageSize, $sortField, $sortType);
- return self::returnPageValue($list, $count, $pageSize, $page, $retrieveColumns);
- }
- public function adqSummaryOfShortDramaDataTrends(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'start_date' => 'required|date',
- 'end_date' => 'required|date',
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $params['playlet_id'] = $request->input('playlet_id');
- $params['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['closing_date'] = $request->input('closing_date');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['plat_order_type'] = $request->input('plat_order_type'); // 0:小程序 1:h5
- $params['cost_cover_min'] = $request->input('cost_cover_min');
- $params['cost_cover_max'] = $request->input('cost_cover_max');
- list($data, $header) = ShortPlayDataTrendService::adqSummaryOfShortDramaDataTrends($params);
- return self::returnValue([
- 'data' => $data,
- 'header' => $header
- ]);
- }
- public function adqShortPlayDataTrendCurve(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'start_date' => 'required|date',
- 'end_date' => 'required|date',
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $params['playlet_id'] = $request->input('playlet_id');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['closing_date'] = $request->input('closing_date');
- $params['plat_order_type'] = $request->input('plat_order_type'); // 0:小程序 1:h5
- $params['cost_cover_min'] = $request->input('cost_cover_min');
- $params['cost_cover_max'] = $request->input('cost_cover_max');
- $data = ShortPlayDataTrendService::adqShortPlayDataTrendCurve($params);
- return self::returnValue(['data' => $data]);
- }
- public function mpShortPlayDataTrendList(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'start_date' => 'required|date',
- 'end_date' => 'required|date',
- 'closing_date' => 'nullable|date',
- 'page' => 'required|numeric',
- 'page_size' => 'required|numeric',
- 'playlet_id' => 'nullable|numeric',
- 'plat_order_type' => 'nullable|in:0,1'
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $params['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['playlet_id'] = $request->input('playlet_id', null);
- $params['closing_date'] = $request->input('closing_date', null);
- $params['plat_order_type'] = $request->input('plat_order_type', null);
- $params['cost_cover_min'] = $request->input('cost_cover_min', null);
- $params['cost_cover_max'] = $request->input('cost_cover_max', null);
- $page = $request->input('page', 1);
- $pageSize = $request->input('page_size', 20);
- $sortField = $request->input('sort_field', 'ref_date');
- $sortType = $request->input('sort_type', 'desc');
- list($count, $list, $retrieveColumns) = ShortPlayDataTrendService::mpShortPlayDataTrendList($params, $page, $pageSize, $sortField, $sortType);
- return self::returnPageValue($list, $count, $pageSize, $page, $retrieveColumns);
- }
- public function mpSummaryOfShortDramaDataTrends(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'start_date' => 'required|date',
- 'end_date' => 'required|date',
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $params['playlet_id'] = $request->input('playlet_id');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['closing_date'] = $request->input('closing_date');
- $params['plat_order_type'] = $request->input('plat_order_type'); // 0:小程序 1:h5
- $params['cost_cover_min'] = $request->input('cost_cover_min');
- $params['cost_cover_max'] = $request->input('cost_cover_max');
- list($data, $header) = ShortPlayDataTrendService::mpSummaryOfShortDramaDataTrends($params);
- return self::returnValue([
- 'data' => $data,
- 'header' => $header
- ]);
- }
- public function mpShortPlayDataTrendCurve(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'start_date' => 'required|date',
- 'end_date' => 'required|date',
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $params['playlet_id'] = $request->input('playlet_id');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['closing_date'] = $request->input('closing_date');
- $params['plat_order_type'] = $request->input('plat_order_type'); // 0:小程序 1:h5
- $params['cost_cover_min'] = $request->input('cost_cover_min');
- $params['cost_cover_max'] = $request->input('cost_cover_max');
- $data = ShortPlayDataTrendService::mpShortPlayDataTrendCurve($params);
- return self::returnValue(['data' => $data]);
- }
- public function shortPlayDataTrendList(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'start_date' => 'required|date',
- 'end_date' => 'required|date',
- 'closing_date' => 'nullable|date',
- 'page' => 'required|numeric',
- 'page_size' => 'required|numeric',
- 'playlet_id' => 'nullable|numeric',
- 'plat_order_type' => 'nullable|in:0,1'
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $params['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['playlet_id'] = $request->input('playlet_id', null);
- $params['closing_date'] = $request->input('closing_date', null);
- $params['plat_order_type'] = $request->input('plat_order_type', null);
- $params['cost_cover_min'] = $request->input('cost_cover_min', null);
- $params['cost_cover_max'] = $request->input('cost_cover_max', null);
- $page = $request->input('page', 1);
- $pageSize = $request->input('page_size', 20);
- $sortField = $request->input('sort_field', 'ref_date');
- $sortType = $request->input('sort_type', 'desc');
- list($count, $list, $retrieveColumns) = ShortPlayDataTrendService::shortPlayDataTrendList($params, $page, $pageSize, $sortField, $sortType);
- return self::returnPageValue($list, $count, $pageSize, $page, $retrieveColumns);
- }
- public function summaryOfShortDramaDataTrends(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'start_date' => 'required|date',
- 'end_date' => 'required|date',
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $params['playlet_id'] = $request->input('playlet_id');
- $params['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['closing_date'] = $request->input('closing_date');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['plat_order_type'] = $request->input('plat_order_type'); // 0:小程序 1:h5
- $params['cost_cover_min'] = $request->input('cost_cover_min');
- $params['cost_cover_max'] = $request->input('cost_cover_max');
- list($data, $header) = ShortPlayDataTrendService::summaryOfShortDramaDataTrends($params);
- return self::returnValue([
- 'data' => $data,
- 'header' => $header
- ]);
- }
- public function shortPlayDataTrendCurve(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'start_date' => 'required|date',
- 'end_date' => 'required|date',
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $params['playlet_id'] = $request->input('playlet_id');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['closing_date'] = $request->input('closing_date');
- $params['plat_order_type'] = $request->input('plat_order_type'); // 0:小程序 1:h5
- $params['cost_cover_min'] = $request->input('cost_cover_min');
- $params['cost_cover_max'] = $request->input('cost_cover_max');
- $data = ShortPlayDataTrendService::shortPlayDataTrendCurve($params);
- return self::returnValue(['data' => $data]);
- }
- public function shortPlayDataTrendListByAccount(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'start_date' => 'required|date',
- 'end_date' => 'required|date',
- 'closing_date' => 'nullable|date',
- 'page' => 'required|numeric',
- 'page_size' => 'required|numeric',
- 'playlet_id' => 'nullable|numeric',
- 'plat_order_type' => 'nullable|in:0,1',
- 'ad_type' => 'required|in:0,1,2'
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $params['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['playlet_id'] = $request->input('playlet_id', null);
- $params['closing_date'] = $request->input('closing_date', null);
- $params['plat_order_type'] = $request->input('plat_order_type', null);
- $params['cost_cover_min'] = $request->input('cost_cover_min', null);
- $params['cost_cover_max'] = $request->input('cost_cover_max', null);
- $params['admin_id'] = $request->input('admin_id');
- $params['is_system_admin'] = $request->input('is_system_admin');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['ad_type'] = $request->input('ad_type');
- $page = $request->input('page', 1);
- $pageSize = $request->input('page_size', 20);
- $sortField = $request->input('sort_field', 'ref_date');
- $sortType = $request->input('sort_type', 'desc');
- list($count, $list, $retrieveColumns) = ShortPlayDataTrendService::shortPlayDataTrendListByAccount($params
- , $page, $pageSize, $sortField, $sortType);
- return self::returnPageValue($list, $count, $pageSize, $page, $retrieveColumns);
- }
- public function summaryOfShortDramaDataTrendsByAccount(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'start_date' => 'required|date',
- 'end_date' => 'required|date',
- 'closing_date' => 'nullable|date',
- 'playlet_id' => 'nullable|numeric',
- 'plat_order_type' => 'nullable|in:0,1',
- 'ad_type' => 'required|in:0,1,2'
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $params['playlet_id'] = $request->input('playlet_id');
- $params['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['closing_date'] = $request->input('closing_date');
- $params['plat_order_type'] = $request->input('plat_order_type'); // 0:小程序 1:h5
- $params['cost_cover_min'] = $request->input('cost_cover_min');
- $params['cost_cover_max'] = $request->input('cost_cover_max');
- $params['admin_id'] = $request->input('admin_id');
- $params['is_system_admin'] = $request->input('is_system_admin');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['ad_type'] = $request->input('ad_type');
- list($data, $header) = ShortPlayDataTrendService::summaryOfShortDramaDataTrendsByAccount($params);
- return self::returnValue([
- 'data' => $data,
- 'header' => $header
- ]);
- }
- public function shortPlayDataTrendCurveByAccount(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'start_date' => 'required|date',
- 'end_date' => 'required|date',
- 'closing_date' => 'nullable|date',
- 'playlet_id' => 'nullable|numeric',
- 'plat_order_type' => 'nullable|in:0,1',
- 'ad_type' => 'required|in:0,1,2'
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $params['playlet_id'] = $request->input('playlet_id');
- $params['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['closing_date'] = $request->input('closing_date');
- $params['plat_order_type'] = $request->input('plat_order_type'); // 0:小程序 1:h5
- $params['cost_cover_min'] = $request->input('cost_cover_min');
- $params['cost_cover_max'] = $request->input('cost_cover_max');
- $params['admin_id'] = $request->input('admin_id');
- $params['is_system_admin'] = $request->input('is_system_admin');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['ad_type'] = $request->input('ad_type');
- $data = ShortPlayDataTrendService::shortPlayDataTrendCurveByAccount($params);
- return self::returnValue(['data' => $data]);
- }
- }
|