PxApplyController.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. //报名申请 ssh 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->shopId);
  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. $get['className'] = $info['name'] ?? '';
  31. $get['classCover'] = $info['cover'] ?? '';
  32. $get['applyTime'] = date("Y-m-d H:i:s");
  33. $get['status'] = PxApplyClass::STATUS_CONFIRM;
  34. PxApplyClass::addApply($get, $this->shop);
  35. util::complete();
  36. }
  37. //新学员 学员管理 ssh 2021.3.17
  38. public function actionList()
  39. {
  40. $where = ['shopId' => $this->shopId, 'status' => PxApplyClass::STATUS_CONFIRM];
  41. $respond = PxApplyClass::getApplyList($where);
  42. util::success($respond);
  43. }
  44. }