<?php

namespace app\user\controller;

use app\common\controller\Frontend;
use app\common\library\Ems;
use app\common\library\Sms;
use app\home\model\GoodsOrder;
use hehe\Network;
use hehe\Trade;
use think\Config;
use think\Cookie;
use think\Db;
use think\Hook;
use think\Validate;

class Bill extends Frontend {

    protected $layout = 'default';

    protected $noNeedRight = '*';
    protected $noNeedLogin = [];


    public function _initialize() {
        parent::_initialize(); // TODO: Change the autogenerated stub

        if (!Config::get('fastadmin.usercenter')) {
            $this->error(__('User center already closed'), '/');
        }

        if (!$this->request->isPjax()) {
            $this->view->engine->layout('default/layout/' . $this->layout);

        }

    }


    public function index() {

        $list = db::name('bill')->where(['user_id' => $this->user['id']])->order('id desc')->paginate(10);

        $this->assign([
            'list' => $list
        ]);

        return view('default/bill/index');
    }



}
