|
@@ -33,34 +33,37 @@ class refill_order_manualControl extends SystemControl
|
|
|
$type = $_GET['type'];
|
|
|
|
|
|
$mod_order = Model('vr_order');
|
|
|
- $order_info = $mod_order->getOrderInfo(['order_id' => $order_id]);
|
|
|
+ $tran = new trans_wapper($mod_order, 'manual_success state trans');
|
|
|
+ $order_info = $mod_order->getOrderInfo(['order_id' => $order_id], '*', true, true);
|
|
|
+
|
|
|
$mod_refill = Model('refill_order');
|
|
|
- $refill_info = Model('refill_order')->getOrderInfo(['order_id' => $order_id,'inner_status' => 0,'is_retrying' => 0]);
|
|
|
- if(empty($refill_info) || empty($order_info)) {
|
|
|
- showMessage('订单不存在,或不符合条件', '');
|
|
|
- }
|
|
|
+ $refill_info = $mod_refill->getOrderInfo(['order_id' => $order_id, 'inner_status' => 0, 'is_retrying' => 0]);
|
|
|
$fetch_order_ids = $this->check_fetch_order($order_id);
|
|
|
- if (in_array($order_id, $fetch_order_ids)) {
|
|
|
- showMessage('此订单不可手动操作,请联系抢单人员操作!');
|
|
|
- }
|
|
|
- $logic_vr_order = Logic("vr_order");
|
|
|
- if ($type == 'success') {
|
|
|
- $logic_vr_order->changeOrderStateSuccess($order_id,true);
|
|
|
- } elseif ($type == 'cancel') {
|
|
|
- $logic_vr_order->changeOrderStateCancel($order_info, '', "充值失败", true, true);
|
|
|
- } else {
|
|
|
- showMessage('手动操作类型错误', 'index.php?act=refill_order&op=index');
|
|
|
- }
|
|
|
- $this->manual_record([$refill_info], $type, $order_id, '手动强制处理');
|
|
|
- $this->log("手动强制处理,订单号:{$order_info['order_sn']}", 1);
|
|
|
|
|
|
- if($refill_info['notify_time'] == 0) {
|
|
|
- $mod_refill->edit($order_id, ['notify_state' =>1, 'notify_time' => time()]);
|
|
|
- }
|
|
|
- util::pop_queue_order($refill_info['mchid'],$refill_info['mch_order']);
|
|
|
- QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id, 'manual' => true]);
|
|
|
+ if (!empty($refill_info) && !empty($order_info) && !in_array($order_id, $fetch_order_ids)) {
|
|
|
+ $logic_vr_order = Logic("vr_order");
|
|
|
+ if ($type == 'success') {
|
|
|
+ $logic_vr_order->changeOrderStateSuccess($order_id, true);
|
|
|
+ } elseif ($type == 'cancel') {
|
|
|
+ $logic_vr_order->changeOrderStateCancel($order_info, '', "充值失败", true, true);
|
|
|
+ } else {
|
|
|
+ $tran->commit();
|
|
|
+ showMessage('手动操作类型错误');
|
|
|
+ }
|
|
|
+ $this->manual_record([$refill_info], $type, $order_id, '手动强制处理');
|
|
|
+ $this->log("手动强制处理,订单号:{$order_info['order_sn']}");
|
|
|
|
|
|
- showMessage('操作成功');
|
|
|
+ if ($refill_info['notify_time'] == 0) {
|
|
|
+ $mod_refill->edit($order_id, ['notify_state' => 1, 'notify_time' => time()]);
|
|
|
+ }
|
|
|
+ util::pop_queue_order($refill_info['mchid'], $refill_info['mch_order']);
|
|
|
+ $tran->commit();
|
|
|
+ QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id, 'manual' => true]);
|
|
|
+ showMessage('操作成功');
|
|
|
+ } else {
|
|
|
+ $tran->commit();
|
|
|
+ showMessage('订单不存在,或不符合条件');
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public function refill_order_batchOp()
|
|
@@ -735,4 +738,4 @@ class refill_order_manualControl extends SystemControl
|
|
|
$excel_obj->addWorksheet($excel_obj->charset(L('exp_od_order'), CHARSET));
|
|
|
$excel_obj->generateXML('返销导出' . date('Y-m-d-H', time()));
|
|
|
}
|
|
|
-}
|
|
|
+}
|