GhsBalanceChangeController.php 821 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace hd\controllers;
  3. use bizHd\ghs\classes\GhsBalanceChangeClass;
  4. use bizHd\ghs\classes\GhsClass;
  5. use common\components\dict;
  6. use common\components\util;
  7. use Yii;
  8. class GhsBalanceChangeController extends BaseController
  9. {
  10. //余额变动明细
  11. public function actionList()
  12. {
  13. $get = Yii::$app->request->get();
  14. $ghsId = $get['ghsId'] ?? 0;
  15. $salt = $get['salt'] ?? '';
  16. $ghs = GhsClass::getById($ghsId, true);
  17. if (empty($salt)) {
  18. GhsClass::valid($ghs, $this->shopId);
  19. } else {
  20. if ($ghs->salt != $salt) {
  21. util::fail('无法查看');
  22. }
  23. }
  24. $where = [];
  25. $where['ghsId'] = $ghsId;
  26. $list = GhsBalanceChangeClass::getChangeList($where);
  27. util::success($list);
  28. }
  29. }