企微短剧业务系统

AdvertiserController.php 3.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. /**
  3. * Created by:PhpStorm
  4. * Author:chenzhiyuan
  5. * Date: 2022/4/23
  6. * Time: 8:08 下午
  7. */
  8. namespace App\Http\Controllers\Api\Report;
  9. use App\Http\Controllers\Controller;
  10. use App\Service\Report\AdvertiserService;
  11. use Illuminate\Http\Request;
  12. class AdvertiserController extends Controller
  13. {
  14. /**
  15. * 循环数据报表
  16. * @param Request $request
  17. */
  18. public function reg_range_report(Request $request){
  19. $validator = \Validator::make($request->all(),[
  20. 'begin_date' => 'required',
  21. 'end_date' => 'required',
  22. ]);
  23. if ($validator->fails()) {
  24. return self::returnValue($validator->getMessageBag(), 1102);
  25. }
  26. $cropid_str = ""; //$request->input("corpid",""); //暂时不支持根据公司ID查询
  27. $page = $request->input("page",1);
  28. $page_size = $request->input("page_size",20);
  29. $begin_date = $request->input("begin_date");
  30. $end_date = $request->input("end_date");
  31. $sysGroupId = $request->input('sys_group_id');
  32. list($total,$list,$head) = AdvertiserService::user_reg_range($cropid_str,$begin_date,$end_date,$page,$page_size, $sysGroupId);
  33. return self::returnPageValue(['head'=>$head,'list'=>$list],$total,$page_size,$page);
  34. }
  35. public function reg_range_report_new(Request $request)
  36. {
  37. $validator = \Validator::make($request->all(),[
  38. 'begin_date' => 'required',
  39. 'end_date' => 'required',
  40. 'first_order_cost_min' => 'nullable|numeric',
  41. 'first_order_cost_max' => 'nullable|numeric',
  42. 'first_order_cost_unique_min' => 'nullable|numeric',
  43. 'first_order_cost_unique_max' => 'nullable|numeric',
  44. 'per_follow_cost_min' => 'nullable|numeric',
  45. 'per_follow_cost_max' => 'nullable|numeric',
  46. 'total_roi_min' => 'nullable|numeric',
  47. 'total_roi_max' => 'nullable|numeric',
  48. 'first_day_roi_min' => 'nullable|numeric',
  49. 'first_day_roi_max' => 'nullable|numeric'
  50. ]);
  51. if ($validator->fails()) {
  52. return self::returnValue($validator->getMessageBag(), 1102);
  53. }
  54. $page = $request->input("page",1);
  55. $pageSize = $request->input("page_size",20);
  56. $beginDate = $request->input("begin_date");
  57. $endDate = $request->input("end_date");
  58. $sysGroupId = $request->input('sys_group_id');
  59. $firstOrderCostMin = $request->input('first_order_cost_min', null);
  60. $firstOrderCostMax = $request->input('first_order_cost_max', null);
  61. $firstOrderCostUniqueMin= $request->input('first_order_cost_unique_min', null);
  62. $firstOrderCostUniqueMax= $request->input('first_order_cost_unique_max', null);
  63. $perFollowCostMin = $request->input('per_follow_cost_min', null);
  64. $perFollowCostMax = $request->input('per_follow_cost_max', null);
  65. $totalRoiMin = $request->input('total_roi_min', null);
  66. $totalRoiMax = $request->input('total_roi_max', null);
  67. $firstDayRoiMin = $request->input('first_day_roi_min', null);
  68. $firstDayRoiMax = $request->input('first_day_roi_max', null);
  69. list($total,$list,$head) = AdvertiserService::userRegRangeNew(
  70. $beginDate,$endDate,$page,$pageSize, $sysGroupId, $firstOrderCostMin, $firstOrderCostMax,
  71. $firstOrderCostUniqueMin, $firstOrderCostUniqueMax, $perFollowCostMin, $perFollowCostMax,
  72. $totalRoiMin, $totalRoiMax, $firstDayRoiMin, $firstDayRoiMax);
  73. return self::returnPageValue(['head'=>$head,'list'=>$list],$total,$pageSize,$page);
  74. }
  75. }