BookItemCustomController.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace ghs\controllers;
  3. use bizGhs\book\classes\BookItemCustomClass;
  4. use common\components\util;
  5. use Yii;
  6. class BookItemCustomController extends BaseController
  7. {
  8. //预订客户列表 ssh 20240616
  9. public function actionList()
  10. {
  11. $get = Yii::$app->request->get();
  12. $where = [];
  13. $where['mainId'] = $this->mainId;
  14. $bookSn = $get['bookSn'] ?? '';
  15. if (empty($bookSn)) {
  16. $shop = $this->shop;
  17. $bookSn = $shop->bookSn ?? 0;
  18. if (empty($bookSn)) {
  19. util::fail('请选择预订活动');
  20. }
  21. }
  22. $where['bookSn'] = $bookSn;
  23. $customId = $get['customId'] ?? 0;
  24. if (!empty($customId)) {
  25. $where['customId'] = $customId;
  26. }
  27. $itemId = $get['itemId'] ?? 0;
  28. if (!empty($itemId)) {
  29. $where['itemId'] = $itemId;
  30. }
  31. $list = BookItemCustomClass::getAllByCondition($where, 'addTime DESC', '*');
  32. util::success(['list' => $list]);
  33. }
  34. }