




$orderInfo.='使用余额:'.$order['surplus'].'<BR>';
if($_CFG['gprsprint_open']=='1')$rsprint=wp_print($order_id);
4、Includes/lib_base.php中增加打印方法
INSERTINTO`ysh_shop_config`VALUES('11','0','gprsprint','group','','','','1');
"order_amount=0".
$ordergoods=order_goods($oid);
"LEFTJOIN".$GLOBALS['ecs']->table('region')."AScONo.country=c.region_id".
//更新订单的打印状态
//$orderInfo.='订单状态:'.$order_status[$order['order_status']].'<BR>';
{
$order['region']=$GLOBALS['db']->getOne($sql);
$orderInfo='<CB>订单信息</CB><BR>';//标题字体如需居中放大,就需要用标签套上
{
$arr['order_status'] =OS_CONFIRMED;
$logfile=ROOT_PATH.'/printlog/'.$oid.'_'.time().'.txt';
找到如下代码段
$db->query($sql);
"pay_status='$pay_status',".
INSERTINTO`ysh_shop_config`VALUES('1101','11','gprsprint_no','text','','','','1');
$_LANG['cfg_name']['gprsprint_open']='开启打印';
再代码
includeslib_payment.php
adminstoneorder.php 找到以下代码段
//商品订单信息
$_LANG['cfg_range']['gprsprint_open']['0']='关闭';
$payment=payment_info($order['pay_id']);
if($rsprint){
$sql="UPDATE".$ecs->table('order_info')."SETgprsprint='1'WHEREorder_id=".$order_id;
foreach($ordergoodsas$v){
functionsendSelfFormatMessage($msgInfo){
"pay_time='".gmtime()."',".
$_LANG['cfg_range']['gprsprint_open']['1']='开启';
INSERTINTO`ysh_shop_config`VALUES('1105','11','gprsprint_port','text','','','','1');
$orderInfo.='收货地址:'.$order['region'].$order['address'].'<BR>';
$orderInfo.='订单号:'.$order['order_sn'].'<BR>';
"WHEREorder_id='$order_id'";
$sql="UPDATE".$ecs->table('order_info')."SETgprsprint='1'WHEREorder_id=".$new_order_id;
$_LANG['cfg_name']['gprsprint_key']='打印机秘钥';
if($payment['is_cod'])
include_once(ROOT_PATH.'includes/lib_order.php');
if($order['order_amount']<=0){
$orderInfo.='配送方式:'.$order['shipping_name'].'<BR>';
if($order['pay_time'])$orderInfo.='支付时间:'.$order['pay_time'].'<BR>';
/*标记订单为已确认、已付款,更新付款时间和已支付金额,如果是货到付款,同时修改订单为“收货确认”*/
$sql="UPDATE".$GLOBALS['ecs']->table('order_info')."SETgprsprint='1'WHEREorder_id=".$order_id;
1、数据库执行以下SQL
$GLOBALS['db']->query($sql);
"LEFTJOIN".$GLOBALS['ecs']->table('region')."AStONo.city=t.region_id".
if($rsprint){
$_LANG['cfg_name']['gprsprint_mobile']='手机号';
$rs= sendSelfFormatMessage($selfMessage);
/*如果订单金额为0(使用余额或积分或红包支付),修改订单状态为已确认、已付款*/
exit();
$order=order_info($oid);
returnTRUE;
"LEFTJOIN".$GLOBALS['ecs']->table('region')."ASdONo.district=d.region_id".
$sql='UPDATE'.$GLOBALS['ecs']->table('order_info').
"WHEREo.order_id='$order[order_id]'";
$orderInfo.='------------------------------------<BR>';
$device_no=$GLOBALS['_CFG']['gprsprint_no'];
if($_CFG['gprsprint_open']=='1')$rsprint=wp_print($new_order_id);
/*客户付款时给商家发送打印信息*/
如果是余额支付的情况
"money_paid=order_amount,".
$orderInfo.=$v['goods_name'].'('.$v['goods_sn'].')'.'×'.$v['goods_number'].'(件)×'.$v['goods_price'].'='.$v['subtotal'].'<BR>';
$orderInfo.='<CB>商品明细</CB><BR>';
//日志记录
$client=newHttpClient($GLOBALS['_CFG']['gprsprint_host'],$GLOBALS['_CFG']['gprsprint_port']);
$client->HttpClient($GLOBALS['_CFG']['gprsprint_host'],$GLOBALS['_CFG']['gprsprint_port']);
//{"reslutCode":0,"msg":"success"}
INSERTINTO`ysh_shop_config`VALUES('1106','11','gprsprint_open','select','1,0','','0','1');
/*处理余额、积分、红包*/
file_put_contents($logfile,json_encode($selfMessage),LOCK_EX);
'apitype'=>'php',
}
//更新订单的打印状态
}
$orderInfo.='------------------------------------<BR>';
$orderInfo.='商品总价:'.$order['goods_amount'].'<BR>';
INSERTINTO`ysh_shop_config`VALUES('1103','11','gprsprint_mobile','text','','','','1');
}
$orderInfo.='打印时间:'.date('Y-m-dH:i:s',time()).'<BR>';
$arr['confirm_time'] =gmtime();
$orderInfo.='支付状态:'.$pay_status[$order['pay_status']].'<BR>';
$_LANG['cfg_name']['gprsprint']='GPRS打印机设置';
$arr['money_paid'] =$order['money_paid']+$order['order_amount'];
$orderInfo.='------------------------------------<BR>';
INSERTINTO`ysh_shop_config`VALUES('1102','11','gprsprint_key','text','','','','1');
后面添加
'printTimes'=>$times
functionwp_print($oid,$times=1){
$orderInfo.='支付费用:'.$order['pay_fee'].'<BR>';
}
大概1650行
$orderInfo.='收货人:'.$order['consignee'].'<BR>';
5、再flow.php中找到支付成功流程后,调用wp_print 方法来实现打印
$pay_status=array("未付款","付款中","已付款"); //支付状态
前面添加如下代码段
$arr['pay_time'] =gmtime();
if($order['order_status']!=OS_CONFIRMED)
/*修改订单状态为已付款*/
if($order['to_buyer'])$orderInfo.='客户留言:'.$order['to_buyer'].'<BR>';
if($order['tel'])$orderInfo.='电话:'.$order['tel'].'<BR>';
$_LANG['cfg_name']['gprsprint_port']='服务端口';
languageszh_cnadminshop_config.php
"LEFTJOIN".$GLOBALS['ecs']->table('region')."ASpONo.province=p.region_id".
$orderInfo.='------------------------------------<BR>';
return'faild';
//更新订单的打印状态
if($order['money_paid'])$orderInfo.='已付款金额:'.$order['money_paid'].'<BR>';
return$client->getContent();
include_once(ROOT_PATH.'includes/cls_http.php');
}
if($rs['reslutCode']=='0'){
update_order($order_id,$arr);
);
INSERTINTO`ysh_shop_config`VALUES('1104','11','gprsprint_host','text','','','','1');
3、把cls_http.php拷贝到includes目录下
'key'=>$key,
"SETorder_status='".OS_CONFIRMED."',".
$arr['pay_status'] =PS_PAYED;
$_LANG['cfg_name']['gprsprint_host']='服务IP';
if($rsprint){
//订单中包含的商品
$order['shipping_status']=SS_RECEIVED;
$_LANG['cfg_name']['gprsprint_no']='打印机编号';
$db->query($sql);
}
2、语言包添加内容
if(!$client->post('/FeieServer/printSelfFormatOrder',$msgInfo)){//提交失败
'printInfo'=>$orderInfo,
"' ',IFNULL(t.region_name,''),' ',IFNULL(d.region_name,''))ASregion".
if($order['mobile'])$orderInfo.='手机:'.$order['mobile'].'<BR>';
if($GLOBALS['_CFG']['gprsprint_open']=='1')$rsprint=wp_print($pay_log['order_id']);
$arr['order_amount']=0;
}
'clientCode'=>$device_no,
$GLOBALS['db']->query($sql);
if($order['user_id']>0&&$order['surplus']>0)
}
6、后台管理员设置打印成功后,打印通知
$arr['shipping_status']=SS_RECEIVED;
ALTERTABLE`ysh_order_info`ADD`gprsprint`TINYINT(1)NOTNULLDEFAULT'0';
$orderInfo.='邮编:'.$order['zipcode'].'<BR>';
7、用户在线支付后打印机通知
$orderInfo.='------------------------------------<BR>';
}
}
}
"confirm_time='".gmtime()."',".
$key=$GLOBALS['_CFG']['gprsprint_key'];轻空app母婴二手用品寄售平台1.0.1 安卓免费版
}
"FROM".$GLOBALS['ecs']->table('order_info')."ASo".
$selfMessage=array(
else{
代码后面添加
if($order['discount'])$orderInfo.='折扣金额:'.$order['discount'].'<BR>';
$sql="SELECTconcat(IFNULL(c.region_name,''),' ',IFNULL(p.region_name,''),".
$order_status=array("未确认","已确认","已取消","无效","退货");//订单状态
$orderInfo.='支付方式:'.$order['pay_name'].'<BR>';
$rs=json_decode($rs,TRUE);
热门评论
最新评论