|
@@ -179,16 +179,30 @@ class orderstatsControl extends SystemControl
|
|
|
$mod = Model('refill_balance');
|
|
|
$balance = $mod->getBalance(['balance_id' => $balance_id]);
|
|
|
if(empty($balance )) {
|
|
|
- showMessage('记录不存在!');
|
|
|
+ exit(json_encode(['code' => false, 'msg' => '记录不存在!']));
|
|
|
}
|
|
|
|
|
|
- $start_unixtime = intval(strtotime($_GET['query_start_time']));
|
|
|
- $end_unixtime = intval(strtotime($_GET['query_end_time']));
|
|
|
+ $start_unixtime = intval(strtotime($_GET['selectStartDate']));
|
|
|
+ $end_unixtime = intval(strtotime($_GET['selectEndDate']));
|
|
|
+ if(empty($start_unixtime)) {
|
|
|
+ $start_unixtime = $balance['end_stamp'];
|
|
|
+ }
|
|
|
+ if(empty($end_unixtime)) {
|
|
|
+ exit(json_encode(['code' => false, 'msg' => '结束日期不能为空!']));
|
|
|
+ }
|
|
|
|
|
|
$condition = [
|
|
|
'type' => $balance['type'], 'cid' => $balance['cid'], 'start' => $start_unixtime,
|
|
|
'end' => $end_unixtime, 'time_type' => $balance['time_type'], 'parent_id' => $balance_id
|
|
|
];
|
|
|
+
|
|
|
+ $manager = new task\manager();
|
|
|
+ $task = $manager->add_task('refill_balance_create',$condition,0);
|
|
|
+ if ($task->completed() && $task->success()) {
|
|
|
+ exit(json_encode(['code' => true, 'msg' => '操作成功,此记录已新建成功。']));
|
|
|
+ } else {
|
|
|
+ exit(json_encode(['code' => true, 'msg' => '操作成功,后台任务已开始新建,请稍后查看新数据']));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public function refill_balance_rebuildOp()
|