|
@@ -13,23 +13,24 @@ class refill_detailControl extends SystemControl
|
|
|
{
|
|
|
$mod = Model('refill_detail');
|
|
|
$condition = [];
|
|
|
- $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00");
|
|
|
+ $_POST['query_start_time'] = $_POST['query_start_time'] ?? date("Y-m-d 00:00:00");
|
|
|
$order_state_send = ORDER_STATE_SEND;
|
|
|
$order_state_queue = ORDER_STATE_QUEUE;
|
|
|
- $condition['order_state'] = ['in',"{$order_state_send},{$order_state_queue}"];
|
|
|
- if(!empty($_GET['mchid'])) {
|
|
|
- $condition['mchid'] = $_GET['mchid'];
|
|
|
+ $order_state_handled = ORDER_STATE_HANDLED;
|
|
|
+ $condition['order_state'] = ['in',"{$order_state_send},{$order_state_queue},{$order_state_handled}"];
|
|
|
+ if(!empty($_POST['mchid'])) {
|
|
|
+ $condition['mchid'] = $_POST['mchid'];
|
|
|
}
|
|
|
- if(in_array($_GET['order_state'], [$order_state_send,$order_state_queue])) {
|
|
|
- $condition['order_state'] = $_GET['order_state'];
|
|
|
+ if(in_array($_POST['order_state'], [$order_state_send,$order_state_queue,$order_state_handled])) {
|
|
|
+ $condition['order_state'] = $_POST['order_state'];
|
|
|
}
|
|
|
- if (!empty($_GET['mch_orders'])) {
|
|
|
- $mch_orders = rtrim($_GET['mch_orders'],',');
|
|
|
+ if (!empty($_POST['mch_orders'])) {
|
|
|
+ $mch_orders = rtrim($_POST['mch_orders'],',');
|
|
|
$condition['mch_order'] = ['in', $mch_orders];
|
|
|
}
|
|
|
|
|
|
- $start_unixtime = intval(strtotime($_GET['query_start_time']));
|
|
|
- $end_unixtime = intval(strtotime($_GET['query_end_time']));
|
|
|
+ $start_unixtime = intval(strtotime($_POST['query_start_time']));
|
|
|
+ $end_unixtime = intval(strtotime($_POST['query_end_time']));
|
|
|
if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
|
|
|
$condition['order_time'] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
|
|
|
} elseif ($start_unixtime > 0) {
|
|
@@ -47,11 +48,11 @@ class refill_detailControl extends SystemControl
|
|
|
$merchants[$value['mchid']] = $value;
|
|
|
}
|
|
|
|
|
|
- if($_GET['export'] == 1) {
|
|
|
+ if($_POST['export'] == 1) {
|
|
|
$this->RefillDetailExport($condition,$merchants);
|
|
|
exit;
|
|
|
}else{
|
|
|
- $list = $mod->getRefillDetailList($condition,30);
|
|
|
+ $list = $mod->getRefillDetailList($condition,200);
|
|
|
$list = $this->DataFormat($list,$merchants);
|
|
|
}
|
|
|
|
|
@@ -71,6 +72,8 @@ class refill_detailControl extends SystemControl
|
|
|
$list[$key]['order_state_text'] = '待收货';
|
|
|
} elseif ($value['order_state'] == ORDER_STATE_QUEUE) {
|
|
|
$list[$key]['order_state_text'] = '队列中';
|
|
|
+ } elseif ($value['order_state'] == ORDER_STATE_HANDLED) {
|
|
|
+ $list[$key]['order_state_text'] = '已处理';
|
|
|
} else {
|
|
|
$list[$key]['order_state_text'] = '/';
|
|
|
}
|
|
@@ -139,7 +142,10 @@ class refill_detailControl extends SystemControl
|
|
|
$id = $_GET['id'];
|
|
|
$type = $_GET['type'];
|
|
|
$condition['detail_id'] = ['in',$id];
|
|
|
- $condition['order_state'] = ORDER_STATE_QUEUE;
|
|
|
+
|
|
|
+ $order_state_send = ORDER_STATE_SEND;
|
|
|
+ $order_state_queue = ORDER_STATE_QUEUE;
|
|
|
+ $condition['order_state'] = ['in',"{$order_state_send},{$order_state_queue}"];
|
|
|
$refill_detail = Model('refill_detail')->where($condition)->select();
|
|
|
$mod = Model('refill_order');
|
|
|
foreach ($refill_detail as $detail)
|
|
@@ -155,7 +161,11 @@ class refill_detailControl extends SystemControl
|
|
|
if ($type == 'cancel') {
|
|
|
//零元订单失败
|
|
|
Log::record("cancel",Log::DEBUG);
|
|
|
- util::push_add_zero($params);
|
|
|
+ if ($detail['order_state'] == ORDER_STATE_SEND) {
|
|
|
+ util::pop_queue_order($mchid, $mch_order);
|
|
|
+ } elseif ($detail['order_state'] == ORDER_STATE_QUEUE) {
|
|
|
+ util::push_add_zero($params);
|
|
|
+ }
|
|
|
} elseif ($type == 'anew') {
|
|
|
//重新补充
|
|
|
Log::record("anew",Log::DEBUG);
|
|
@@ -168,6 +178,6 @@ class refill_detailControl extends SystemControl
|
|
|
util::pop_queue_order($mchid,$mch_order);
|
|
|
}
|
|
|
}
|
|
|
- showMessage('操作成功');
|
|
|
+ showMessage('操作成功','index.php?act=refill_detail&op=index');
|
|
|
}
|
|
|
}
|