table('merchant')->limit(1000)->select(); foreach ($merchant_list as $key => $value) { $merchants[$value['mchid']] = $value; } $order_list = $model_refill_order->getMerchantOrderList($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc','',true); foreach ($order_list as $order_id => $order_info) { $order_list[$order_id]['card_type_text'] = $this->scard_type($order_info['card_type']); $order_list[$order_id]['mch_name'] = $merchants[$order_info['mchid']]['company_name']; if ($order_info['notify_time'] > 0) { $diff_time = $order_info['notify_time'] - $order_info['order_time']; } else { $diff_time = time() - $order_info['order_time']; } $order_list[$order_id]['diff_time_text'] = $this->elapse_time($diff_time); $order_list[$order_id]['diff_time'] = $diff_time; $order_list[$order_id]['quality_text'] = $this->quality_format($order_info['quality'],$order_info['card_type']); $order_list[$order_id]['org_quality_text'] = $this->quality_format($order_info['org_quality'],$order_info['card_type']); } } Tpl::output('order_list', $order_list); Tpl::showpage('refill.order.manual.index'); } public function notify_manual_merchantOp() { $order_id = $_GET['order_id']; $type = $_GET['type']; $mod_order = Model('vr_order'); $order_info = $mod_order->getOrderInfo(['order_id' => $order_id]); $mod_refill = Model('refill_order'); $logic_vr_order = Logic("vr_order"); $refill_info = Model('refill_order')->getOrderInfo(['order_id' => $order_id]); $check_fetch_order = $this->check_fetch_order($order_info['order_sn']); if($check_fetch_order == false) { showMessage('此订单不可手动操作,请联系抢单人员操作!'); } 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'); } 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]); showMessage('操作成功'); } public function refill_order_batchOp() { if (chksubmit()) { $model_refill_order = Model('refill_order'); $condition = []; $type = $_POST['type']; $order_sn = $_POST['order_sn']; $order_sn = str_replace(["\r\n", "\r", "\n"], ",", $order_sn); $condition['refill_order.order_sn'] = ['in', $order_sn]; if($type != 'notify') { $condition['vr_order.order_state'] = ORDER_STATE_SEND; } $order_list = $model_refill_order->getMerchantOrderList($condition,'','refill_order.*,vr_order.order_state'); if($type == 'success') { foreach ($order_list as $order) { $check_fetch_order = $this->check_fetch_order($order['order_sn']); if($check_fetch_order == false) continue; refill\util::manual_success($order['order_id']); } } elseif ($type == 'cancel') { foreach ($order_list as $order) { $check_fetch_order = $this->check_fetch_order($order['order_sn']); if($check_fetch_order == false) continue; refill\util::manual_cancel($order['order_id']); } } elseif ($type == 'notify'){ foreach ($order_list as $order) { if ($order['order_state'] == ORDER_STATE_SEND) { QueueClient::push("QueryRefillState", ['order_id' => $order['order_id']]); } else { QueueClient::push("NotifyMerchantComplete", ['order_id' => $order['order_id'], 'manual' => true]); } } } else { showMessage('手动操作类型错误'); } showMessage('操作成功'); } else { Tpl::showpage('refill.order.batch'); } } }