Onex ecstore后台添加打印

/ 0评 / 0

Onex ecstore后台添加打印相关处理方法如下:

by-xiao酱沫

@Author:  875358601@qq.com @DateTime:  2016-11-28 22:54:20

var $column_edit = '操作';
    function column_edit($row){
          $strRtn =''.app::get('cps')->_('打印').'';
        return $strRtn;
    }

/**
     * 打印退货订单的接口
     * @param string 打印类型
     * @param string order id
     * @return null
     */
    public function printing($payment_id)
    {
       //组织要打印的数据
        $payment = $this->app->model('reship');
        $subsdf = array('reship_items' => '*');
        $sdf_payment = $payment->dump($payment_id, '*', $subsdf);
            if($sdf_payment){
                $this->pagedata['reships'] = $sdf_payment;
                if (isset($this->pagedata['reships']['member_id']) && $this->pagedata['reships']['member_id'])
                {
                    $obj_pam = app::get('pam')->model('account');
                    $login_name = kernel::single('b2c_user_object')->get_member_name(null,$this->pagedata['reships']['member_id']);
                    $this->pagedata['reships']['member_id'] = $login_name;
                }
                if (isset($this->pagedata['reships']['op_id']) && $this->pagedata['reships']['op_id'])
                {
                    $obj_pam = app::get('pam')->model('account');
                    $arr_pam = $obj_pam->dump(array('account_id' => $this->pagedata['reships']['op_id']), 'login_name');
                    $this->pagedata['reships']['op_id'] = $arr_pam['login_name'];
                }
    if (isset($this->pagedata['reships']['delivery']) && $this->pagedata['reships']['delivery'])
                {
                    $obj_dlytype = $this->app->model('dlytype');
                    $arr_dlytype = $obj_dlytype->dump($this->pagedata['reships']['delivery'], 'dt_name');
                    $this->pagedata['reships']['delivery'] = $arr_dlytype['dt_name'];
                }
                //打印
               $this->_systmpl = $this->app->model('member_systmpl'); //固定写法
                $this->pagedata['res_url'] = $this->app->res_url;//固定写法
                $this->pagedata['printContent']['sheet'] = true;//固定写法
                //选择要打印模板及分配数据                                                           
                $this->pagedata['content_sheet'] = $this->_systmpl->fetch('admin/order/print_reship',$this->pagedata);
                $this->pagedata['page_title'] = app::get('b2c')->_('退货单打印');
                $this->display('admin/order/print.html');//此模板为系统固定的
        }
    }

1ab6ad99-c196-4cd8-a76f-f030134b205c

db23beb4-0bef-47c6-9046-80f1a8c10525

4db94f2a-6f77-4f1d-bd6d-58882288fe54 8e54a995-a174-414a-84be-03e1cf694930

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注