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


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');//此模板为系统固定的
}
}



