BlackListController.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use App\Http\Resources\Admin\RiskListCollection;
  4. use App\Models\BlackListModel;
  5. use App\Models\RiskListModel;
  6. use Illuminate\Http\Request;
  7. use App\Http\Controllers\Controller;
  8. class BlackListController extends Controller
  9. {
  10. //
  11. /**
  12. * 风险列表
  13. * @param Request $request
  14. */
  15. public function riskList(Request $request)
  16. {
  17. $risks = RiskListModel::paginate($request->input("per_page", 20));
  18. foreach ($risks as $risk) {
  19. $risk->uid_verify = BlackListModel::where('account_type', 'uid')->where(
  20. 'account',
  21. $risk->phone
  22. )->first() ? true : false;
  23. $risk->phone_verify = BlackListModel::where('account_type', 'phone')->where(
  24. 'account',
  25. $risk->phone
  26. )->first() ? true : false;
  27. $risk->weixin_verify = BlackListModel::where('account_type', 'weixin')->where(
  28. 'account',
  29. $risk->weixin
  30. )->first() ? true : false;
  31. $risk->qq_verify = BlackListModel::where('account_type', 'qq')->where(
  32. 'account',
  33. $risk->qq
  34. )->first() ? true : false;
  35. }
  36. return new RiskListCollection($risks);
  37. }
  38. }