12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- namespace app\admin\controller\platprofit;
- use app\common\controller\Backend;
- class Withdrawal extends Backend
- {
-
-
- protected $model = null;
- public function _initialize()
- {
- parent::_initialize();
- $this->model = new \app\admin\model\platprofit\Withdrawal;
- }
- public function import()
- {
- parent::import();
- }
-
-
- public function index()
- {
-
- $this->request->filter(['strip_tags', 'trim']);
- if ($this->request->isAjax()) {
-
- if ($this->request->request('keyField')) {
- return $this->selectpage();
- }
- list($where, $sort, $order, $offset, $limit) = $this->buildparams();
- $filter = $this->request->request('filter');
- $wheres = json_decode($filter,true);
- $where = [];
- if(isset($wheres["createtime"])) {
- $createtime = explode(" - ",$wheres["createtime"]);
- $where["createtime"] = ["between",strtotime($createtime[0]).",".strtotime($createtime[1])];
- }
- isset($wheres["g_id"]) && $where["g_id"] = $wheres["g_id"];
- $list = $this->model
- ->field("id,sum(plat_value) as plat_value,u_id,nickname,createtime")
- ->order($sort, $order)
- ->where($where)
- ->group("u_id")
- ->select();
- $result = array("total" => 1, "rows" => $list);
- return json($result);
- }
- return $this->view->fetch();
- }
- }
|