12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- class refill_order_manualControl extends SystemControl
- {
- public function __construct()
- {
- parent::__construct();
- }
- public function indexOp()
- {
- $model_refill_order = Model('refill_order');
- $condition['inner_status'] = 0;
- $order_list = [];
- if (!empty($_GET['order_sn'])) {
- $condition['refill_order.order_sn'] = $_GET['order_sn'];
- $merchants = [];
- $merchant_list = Model('')->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');
- 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]);
- if ((time() - $order_info['order_time']) < 3600) {
- showMessage('订单时间未超过1小时', 'index.php?act=refill_order&op=index');
- }
- $mod_refill = Model('refill_order');
- $logic_vr_order = Logic("vr_order");
- $order_info = Model('vr_order')->getOrderInfo(['order_id' => $order_id]);
- if ($type == 'success') {
- $logic_vr_order->changeOrderStateSuccess($order_id);
- $mod_refill->edit($order_id, ['notify_state' =>1, 'notify_time' => time()]);
- QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id, 'manual' => true]);
- } elseif ($type == 'cancel') {
- $logic_vr_order->changeOrderStateCancel($order_info, '', "充值失败");
- $mod_refill->edit($order_id, ['notify_state' =>1, 'notify_time' => time()]);
- QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id, 'manual' => true]);
- } else {
- showMessage('手动操作类型错误', 'index.php?act=refill_order&op=index');
- }
- showMessage('操作成功');
- }
- }
|