1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- /**
- * Created by:PhpStorm
- * Author:chenzhiyuan
- * Date: 2022/4/23
- * Time: 8:08 下午
- */
- namespace App\Http\Controllers\Api\Report;
- use App\Http\Controllers\Controller;
- use App\Service\Report\AdvertiserService;
- use Illuminate\Http\Request;
- class AdvertiserController extends Controller
- {
- /**
- * 循环数据报表
- * @param Request $request
- */
- public function reg_range_report(Request $request){
- $validator = \Validator::make($request->all(),[
- 'begin_date' => 'required',
- 'end_date' => 'required',
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $cropid_str = ""; //$request->input("corpid",""); //暂时不支持根据公司ID查询
- $page = $request->input("page",1);
- $page_size = $request->input("page_size",20);
- $begin_date = $request->input("begin_date");
- $end_date = $request->input("end_date");
- $sysGroupId = $request->input('sys_group_id');
- list($total,$list,$head) = AdvertiserService::user_reg_range($cropid_str,$begin_date,$end_date,$page,$page_size, $sysGroupId);
- return self::returnPageValue(['head'=>$head,'list'=>$list],$total,$page_size,$page);
- }
- public function reg_range_report_new(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'begin_date' => 'required',
- 'end_date' => 'required',
- 'first_order_cost_min' => 'nullable|numeric',
- 'first_order_cost_max' => 'nullable|numeric',
- 'first_order_cost_unique_min' => 'nullable|numeric',
- 'first_order_cost_unique_max' => 'nullable|numeric',
- 'per_follow_cost_min' => 'nullable|numeric',
- 'per_follow_cost_max' => 'nullable|numeric',
- 'total_roi_min' => 'nullable|numeric',
- 'total_roi_max' => 'nullable|numeric',
- 'first_day_roi_min' => 'nullable|numeric',
- 'first_day_roi_max' => 'nullable|numeric'
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $page = $request->input("page",1);
- $pageSize = $request->input("page_size",20);
- $beginDate = $request->input("begin_date");
- $endDate = $request->input("end_date");
- $sysGroupId = $request->input('sys_group_id');
- $firstOrderCostMin = $request->input('first_order_cost_min', null);
- $firstOrderCostMax = $request->input('first_order_cost_max', null);
- $firstOrderCostUniqueMin= $request->input('first_order_cost_unique_min', null);
- $firstOrderCostUniqueMax= $request->input('first_order_cost_unique_max', null);
- $perFollowCostMin = $request->input('per_follow_cost_min', null);
- $perFollowCostMax = $request->input('per_follow_cost_max', null);
- $totalRoiMin = $request->input('total_roi_min', null);
- $totalRoiMax = $request->input('total_roi_max', null);
- $firstDayRoiMin = $request->input('first_day_roi_min', null);
- $firstDayRoiMax = $request->input('first_day_roi_max', null);
- list($total,$list,$head) = AdvertiserService::userRegRangeNew(
- $beginDate,$endDate,$page,$pageSize, $sysGroupId, $firstOrderCostMin, $firstOrderCostMax,
- $firstOrderCostUniqueMin, $firstOrderCostUniqueMax, $perFollowCostMin, $perFollowCostMax,
- $totalRoiMin, $totalRoiMax, $firstDayRoiMin, $firstDayRoiMax);
- return self::returnPageValue(['head'=>$head,'list'=>$list],$total,$pageSize,$page);
- }
- }
|