ShopYeChangeController.php 1009 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace pt\controllers;
  3. use biz\shop\classes\ShopYeChangeClass;
  4. use common\components\dict;
  5. use common\components\util;
  6. use Yii;
  7. class ShopYeChangeController extends BaseController
  8. {
  9. public $guestAccess = [];
  10. public function actionList()
  11. {
  12. $get = Yii::$app->request->get();
  13. $shopId = $get['shopId'] ?? 0;
  14. $tx = $get['tx'] ?? dict::getDict('yeTx', 'canNot');
  15. $where = [];
  16. $where['shopId'] = $shopId;
  17. if (!empty($tx)) {
  18. $where['tx'] = $tx;
  19. }
  20. $respond = ShopYeChangeClass::getChangeList($where);
  21. if (isset($respond['list']) && !empty($respond['list'])) {
  22. foreach ($respond['list'] as $key => $val) {
  23. if ($tx == dict::getDict('yeTx', 'can')) {
  24. $respond['list'][$key]['balance'] = '-';
  25. } else {
  26. $respond['list'][$key]['txBalance'] = '-';
  27. }
  28. }
  29. }
  30. util::success($respond);
  31. }
  32. }