|
@@ -65,7 +65,7 @@ class refill_order_manualControl extends SystemControl
|
|
{
|
|
{
|
|
$model_refill_order = Model('refill_order');
|
|
$model_refill_order = Model('refill_order');
|
|
$condition = [];
|
|
$condition = [];
|
|
- $order_list = [];
|
|
|
|
|
|
+ $orders = [];
|
|
$_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00");
|
|
$_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00");
|
|
if (in_array($_GET['order_state'], ['0', '10', '20', '30', '40']))
|
|
if (in_array($_GET['order_state'], ['0', '10', '20', '30', '40']))
|
|
{
|
|
{
|
|
@@ -114,12 +114,48 @@ class refill_order_manualControl extends SystemControl
|
|
$condition['refill_order.order_time'] = ['egt', $start];
|
|
$condition['refill_order.order_time'] = ['egt', $start];
|
|
$condition['vr_order.add_time'] = ['egt', $start];
|
|
$condition['vr_order.add_time'] = ['egt', $start];
|
|
}
|
|
}
|
|
- $order_list = $model_refill_order->getMerchantOrderList($condition, 400, 'refill_order.*,vr_order.order_state', 'refill_order.channel_name DESC ');
|
|
|
|
- $order_list = $this->OrderDataFormat($order_list, $merchant_list);
|
|
|
|
|
|
+ $int_array = function ($sids) {
|
|
|
|
+ $result = [];
|
|
|
|
+ foreach ($sids as $sid) {
|
|
|
|
+ $result[] = intval($sid);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return $result;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ $unique_array = function ($ids)
|
|
|
|
+ {
|
|
|
|
+ $ids = array_unique($ids);
|
|
|
|
+ sort($ids);
|
|
|
|
+ return $ids;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ $orders = $model_refill_order->getMerchantOrderList($condition, 400, 'refill_order.*,vr_order.order_state', 'refill_order.channel_name DESC ');
|
|
|
|
+ $orders = $this->OrderDataFormat($orders, $merchant_list);
|
|
|
|
+ $order_ids = array_column($orders,'order_id');
|
|
|
|
+ $order_ids = $unique_array($order_ids);
|
|
|
|
+ $refill_buyback_model = Model('refill_buyback');
|
|
|
|
+ $buybacks = $refill_buyback_model->getList(['order_id' => ['in',$order_ids]]);
|
|
|
|
+ $buyback_ids = array_column($buybacks, 'order_id');
|
|
|
|
+ $buyback_ids = $int_array($buyback_ids);
|
|
|
|
+ $buyback_ids = $unique_array($buyback_ids);
|
|
|
|
+ foreach ($orders as $key => $order)
|
|
|
|
+ {
|
|
|
|
+ if($order['order_state'] != ORDER_STATE_SUCCESS) {
|
|
|
|
+ $order[$key]['buyback'] = false;
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ $order_id = intval($order['order_id']);
|
|
|
|
+ if(algorithm::binary_search($buyback_ids,$order_id)) {
|
|
|
|
+ $orders[$key]['buyback'] = true;
|
|
|
|
+ }else{
|
|
|
|
+ $orders[$key]['buyback'] = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
Tpl::output('merchant_list', $merchant_list);
|
|
Tpl::output('merchant_list', $merchant_list);
|
|
Tpl::output('provider_list', $provider_list);
|
|
Tpl::output('provider_list', $provider_list);
|
|
- Tpl::output('order_list', $order_list);
|
|
|
|
|
|
+ Tpl::output('order_list', $orders);
|
|
Tpl::output('show_page', $model_refill_order->showpage());
|
|
Tpl::output('show_page', $model_refill_order->showpage());
|
|
Tpl::showpage('refill.order.batch');
|
|
Tpl::showpage('refill.order.batch');
|
|
}
|
|
}
|
|
@@ -145,8 +181,7 @@ class refill_order_manualControl extends SystemControl
|
|
$oid_reader = function ($sids) use ($int_array,$unique_array) {
|
|
$oid_reader = function ($sids) use ($int_array,$unique_array) {
|
|
$sids = explode(',',$sids);
|
|
$sids = explode(',',$sids);
|
|
$ids = $int_array($sids);
|
|
$ids = $int_array($sids);
|
|
- $result = $unique_array($ids);
|
|
|
|
- return $result;
|
|
|
|
|
|
+ return $unique_array($ids);
|
|
};
|
|
};
|
|
|
|
|
|
$oper_type = $_GET['type'];
|
|
$oper_type = $_GET['type'];
|