<commit_before><?php

class Controller_Items extends Controller_Frontend {

    // 商品列表
    public function action_index() {

        $options = [
            'cateId'  => $this->param('cate_id'),
            'brandId' => $this->param('brand_id'),
            'sort'    => $this->param('sort'),
            'page'    => intval($this->param('page')) ? intval($this->param('page')) : 1,
            ];

        $itemModel = new Model_Item();

        $url        = $itemModel->handleUrl($options) . '/p';
        $total      = $itemModel->countItem($options, true);
        $paramCount = $itemModel->countParam($options);

        $page = new \Helper\Page();
        $config = $page->setConfig($url, $total, $paramCount);
        $pagination = Pagination::forge('mypagination', $config);

        $items = $itemModel->index($options);

        $view = ViewModel::forge('items/index');
        $view->set('items', $items);
        $view->set('pagination', $pagination);
        $this->template->title = "所有商品";
        $this->template->layout = $view;
    }

    // 商品详情
    public function action_view($id = null) {

        $itemModel = new Model_Item();
        $item = $itemModel->view($id);

        //$prevWinner = $itemModel->prevWinner($item->id);
        $prevWinner = [];

        $view = ViewModel::forge('items/view');
        $view->set('item', $item, false);
        $view->set('prevWinner', $prevWinner);
        $this->template->layout = $view;
    }

}<commit_msg>fixbug<commit_after><?php

class Controller_Items extends Controller_Frontend {

    // 商品列表
    public function action_index() {

        $options = [
            'cateId'  => $this->param('cate_id'),
            'brandId' => $this->param('brand_id'),
            'sort'    => $this->param('sort'),
            'page'    => intval($this->param('page')) ? intval($this->param('page')) : 1,
            ];

        $itemModel = new Model_Item();

        $url        = $itemModel->handleUrl($options) . '/p';
        $total      = $itemModel->countItem($options, true);
        $paramCount = $itemModel->countParam($options);

        $page = new \Helper\Page();
        $config = $page->setConfig($url, $total, $paramCount);
        $pagination = Pagination::forge('mypagination', $config);

        $items = $itemModel->index($options);

        $view = ViewModel::forge('items/index');
        $view->set('items', $items);
        $view->set('pagination', $pagination);
        $this->template->title = "所有商品";
        $this->template->layout = $view;
    }

    // 商品详情
    public function action_view($id = null) {

        $itemModel = new Model_Item();
        $item = $itemModel->view($id);

        //$prevWinner = $itemModel->prevWinner($item->id);
        $prevWinner = [];

        $view = ViewModel::forge('items/view');
        $view->set('item', $item, false);
        $view->set('prevWinner', $prevWinner);
        $this->template->title = '(第'.$item->phase->phase_id.'期)' . $item->phase->title;
        $this->template->layout = $view;
    }

}
{'fraction_non_alphanumeric': 0.19420671494404212, 'fraction_numerical': 0.0006583278472679394, 'mean_word_length': 2.3804226918798665, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6328717', 'n_tokens_mistral': 975, 'n_tokens_neox': 950, 'n_words': 153}