|
@@ -9,6 +9,7 @@ defined('InShopNC') or exit('Access Invalid!');
|
|
|
include(BASE_CONFIG_PATH . CONFIG_PREFIX . '/refill.ini.php');
|
|
|
require_once(BASE_HELPER_PATH . '/stat_helper.php');
|
|
|
require_once(BASE_ROOT_PATH . '/helper/refill/functional.php');
|
|
|
+require_once(BASE_HELPER_PATH . '/task/task_helper.php');
|
|
|
|
|
|
class merchantControl extends SystemControl
|
|
|
{
|
|
@@ -1051,20 +1052,19 @@ class merchantControl extends SystemControl
|
|
|
if (empty($stats_data)) {
|
|
|
showMessage('对应数据不存在', '');
|
|
|
}
|
|
|
- $refill = new statistics\stat_refill();
|
|
|
- try {
|
|
|
- $trans = new trans_wapper($mod_stat, __METHOD__);
|
|
|
- //更新新数据
|
|
|
- if ($stats_data['type'] == 'merchant') {
|
|
|
- $refill->merchant_stat($stats_data['time_stamp'], $stats_data['cid'], $stats_data['order_time_type']);
|
|
|
- } elseif ($stats_data['type'] == 'provider') {
|
|
|
- $refill->provider_stat($stats_data['time_stamp'], $stats_data['cid'], $stats_data['order_time_type']);
|
|
|
- }
|
|
|
- $trans->commit();
|
|
|
+ $cond = [
|
|
|
+ 'type' => $stats_data['type'],
|
|
|
+ 'time_stamp' => $stats_data['time_stamp'],
|
|
|
+ 'cid' => $stats_data['cid'],
|
|
|
+ 'order_time_type' => $stats_data['order_time_type']
|
|
|
+ ];
|
|
|
+ $manager = new task\manager();
|
|
|
+
|
|
|
+ $task = $manager->add_task('order_stat_reload',$cond,0,3600);
|
|
|
+ if ($task->completed() && $task->success()) {
|
|
|
showMessage('操作成功');
|
|
|
- } catch (Exception $e) {
|
|
|
- $trans->rollback();
|
|
|
- showMessage('操作失败');
|
|
|
+ } else {
|
|
|
+ showMessage("操作成功,后台任务已开始重新统计,请稍后查看新数据");
|
|
|
}
|
|
|
}
|
|
|
|