AccountLogController.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /*
  3. * @Author: your name
  4. * @Date: 2021-04-22 17:20:17
  5. * @LastEditTime: 2021-06-22 16:34:34
  6. * @LastEditors: Please set LastEditors
  7. * @Description: In User Settings Edit
  8. * @FilePath: \10dsm\app\Http\Controllers\Admins\AccountLogController.php
  9. */
  10. namespace App\Http\Controllers\Admins;
  11. use App\Modes\AccountLog;
  12. use Illuminate\Http\Request;
  13. use App\Http\Controllers\Controller;
  14. class AccountLogController extends Controller
  15. {
  16. /**
  17. * 点币转账记录
  18. * @author lyh
  19. * @date 2019/4/9
  20. * @modify 确认已区分系统管理员与地区管理员权限
  21. * @param Request $request
  22. * @description
  23. */
  24. public function changeCoin(Request $request)
  25. {
  26. $validator = \Validator::make($param = $request->all(), [
  27. 'required' => 'id|exists:user,id',
  28. ]);
  29. if ($validator->fails()) {
  30. return showJsonErr($validator->errors()->first());
  31. }
  32. // 区分系统管理员与地区管理员数据-2019-4-26 11:26:31
  33. if (\Auth::user()->is_super == 3 && !in_array($param['id'], getIds())) {
  34. return showJsonErr('抱歉,您没有权限查看该用户信息');
  35. }
  36. $result = AccountLog::whereUid($param['id'])
  37. //->whereIn('type', [3, 2])
  38. ->whereIn('type', [31, 30,32,45])
  39. ->whereStatus(1)
  40. ->select(['id', 'uid','source_uid','money', 'created_at', 'type','remark'])
  41. ->orderBy('created_at','desc')
  42. ->paginate(perPage());
  43. return showJsonSucc(1001, $result);
  44. }
  45. /*
  46. * 代理费缴费记录
  47. * wsl
  48. * 20190807
  49. * */
  50. public function agentPayLog(Request $request){
  51. $validator = \Validator::make($param = $request->all(), [
  52. 'required' => 'id|exists:user,id',
  53. ]);
  54. if ($validator->fails()) {
  55. return showJsonErr($validator->errors()->first());
  56. }
  57. // 区分系统管理员与地区管理员数据-2019-4-26 11:26:31
  58. if (\Auth::user()->is_super == 3 && !in_array($param['id'], getIds())) {
  59. return showJsonErr('抱歉,您没有权限查看该用户信息');
  60. }
  61. $result = AccountLog::whereUid($param['id'])
  62. //->whereIn('type', [3, 2])
  63. ->whereIn('type', [7, 8])
  64. ->whereStatus(1)
  65. ->select(['id', 'uid', 'money', 'created_at', 'type'])
  66. ->orderBy('created_at','desc')
  67. ->paginate(perPage());
  68. return showJsonSucc(1001, $result);
  69. }
  70. }