12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- namespace App\Http\Controllers\Api;
- use App\Service\ProvisionalStatService;
- use Illuminate\Http\Request;
- use App\Http\Controllers\Controller;
- class ProvisionalStatController extends Controller
- {
- /**
- * 需要临时统计公众号列表
- * */
- public function wxAccountList(Request $request)
- {
- $keyword = $request->input('keyword');
- $isSelect = $request->input('is_select', 0);
- $page = $request->input('page', 1);
- $pageSize = $request->input('page_size', 20);
- $sysGroupId = $request->input('sys_group_id');
- if (!$isSelect) {
- list($list, $total) = ProvisionalStatService::wxAccountList($keyword, $isSelect, $page, $pageSize, $sysGroupId);
- return self::returnPageValue($list, $total, $pageSize, $page);
- } else {
- $res = ProvisionalStatService::wxAccountList($keyword, $isSelect, $page, $pageSize, $sysGroupId);
- return self::returnValue($res);
- }
- }
- /**
- * 需要临时统计ADQ账号列表
- * */
- public function adqAccountList(Request $request)
- {
- $keyword = $request->input('keyword');
- $isSelect = $request->input('is_select', 0);
- $page = $request->input('page', 1);
- $pageSize = $request->input('page_size', 20);
- $sysGroupId = $request->input('sys_group_id');
- if(!$isSelect) {
- list($list, $total) = ProvisionalStatService::adqAccountList($keyword, $isSelect, $page, $pageSize, $sysGroupId);
- return self::returnPageValue($list, $total, $pageSize, $page);
- } else {
- $res = ProvisionalStatService::adqAccountList($keyword, $isSelect, $page, $pageSize, $sysGroupId);
- return self::returnValue($res);
- }
- }
- /**
- * MP账号绑定ADQ账号
- * */
- public function bind(Request $request)
- {
- $validator = \Validator::make($request->all(),[
- 'app_id' => 'required|string',
- 'account_id' => 'required|string',
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 3001);
- }
- $sysGroupId = $request->input('sys_group_id');
- $appId = $request->input('app_id');
- $accountIds = $request->input('account_id');
- $adType = $request->input('ad_type', 2);
- # 账号关系绑定
- $errno = ProvisionalStatService::bindAccount($sysGroupId, $appId, $accountIds, $adType);
- return self::returnValue([], $errno);
- }
- }
|