shish 2 лет назад
Родитель
Сommit
31a21a4bcc
1 измененных файлов с 17 добавлено и 0 удалено
  1. 17 0
      app-ghs/controllers/StatBookController.php

+ 17 - 0
app-ghs/controllers/StatBookController.php

@@ -28,4 +28,21 @@ class StatBookController extends BaseController
         util::success(['list' => $list]);
     }
 
+    public function actionPrintOrder()
+    {
+        $get = Yii::$app->request->get();
+        $where = [];
+        $where['mainId'] = $this->mainId;
+        $searchTime = $get['searchTime'] ?? 'today';
+        if (!empty($searchTime)) {
+            $startTime = $get['startTime'] ?? '';
+            $endTime = $get['endTime'] ?? '';
+            $period = dateUtil::formatTime($searchTime, $startTime, $endTime, true);
+            $where['time'] = ['between', [$period['startTime'], $period['endTime']]];
+        }
+
+        $list = StatBookClass::getAllByCondition($where, 'time DESC', '*');
+        util::success(['list' => $list]);
+    }
+
 }