企微短剧业务系统

ProvisionalStatController.php 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace App\Http\Controllers\Api;
  3. use App\Service\ProvisionalStatService;
  4. use Illuminate\Http\Request;
  5. use App\Http\Controllers\Controller;
  6. class ProvisionalStatController extends Controller
  7. {
  8. /**
  9. * 需要临时统计公众号列表
  10. * */
  11. public function wxAccountList(Request $request)
  12. {
  13. $keyword = $request->input('keyword');
  14. $isSelect = $request->input('is_select', 0);
  15. $page = $request->input('page', 1);
  16. $pageSize = $request->input('page_size', 20);
  17. $sysGroupId = $request->input('sys_group_id');
  18. if (!$isSelect) {
  19. list($list, $total) = ProvisionalStatService::wxAccountList($keyword, $isSelect, $page, $pageSize, $sysGroupId);
  20. return self::returnPageValue($list, $total, $pageSize, $page);
  21. } else {
  22. $res = ProvisionalStatService::wxAccountList($keyword, $isSelect, $page, $pageSize, $sysGroupId);
  23. return self::returnValue($res);
  24. }
  25. }
  26. /**
  27. * 需要临时统计ADQ账号列表
  28. * */
  29. public function adqAccountList(Request $request)
  30. {
  31. $keyword = $request->input('keyword');
  32. $isSelect = $request->input('is_select', 0);
  33. $page = $request->input('page', 1);
  34. $pageSize = $request->input('page_size', 20);
  35. $sysGroupId = $request->input('sys_group_id');
  36. if(!$isSelect) {
  37. list($list, $total) = ProvisionalStatService::adqAccountList($keyword, $isSelect, $page, $pageSize, $sysGroupId);
  38. return self::returnPageValue($list, $total, $pageSize, $page);
  39. } else {
  40. $res = ProvisionalStatService::adqAccountList($keyword, $isSelect, $page, $pageSize, $sysGroupId);
  41. return self::returnValue($res);
  42. }
  43. }
  44. /**
  45. * MP账号绑定ADQ账号
  46. * */
  47. public function bind(Request $request)
  48. {
  49. $validator = \Validator::make($request->all(),[
  50. 'app_id' => 'required|string',
  51. 'account_id' => 'required|string',
  52. ]);
  53. if ($validator->fails()) {
  54. return self::returnValue($validator->getMessageBag(), 3001);
  55. }
  56. $sysGroupId = $request->input('sys_group_id');
  57. $appId = $request->input('app_id');
  58. $accountIds = $request->input('account_id');
  59. $adType = $request->input('ad_type', 2);
  60. # 账号关系绑定
  61. $errno = ProvisionalStatService::bindAccount($sysGroupId, $appId, $accountIds, $adType);
  62. return self::returnValue([], $errno);
  63. }
  64. }