|
@@ -121,9 +121,17 @@ class ordersendlistControl extends SystemControl
|
|
$this->RefillOrderExport($orders_cond, 'time_out_order');
|
|
$this->RefillOrderExport($orders_cond, 'time_out_order');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ $store_ids = Model('')->table('refill_order,vr_order,merchant')
|
|
|
|
+ ->join('inner,inner')
|
|
|
|
+ ->on('refill_order.order_id=vr_order.order_id,refill_order.mchid=merchant.mchid')
|
|
|
|
+ ->field('DISTINCT vr_order.store_id')
|
|
|
|
+ ->where($orders_cond)
|
|
|
|
+ ->group('vr_order.store_id')
|
|
|
|
+ ->order('store_id asc')
|
|
|
|
+ ->select();
|
|
|
|
+ $store_ids = array_column($store_ids, 'store_id');
|
|
$merchant_list = $this->merchants();
|
|
$merchant_list = $this->merchants();
|
|
- $provider_list = $this->providers();
|
|
|
|
|
|
+ $provider_list = $this->providers(['store.store_id' => ['in', $store_ids]]);
|
|
[$merchant_stat, $order_stat] = $this->merchant_timeout_stats($orders_cond);
|
|
[$merchant_stat, $order_stat] = $this->merchant_timeout_stats($orders_cond);
|
|
if (empty($_GET['mchid'])) {
|
|
if (empty($_GET['mchid'])) {
|
|
$order_count = $order_stat['order_count'];
|
|
$order_count = $order_stat['order_count'];
|
|
@@ -195,6 +203,7 @@ class ordersendlistControl extends SystemControl
|
|
private function merchant_timeout_stats($cond)
|
|
private function merchant_timeout_stats($cond)
|
|
{
|
|
{
|
|
unset($cond['refill_order.mchid']);
|
|
unset($cond['refill_order.mchid']);
|
|
|
|
+ unset($cond['vr_order.store_id']);
|
|
$stats = Model('')->table('refill_order,vr_order,merchant')
|
|
$stats = Model('')->table('refill_order,vr_order,merchant')
|
|
->join('inner,inner')
|
|
->join('inner,inner')
|
|
->on('refill_order.order_id=vr_order.order_id,refill_order.mchid=merchant.mchid')
|
|
->on('refill_order.order_id=vr_order.order_id,refill_order.mchid=merchant.mchid')
|
|
@@ -325,6 +334,7 @@ class ordersendlistControl extends SystemControl
|
|
|
|
|
|
private function provider_timeout_stats($cond, $provider_list)
|
|
private function provider_timeout_stats($cond, $provider_list)
|
|
{
|
|
{
|
|
|
|
+ unset($cond['refill_order.mchid']);
|
|
unset($cond['vr_order.store_id']);
|
|
unset($cond['vr_order.store_id']);
|
|
$stats = Model('')->table('refill_order,vr_order')
|
|
$stats = Model('')->table('refill_order,vr_order')
|
|
->join('inner')
|
|
->join('inner')
|