- 普通 - 未处理
$model = new Model();$model->startTrans();
//处理发票
if($_POST['invoice'] == 'OK'){
$invalue = $_POST['invalue'];
$data["invoiceId"]= $this->createInvoice($invalue,$orderNo,$moneyCou);
if(!$data["invoiceId"]){
$flagExce = true; //判断添加发票是否发送异常
}
}else{
$data["invoiceId"]= 0;
}
$order->create($data);
$ordFlag = $order->add();//订单初步生成
//添加订单详情
$goodDesc = $this->createOrdDetail($orderNo,$myCart);
if(!$ordFlag || !$goodDesc){
$flagExce = true; //添加订单或详情是否发送异常
}else{
$flagExce = true;
}
$model->commit();
if($flagExce){
$model->rollback();
$this->msg("下单发生异常,请重新下单!");
}
