Moneylog.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. namespace app\admin\controller\txjl;
  3. use app\common\controller\Backend;
  4. use think\Db;
  5. /**
  6. * 会员管理
  7. *
  8. * @icon fa fa-user
  9. */
  10. class Moneylog extends Backend
  11. {
  12. protected $relationSearch = true;
  13. /**
  14. * @var \app\admin\model\User
  15. */
  16. protected $model = null;
  17. public function _initialize()
  18. {
  19. parent::_initialize();
  20. $this->model = model('MoneyLog');
  21. }
  22. /**
  23. * 查看
  24. */
  25. public function index()
  26. {
  27. //设置过滤方法
  28. $this->request->filter(['strip_tags']);
  29. if ($this->request->isAjax()) {
  30. //如果发送的来源是Selectpage,则转发到Selectpage
  31. if ($this->request->request('keyField')) {
  32. return $this->selectpage();
  33. }
  34. list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  35. $total = $this->model
  36. ->with('user')
  37. ->where($where)
  38. ->order($sort, $order)
  39. ->count();
  40. $list = $this->model
  41. ->with('user')
  42. ->where($where)
  43. ->order($sort, $order)
  44. ->limit($offset, $limit)
  45. ->select();
  46. $result = array("total" => $total, "rows" => $list);
  47. return json($result);
  48. }
  49. return $this->view->fetch();
  50. }
  51. /**
  52. * 编辑
  53. */
  54. public function edit($ids = NULL)
  55. {
  56. $row = $this->model->get($ids);
  57. if (!$row)
  58. $this->error(__('No Results were found'));
  59. if ($this->request->isPost()) {
  60. $params = $this->request->post("row/a");
  61. if($params['iscl']==3 and $row['iscl']!=3){
  62. $this->bohui($row['uid'],$row['money'],'提现驳回');
  63. }
  64. }
  65. return parent::edit($ids);
  66. }
  67. public function add()
  68. {
  69. return parent::add();
  70. }
  71. public function info($pid = NULL)
  72. {
  73. $row = $this->model->get($pid);
  74. if (!$row)
  75. $this->error(__('No Results were found'));
  76. return parent::edit($pid);
  77. }
  78. }