Agent.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. *
  4. * User: anyluck
  5. * Date: 2020/6/2
  6. * Time: 17:36
  7. */
  8. namespace app\admin\controller;
  9. use app\common\controller\Backend;
  10. use app\common\model\UserLevel;
  11. use think\facade\Db;
  12. use think\facade\Request;
  13. use think\facade\View;
  14. class Agent extends Backend
  15. {
  16. // 代理商
  17. /**
  18. * 代理商列表
  19. */
  20. public function index()
  21. {
  22. if (Request::isPost()) {
  23. $keys = Request::post('keys', '', 'trim');
  24. $page = Request::post('page') ? Request::post('page') : 1;
  25. $limit=input("limit")?:10;
  26. $where["is_admin"]=1;
  27. $list = Db::name('user')
  28. ->where('mail|phone|name','like',"%".$keys."%")
  29. ->where($where)
  30. ->order('id desc')
  31. ->paginate(['list_rows' =>$limit, 'page' => $page])
  32. ->toArray();
  33. foreach ($list['data'] as $k=>$v){
  34. if ($v['update_time']){
  35. $list['data'][$k]['update_time'] = date('Y-m-d H:i',$v['update_time']);
  36. }
  37. }
  38. return $result = ['code' => 0, 'msg' => lang('get info success'), 'data' => $list['data'], 'count' => $list['total']];
  39. }
  40. $vip=UserLevel::select();
  41. View::assign("vip",$vip);
  42. return View::fetch();
  43. }
  44. /**
  45. * 代理商详情
  46. */
  47. public function show()
  48. {
  49. }
  50. /**
  51. * 停用代理商
  52. */
  53. public function update_status()
  54. {
  55. }
  56. /**
  57. * 下级用户列表
  58. */
  59. public function xiaji()
  60. {
  61. }
  62. /**
  63. * 代理充值
  64. */
  65. public function chongzhi()
  66. {
  67. }
  68. }