|
@@ -1,4 +1,5 @@
|
|
|
<?php
|
|
|
+require_once(BASE_HELPER_PATH . '/task/task_helper.php');
|
|
|
|
|
|
|
|
|
class orderstatsControl extends SystemControl
|
|
@@ -18,6 +19,13 @@ class orderstatsControl extends SystemControl
|
|
|
if (!empty($_GET['order_time_type'])) {
|
|
|
$condition['order_time_type'] = $_GET['order_time_type'];
|
|
|
}
|
|
|
+ if(!empty($_GET['reload'])) {
|
|
|
+ $stats_list = $model_refill_order->getAllRefillStats($condition);
|
|
|
+ $this->stats_reload($stats_list);
|
|
|
+ $json_str = json_encode($condition);
|
|
|
+ $this->log("对账管理,批量重新统计,条件:{$json_str}", 1);
|
|
|
+ showMessage('操作完成');
|
|
|
+ }
|
|
|
$stats_list = $model_refill_order->getOrderStatsList($condition, 50, '*', 'time_stamp desc, cname asc');
|
|
|
if($type == 'merchant') {
|
|
|
foreach ($stats_list as $key => $stats) {
|
|
@@ -38,6 +46,23 @@ class orderstatsControl extends SystemControl
|
|
|
Tpl::showpage($page);
|
|
|
}
|
|
|
|
|
|
+ private function stats_reload($stats_list)
|
|
|
+ {
|
|
|
+ foreach ($stats_list as $stats)
|
|
|
+ {
|
|
|
+ if($stats['send_count'] == 0) continue;
|
|
|
+ $cond = [
|
|
|
+ 'type' => $stats['type'],
|
|
|
+ 'time_stamp' => $stats['time_stamp'],
|
|
|
+ 'cid' => $stats['cid'],
|
|
|
+ 'order_time_type' => $stats['order_time_type']
|
|
|
+ ];
|
|
|
+ $manager = new task\manager();
|
|
|
+
|
|
|
+ $manager->add_task('order_stat_reload',$cond,0,3600);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private function ct_cond($input,$time_stamp)
|
|
|
{
|
|
|
$condition['type'] = $input['type'];
|