本文整理匯總了PHP中payment::updateOrder方法的典型用法代碼示例。如果您正苦於以下問題:PHP payment::updateOrder方法的具體用法?PHP payment::updateOrder怎麽用?PHP payment::updateOrder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類payment
的用法示例。
在下文中一共展示了payment::updateOrder方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: order_collection_doc
public function order_collection_doc()
{
//獲得訂單號
$order_no = IFilter::act(IReq::get('order_no'));
$text = "<br /><div align='center'>付款已完成</div>";
if (payment::updateOrder($order_no)) {
//獲得collection_doc表的對象
$tb_collection_doc = new IModel('collection_doc');
$tb_collection_doc->setData(array('order_id' => IFilter::act(IReq::get('id'), 'int'), 'user_id' => IFilter::act(IReq::get('user_id'), 'int'), 'payment_id' => IFilter::act(IReq::get('payment_id'), 'int'), 'collection_account' => IFilter::act(IReq::get('collection_account')), 'time' => date('Y-m-d H:i:s'), 'amount' => IFilter::act(IReq::get('amount'), 'float'), 'note' => IFilter::act(IReq::get('note'), 'text'), 'pay_status' => 1, 'if_del' => 0));
$tb_collection_doc->add();
//生成訂單日誌
$tb_order_log = new IModel('order_log');
$tb_order_log->setData(array('order_id' => IFilter::act(IReq::get('id'), 'int'), 'user' => $this->admin['admin_id'], 'action' => '付款', 'result' => '成功', 'note' => '訂單【' . $order_no . '】付款' . IFilter::act(IReq::get('amount'), 'float'), 'addtime' => date('Y-m-d H:i:s')));
$tb_order_log->add();
$logObj = new log('db');
$logObj->write('operation', array("管理員:" . ISafe::get('admin_name'), "訂單更新為已付款", "訂單號:" . $order_no . ',已經確定付款'));
} else {
$text = "<br /><div align='center'>付款失敗</div>";
}
echo $text;
exit;
}
示例2: server_callback
function server_callback()
{
$payment_name = is_array($payment_name = IReq::get('payment_name')) ? IFilter::act($payment_name[0]) : IFilter::act(IReq::get('payment_name'));
//初始化參數
$money = null;
$message = null;
$tradeno = null;
//獲取支付payment的id值
$pObj = new IModel('payment as a,pay_plugin as b');
$paymentRow = $pObj->getObj('b.file_path = "' . $payment_name . '" and a.plugin_id = b.id', 'a.id');
//載入支付接口文件
$paymentObj = new Payment();
$payObj = $paymentObj->loadMethod($payment_name);
if (!is_object($payObj)) {
echo 'fail';
exit;
}
//執行接口回調函數
$return = $payObj->serverCallback(array_merge($_POST, $_GET), $paymentRow['id'], $money, $message, $tradeno);
//判斷返回狀態
if ($return == 1) {
if (stripos($tradeno, 'recharge_') !== false) {
$tradenoArray = explode('_', $tradeno);
$recharge_no = isset($tradenoArray[1]) ? $tradenoArray[1] : 0;
if (payment::updateRecharge($recharge_no)) {
echo 'success';
exit;
} else {
echo 'fail';
}
} else {
if (payment::updateOrder($tradeno)) {
echo 'success';
exit;
} else {
echo 'fail';
}
}
} else {
echo 'fail';
}
}
示例3: cart3
//.........這裏部分代碼省略.........
$dataArray = array('order_no' => $order_no, 'user_id' => $user_id, 'accept_name' => $accept_name, 'pay_type' => $payment, 'distribution' => $delivery_id, 'status' => 1, 'pay_status' => 0, 'distribution_status' => 0, 'postcode' => $zip, 'telphone' => $telphone, 'province' => $province, 'city' => $city, 'area' => $area, 'address' => $address, 'mobile' => $mobile, 'create_time' => ITime::getDateTime(), 'invoice' => $is_tax, 'postscript' => $order_message, 'invoice_title' => $tax_title, 'accept_time' => $accept_time, 'exp' => $exp_r, 'point' => $point_r, 'type' => $order_type, 'prop' => isset($dataArray['prop']) ? $dataArray['prop'] : null, 'payable_amount' => $goodsResult['sum'], 'real_amount' => $goodsResult['final_sum'], 'payable_freight' => $deliveryPrice, 'real_freight' => $deliveryPrice_r, 'pay_fee' => $payment_fee, 'taxes' => $tax, 'promotions' => $proReduce_r + $reduce_r, 'order_amount' => $order_amount, 'if_insured' => $if_insured, 'insured' => $protect_price);
$orderObj = new IModel('order');
$orderObj->setData($dataArray);
$this->order_id = $orderObj->add();
if ($this->order_id == false) {
IError::show(403, '訂單生成錯誤');
}
/*將訂單中的商品插入到order_goods表*/
$orderGoodsObj = new IModel('order_goods');
$goodsArray = array('order_id' => $this->order_id);
$findType = array('goods' => 'goodsList', 'product' => 'productList');
foreach ($findType as $key => $list) {
if (isset($goodsResult[$list]) && count($goodsResult[$list]) > 0) {
foreach ($goodsResult[$list] as $k => $val) {
//拚接商品名稱和規格數據
$specArray = array('name' => $val['name'], 'value' => '');
if ($key == 'product') {
$goodsArray['product_id'] = $val['id'];
$goodsArray['goods_id'] = $val['goods_id'];
$spec = block::show_spec($val['spec_array']);
foreach ($spec as $skey => $svalue) {
$specArray['value'] .= $skey . ':' . $svalue . ' , ';
}
} else {
$goodsArray['goods_id'] = $val['id'];
$goodsArray['product_id'] = 0;
}
$specArray = serialize($specArray);
$goodsArray['goods_price'] = $val['sell_price'];
$goodsArray['real_price'] = $val['sell_price'] - $val['reduce'];
$goodsArray['goods_nums'] = $val['count'];
$goodsArray['goods_weight'] = $val['weight'];
$goodsArray['goods_array'] = $specArray;
$orderGoodsObj->setData($goodsArray);
$orderGoodsObj->add();
}
}
}
//更改購買商品的庫存數量
Block::updateStore($this->order_id, 'reduce');
//記錄用戶默認習慣的數據
if (!isset($memberRow['custom'])) {
$memberObj = new IModel('member');
$memberRow = $memberObj->getObj('user_id = ' . $user_id, 'custom');
}
$memberData = array('custom' => serialize(array('payment' => $payment, 'delivery' => $delivery_id)));
$memberObj->setData($memberData);
$memberObj->update('user_id = ' . $user_id);
//收貨地址的處理
if ($user_id) {
$addressObj = new IModel('address');
//如果用戶之前沒有收貨地址,那麽會自動記錄此次的地址信息並且為默認
$addressRow = $addressObj->getObj('user_id = ' . $user_id);
if (empty($addressRow)) {
$addressData = array('default' => '1', 'user_id' => $user_id, 'accept_name' => $accept_name, 'province' => $province, 'city' => $city, 'area' => $area, 'address' => $address, 'zip' => $zip, 'telphone' => $telphone, 'mobile' => $mobile);
$addressObj->setData($addressData);
$addressObj->add();
} else {
//如果用戶有收貨地址,但是沒有設置默認項,那麽會自動設置此次地址信息為默認
$radio_address = intval(IReq::get('radio_address'));
if ($radio_address != 0) {
$addressDefRow = $addressObj->getObj('user_id = ' . $user_id . ' and `default` = 1');
if (empty($addressDefRow)) {
$addressData = array('default' => 1);
$addressObj->setData($addressData);
$addressObj->update('user_id = ' . $user_id . ' and id = ' . $radio_address);
}
}
}
}
//獲取備貨時間
$siteConfigObj = new Config("site_config");
$site_config = $siteConfigObj->getInfo();
$this->stockup_time = isset($site_config['stockup_time']) ? $site_config['stockup_time'] : 2;
//數據渲染
$this->order_num = $dataArray['order_no'];
$this->final_sum = $dataArray['order_amount'];
$this->payment_fee = $payment_fee;
$this->payment = $paymentName;
$this->delivery = $deliveryList[$delivery_id]['name'];
$this->tax_title = $tax_title;
$this->deliveryType = $deliveryRow['type'];
$this->paymentType = $paymentType;
$this->paymentNote = $paymentNote;
//訂單金額為0時,訂單自動完成
if ($this->final_sum <= 0) {
$order_id = payment::updateOrder($dataArray['order_no']);
if ($order_id != '') {
if ($user_id) {
$this->redirect('/site/success/message/' . urlencode("訂單確認成功,等待發貨") . '/?callback=ucenter/order_detail/id/' . $order_id);
} else {
$this->redirect('/site/success/message/' . urlencode("訂單確認成功,等待發貨"));
}
} else {
IError::show(403, '訂單修改失敗');
}
} else {
$this->redirect('cart3');
}
}