|
|
@@ -0,0 +1,38 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace hd\controllers;
|
|
|
+
|
|
|
+use Yii;
|
|
|
+
|
|
|
+class BalanceChangeController extends BaseController
|
|
|
+{
|
|
|
+
|
|
|
+ public function actionList()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $export = $get['export'] ?? 0;
|
|
|
+ $where = [];
|
|
|
+ $where['mainId'] = $this->mainId;
|
|
|
+ $searchTime = $get['searchTime'] ?? '';
|
|
|
+ if (!empty($searchTime)) {
|
|
|
+ $startTime = $get['startTime'] ?? '';
|
|
|
+ $endTime = $get['endTime'] ?? '';
|
|
|
+ $period = dateUtil::formatTime($searchTime, $startTime, $endTime);
|
|
|
+ $where['addTime'] = ['between', [$period['startTime'], $period['endTime']]];
|
|
|
+ } else {
|
|
|
+ if ($export == 1) {
|
|
|
+ util::fail('请选择时间');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $customId = $get['customId'] ?? 0;
|
|
|
+ if (!empty($customId)) {
|
|
|
+ $custom = CustomClass::getById($customId);
|
|
|
+ CustomClass::valid($custom, $this->shopId);
|
|
|
+ $where['customId'] = $customId;
|
|
|
+ }
|
|
|
+ $respond = CustomBalanceChangeClass::getChangeList($where);
|
|
|
+ util::success($respond);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|