123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- <?php
- namespace App\Http\Controllers\Api;
- use App\Service\ActiveFansTrendService;
- use Illuminate\Http\Request;
- use App\Http\Controllers\Controller;
- class ActiveFansDataController extends Controller
- {
- /**
- * ADQ投放粉丝激活趋势列表
- * */
- public function adqAccount(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['account_id'] = $request->input('account_id');
- $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['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');
- $sortField = $request->input('sort_field', 'account_id');
- $sortType = $request->input('sort_type', 'desc'); // 排序方式
- $page = $request->input('page', 1);
- $pageSize = $request->input('page_size', 10);
- list($list, $count, $retrieveColumns) = ActiveFansTrendService::getAdqActiveFansTrend(
- $params, $sortField, $sortType, $page, $pageSize
- );
- return self::returnPageValue($list, $count, $pageSize, $page, $retrieveColumns);
- }
- /**
- * ADQ投放粉丝激活趋势汇总
- * */
- public function adqAccountSummary(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['account_id'] = $request->input('account_id');
- $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['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) = ActiveFansTrendService::getAdqFansActiveSummary($params);
- return self::returnValue([
- 'data' => $data,
- 'header' => $header
- ]);
- }
- /**
- * Adq账号粉丝激活趋势曲线
- * */
- public function adqAccountCurve(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['account_id'] = $request->input('account_id');
- $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['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');
- $data = ActiveFansTrendService::getAdqActiveFansCurve($params);
- return self::returnValue(['data' => $data]);
- }
- /**
- * MP投放粉丝激活趋势列表
- * */
- public function mpAccount(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['app_id'] = $request->input('app_id');
- $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['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');
- $sortField = $request->input('sort_field', 'account_id');
- $sortType = $request->input('sort_type', 'desc'); // 排序方式
- $page = $request->input('page', 1);
- $pageSize = $request->input('page_size', 10);
- list($list, $count, $retrieveColumns) = ActiveFansTrendService::getMpActiveFansTrend(
- $params, $sortField, $sortType, $page, $pageSize
- );
- return self::returnPageValue($list, $count, $pageSize, $page, $retrieveColumns);
- }
- /**
- * MP投放粉丝激活趋势汇总
- * */
- public function mpAccountSummary(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['app_id'] = $request->input('app_id');
- $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['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) = ActiveFansTrendService::getMpFansActiveSummary($params);
- return self::returnValue([
- 'data' => $data,
- 'header' => $header
- ]);
- }
- /**
- * Mp账号粉丝激活趋势曲线
- * */
- public function mpAccountCurve(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['app_id'] = $request->input('app_id');
- $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['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');
- $data = ActiveFansTrendService::getMpActiveFansCurve($params);
- return self::returnValue(['data' => $data]);
- }
- /**
- * 粉丝激活趋势(ADQ+MP)
- * */
- public function account(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['account_id'] = $request->input('account_id');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['admin_id'] = $request->input('admin_id');
- $params['is_system_admin'] = $request->input('is_system_admin');
- $params['ad_type'] = $request->input('ad_type', 1);
- $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');
- $sortField = $request->input('sort_field', '_key');
- $sortType = $request->input('sort_type', 'desc'); // 排序方式
- $page = $request->input('page', 1);
- $pageSize = $request->input('page_size', 10);
- list($list, $count, $retrieveColumns) = ActiveFansTrendService::getActiveFansTrend(
- $params, $sortField, $sortType, $page, $pageSize
- );
- return self::returnPageValue($list, $count, $pageSize, $page, $retrieveColumns);
- }
- /**
- * 投放粉丝激活趋势汇总(ADQ+MP)
- * */
- public function accountSummary(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['account_id'] = $request->input('account_id');
- $params['playlet_id'] = $request->input('playlet_id');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['admin_id'] = $request->input('admin_id');
- $params['is_system_admin'] = $request->input('is_system_admin');
- $params['ad_type'] = $request->input('ad_type', 1);
- $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) = ActiveFansTrendService::getFansActiveSummary($params);
- return self::returnValue([
- 'data' => $data,
- 'header' => $header
- ]);
- }
- /**
- * Adq账号粉丝激活趋势曲线
- * */
- public function accountCurve(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['account_id'] = $request->input('account_id');
- $params['playlet_id'] = $request->input('playlet_id');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['admin_id'] = $request->input('admin_id');
- $params['is_system_admin'] = $request->input('is_system_admin');
- $params['ad_type'] = $request->input('ad_type', 1);
- $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 = ActiveFansTrendService::getActiveFansCurve($params);
- return self::returnValue(['data' => $data]);
- }
- }
|