Detailedbonus.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <?php
  2. namespace app\admin\controller\bonus;
  3. use app\common\controller\Backend;
  4. /**
  5. *
  6. *
  7. * @icon fa fa-circle-o
  8. */
  9. class Detailedbonus extends Backend
  10. {
  11. /**
  12. * Detailedbonus模型对象
  13. * @var \app\admin\model\Detailedbonus
  14. */
  15. protected $model = null;
  16. public function _initialize()
  17. {
  18. parent::_initialize();
  19. $this->model = new \app\admin\model\Detailedbonus;
  20. }
  21. /**
  22. * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
  23. * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
  24. * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
  25. */
  26. /**
  27. * 查看
  28. */
  29. public function index()
  30. {
  31. //当前是否为关联查询
  32. $this->relationSearch = false;
  33. //设置过滤方法
  34. $this->request->filter(['strip_tags']);
  35. if ($this->request->isAjax())
  36. {
  37. //如果发送的来源是Selectpage,则转发到Selectpage
  38. if ($this->request->request('keyField'))
  39. {
  40. return $this->selectpage();
  41. }
  42. list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  43. $total = $this->model
  44. ->where($where)
  45. ->order($sort, $order)
  46. ->count();
  47. $list = $this->model
  48. ->where($where)
  49. ->order($sort, $order)
  50. ->limit($offset, $limit)
  51. ->select();
  52. foreach ($list as $row) {
  53. $row->visible(['id','type','money','balance','create_time','remark','user_name','relevant_name']);
  54. }
  55. $list = collection($list)->toArray();
  56. $result = array("total" => $total, "rows" => $list);
  57. return json($result);
  58. }
  59. $list=db('money_type')->where('status',1)->column('name','identification');
  60. $this->view->assign('moneytype', $list);
  61. $this->assign("group",'bonus');
  62. return $this->view->fetch();
  63. }
  64. function cash()
  65. {
  66. //当前是否为关联查询
  67. $this->relationSearch = false;
  68. //设置过滤方法
  69. $this->request->filter(['strip_tags']);
  70. if ($this->request->isAjax())
  71. {
  72. //如果发送的来源是Selectpage,则转发到Selectpage
  73. if ($this->request->request('keyField'))
  74. {
  75. return $this->selectpage();
  76. }
  77. list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  78. $total = db('detailed_cash')
  79. ->where($where)
  80. ->order($sort, $order)
  81. ->count();
  82. $list = db('detailed_cash')
  83. ->where($where)
  84. ->order($sort, $order)
  85. ->limit($offset, $limit)
  86. ->select();
  87. $result = array("total" => $total, "rows" => $list, "where" => $order);
  88. return json($result);
  89. }
  90. $list=db('money_type')->where('status',1)->column('name','identification');
  91. $this->view->assign('moneytype', $list);
  92. $this->assign("group",'cash');
  93. return $this->view->fetch('index');
  94. }
  95. function shopping()
  96. {
  97. //当前是否为关联查询
  98. $this->relationSearch = false;
  99. //设置过滤方法
  100. $this->request->filter(['strip_tags']);
  101. if ($this->request->isAjax())
  102. {
  103. //如果发送的来源是Selectpage,则转发到Selectpage
  104. if ($this->request->request('keyField'))
  105. {
  106. return $this->selectpage();
  107. }
  108. list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  109. $total = db('detailed_shopping')
  110. ->where($where)
  111. ->order($sort, $order)
  112. ->count();
  113. $list = db('detailed_shopping')
  114. ->where($where)
  115. ->order($sort, $order)
  116. ->limit($offset, $limit)
  117. ->select();
  118. $result = array("total" => $total, "rows" => $list, "where" => $order);
  119. return json($result);
  120. }
  121. $list=db('money_type')->where('status',1)->column('name','identification');
  122. $this->view->assign('moneytype', $list);
  123. $this->assign("group",'shopping');
  124. return $this->view->fetch('index');
  125. }
  126. function integral()
  127. {
  128. //当前是否为关联查询
  129. $this->relationSearch = false;
  130. //设置过滤方法
  131. $this->request->filter(['strip_tags']);
  132. if ($this->request->isAjax())
  133. {
  134. //如果发送的来源是Selectpage,则转发到Selectpage
  135. if ($this->request->request('keyField'))
  136. {
  137. return $this->selectpage();
  138. }
  139. list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  140. $total = db('detailed_integral')
  141. ->where($where)
  142. ->order($sort, $order)
  143. ->count();
  144. $list = db('detailed_integral')
  145. ->where($where)
  146. ->order($sort, $order)
  147. ->limit($offset, $limit)
  148. ->select();
  149. $result = array("total" => $total, "rows" => $list, "where" => $order);
  150. return json($result);
  151. }
  152. $list=db('money_type')->where('status',1)->column('name','identification');
  153. $this->view->assign('moneytype', $list);
  154. $this->assign("group",'integral');
  155. return $this->view->fetch('index');
  156. }
  157. function score()
  158. {
  159. //当前是否为关联查询
  160. $this->relationSearch = false;
  161. //设置过滤方法
  162. $this->request->filter(['strip_tags']);
  163. if ($this->request->isAjax())
  164. {
  165. //如果发送的来源是Selectpage,则转发到Selectpage
  166. if ($this->request->request('keyField'))
  167. {
  168. return $this->selectpage();
  169. }
  170. list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  171. $total = db('detailed_score')
  172. ->where($where)
  173. ->order($sort, $order)
  174. ->count();
  175. $list = db('detailed_score')
  176. ->where($where)
  177. ->order($sort, $order)
  178. ->limit($offset, $limit)
  179. ->select();
  180. $result = array("total" => $total, "rows" => $list, "where" => $order);
  181. return json($result);
  182. }
  183. $list=db('money_type')->where('status',1)->column('name','identification');
  184. $this->view->assign('moneytype', $list);
  185. $this->assign("group",'score');
  186. return $this->view->fetch('index');
  187. }
  188. function nodereward()
  189. {
  190. return $this->view->fetch('nodereward');
  191. }
  192. }