| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace app\admin\controller\trade;
- use app\common\controller\Backend;
- /**
- * 充值记录管理
- *
- * @icon fa fa-circle-o
- */
- class MoneyIn extends Backend
- {
- /**
- * Mongyin模型对象
- * @var \app\admin\model\trade\Mongyin
- */
- protected $model = null;
- protected $mapType = null;
- public function _initialize()
- {
- parent::_initialize();
- $this->mapType = array();
- $this->model = new \app\common\model\MoneyIn;
- $this->assign('typeList', $this->model->getTypeList());
- }
- /**
- * 查看
- * @return string|Json
- * @throws \think\Exception
- * @throws DbException
- */
- public function index()
- {
- //设置过滤方法
- $this->request->filter(['strip_tags', 'trim']);
- if (false === $this->request->isAjax()) {
- return $this->view->fetch();
- }
- //如果发送的来源是 Selectpage,则转发到 Selectpage
- if ($this->request->request('keyField')) {
- return $this->selectpage();
- }
- [$where, $sort, $order, $offset, $limit] = $this->buildparams();
- //tab
- $type = $this->request->param('order_type/d');
- if($type > 0) $this->mapType['order_type'] = $type;
-
- $list = $this->model->with('users,admins')
- ->where($where)
- ->where($this->mapType)
- ->order($sort, $order)
- ->paginate($limit);
- $result = ['total' => $list->total(), 'rows' => $list->items()];
- return json($result);
- }
- }
|