PxApplyController.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace hd\controllers;
  3. use bizHd\custom\classes\CustomClass;
  4. use bizHd\px\classes\PxApplyClass;
  5. use bizHd\px\classes\PxClassClass;
  6. use common\components\util;
  7. use Yii;
  8. /**
  9. * 培训报名
  10. */
  11. class PxApplyController extends BaseController
  12. {
  13. //报名申请 shish 2021.3.17
  14. public function actionAdd()
  15. {
  16. $get = Yii::$app->request->get();
  17. $classId = $get['classId'] ?? 0;
  18. $info = PxClassClass::getClassInfo($classId);
  19. PxClassClass::valid($info, $this->sjId);
  20. $customId = $data['customId'] ?? 0;
  21. if (!empty($customId)) {
  22. $custom = CustomClass::getCustomInfo($customId);
  23. CustomClass::valid($custom, $this->sjId);
  24. }
  25. $get['sjId'] = $this->sjId;
  26. $get['prePrice'] = $info['tuition'];
  27. $get['actPrice'] = $info['tuition'];
  28. $get['shopId'] = $this->shopId;
  29. $get['shopAdminId'] = $this->shopAdminId;
  30. PxApplyClass::addApply($get);
  31. util::complete();
  32. }
  33. //新学员 学员管理 shish 2021.3.17
  34. public function actionList()
  35. {
  36. $where = ['shopId' => $this->shopId];
  37. $respond = PxApplyClass::getApplyList($where);
  38. util::success($respond);
  39. }
  40. }