123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <?php
- namespace App\Http\Controllers\Api;
- use App\Service\OperateDataService;
- use Illuminate\Http\Request;
- use App\Http\Controllers\Controller;
- class OperateController extends Controller
- {
- /**
- * 运营公众号数据
- * */
- public function accountData(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['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['operator_id'] = $request->input('operator_id');
- $params['app_id'] = $request->input('app_id');
- $params['closing_date'] = $request->input('closing_date');
- $params['sys_group_id'] = $request->input('sys_group_id');
- $params['is_system_admin'] = $request->input('is_system_admin');
- $params['admin_id'] = $request->input('admin_id');
- $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) = OperateDataService::getAccountData(
- $params, $sortField, $sortType, $page, $pageSize
- );
- return self::returnPageValue($list, $count, $pageSize, $page, $retrieveColumns);
- }
- /**
- * 运营公众号数据汇总
- * */
- public function accountDataSummary(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['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['operator_id'] = $request->input('operator_id');
- $params['app_id'] = $request->input('app_id');
- $params['closing_date'] = $request->input('closing_date');
- $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');
- list($data, $header) = OperateDataService::getAccountDataSummary($params);
- return self::returnValue([
- 'data' => $data,
- 'header' => $header
- ]);
- }
- /**
- * 运营数据
- * */
- public function data(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['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['operator_id'] = $request->input('operator_id');
- $params['closing_date'] = $request->input('closing_date');
- $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');
- $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) = OperateDataService::getOperateData(
- $params, $sortField, $sortType, $page, $pageSize
- );
- return self::returnPageValue($list, $count, $pageSize, $page, $retrieveColumns);
- }
- /**
- * 运营数据汇总
- * */
- public function dataSummary(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['start_date'] = $request->input('start_date');
- $params['end_date'] = $request->input('end_date');
- $params['operator_id'] = $request->input('operator_id');
- $params['closing_date'] = $request->input('closing_date');
- $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');
- list($data, $header) = OperateDataService::getOperateDataSummary($params);
- return self::returnValue([
- 'data' => $data,
- 'header' => $header
- ]);
- }
- }
|