|
|
@@ -2,6 +2,10 @@
|
|
|
|
|
|
namespace hd\controllers;
|
|
|
|
|
|
+use bizHd\balance\classes\BalanceChangeClass;
|
|
|
+use bizHd\custom\classes\CustomClass;
|
|
|
+use common\components\dateUtil;
|
|
|
+use common\components\util;
|
|
|
use Yii;
|
|
|
|
|
|
class BalanceChangeController extends BaseController
|
|
|
@@ -10,7 +14,6 @@ class BalanceChangeController extends BaseController
|
|
|
public function actionList()
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
- $export = $get['export'] ?? 0;
|
|
|
$where = [];
|
|
|
$where['mainId'] = $this->mainId;
|
|
|
$searchTime = $get['searchTime'] ?? '';
|
|
|
@@ -19,19 +22,20 @@ class BalanceChangeController extends BaseController
|
|
|
$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);
|
|
|
+ $custom = CustomClass::getById($customId, true);
|
|
|
+ if (empty($custom)) {
|
|
|
+ util::fail('没有找到客户');
|
|
|
+ }
|
|
|
+ $shopId = $this->shopId;
|
|
|
+ if ($custom->shopId != $shopId) {
|
|
|
+ util::fail('没有找到客户信息');
|
|
|
+ }
|
|
|
$where['customId'] = $customId;
|
|
|
}
|
|
|
- $respond = CustomBalanceChangeClass::getChangeList($where);
|
|
|
+ $respond = BalanceChangeClass::getChangeList($where);
|
|
|
util::success($respond);
|
|
|
}
|
|
|
|