<?php namespace Phpcmf\Controllers;

// 我的交易记录
class Show extends \Phpcmf\Table {

    public function index() {

        $id = (int)\Phpcmf\Service::L('Input')->get('id');
        $fid = (int)\Phpcmf\Service::L('Input')->get('fid');
        !$fid && exit(dr_lang('支付字段id不存在'));

        $field = $this->get_cache('table-field', $fid);
        !$field && exit(dr_lang('支付字段不存在'));

        $rt = \Phpcmf\Service::M('Pay')->get_pay_info($id, $field);
        isset($rt['code']) && !$rt['code'] && exit($rt['msg']);

        list($table, $id) = explode('-', $rt['mid']);

        $this->_init([
            'table' => 'member_paylog',
            'order_by' => 'inputtime desc',
            'where_list' => '`touid`='.$rt['touid'].' and `mid` LIKE "'.$table.'-'.$id.'-%"',
            'date_field' => 'inputtime',
        ]);

        $this->_List();

        \Phpcmf\Service::V()->admin();
        \Phpcmf\Service::V()->assign('data', $rt['data']);
        \Phpcmf\Service::V()->display('show.html');exit;

    }
}
