request->get(); $where = []; $where['mainId'] = $this->mainId; $hdId = $get['hdId'] ?? 0; if (!empty($hdId)) { //在BaseController已经判断了是否本人的花店 $where['hdId'] = $hdId; } $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']]]; } $respond = BalanceChangeClass::getChangeList($where); util::success($respond); } public function actionBalancePayChange() { $get = Yii::$app->request->get(); $where = []; $where['mainId'] = $this->mainId; $customId = $this->customId; if (!empty($customId)) { $custom = CustomClass::getById($customId, true); if (empty($custom)) { util::fail('没有找到客户'); } $shopId = $this->shopId; if ($custom->shopId != $shopId) { util::fail('没有找到客户信息'); } $where['customId'] = $customId; } else { util::fail('缺少参数customId'); } $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']]]; } $respond = BalancePayChangeClass::getChangeList($where); util::success($respond); } }