1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- namespace app\admin\controller\cash;
- use app\common\controller\Backend;
- class Cashlog extends Backend
- {
-
-
- protected $model = null;
- public function _initialize()
- {
- parent::_initialize();
- $this->model = new \app\admin\model\cash\Cashlog;
- }
-
-
-
-
- public function index()
- {
-
- $this->relationSearch = true;
-
- $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();
- $total = $this->model
- ->with(['users'])
- ->where($where)
- ->order($sort, $order)
- ->count();
- $list = $this->model
- ->with(['users'])
- ->where($where)
- ->order($sort, $order)
- ->limit($offset, $limit)
- ->select();
- foreach ($list as $row) {
- $row->visible(['t_id','user_id','money','state','create_time','number','reason','admin_look']);
- $row->visible(['users']);
- $row->getRelation('users')->visible(['user_nickname','user_tel','user_avatar']);
- }
- $list = collection($list)->toArray();
- $result = array("total" => $total, "rows" => $list);
- return json($result);
- }
- return $this->view->fetch();
- }
- }
|