PxApplyController.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 bizHd\px\services\PxApplyService;
  7. use common\components\util;
  8. use Yii;
  9. /**
  10. * 培训报名
  11. */
  12. class PxApplyController extends BaseController
  13. {
  14. //报名申请 ssh 2021.3.17
  15. public function actionAdd()
  16. {
  17. $get = Yii::$app->request->get();
  18. $classId = $get['classId'] ?? 0;
  19. $info = PxClassClass::getClassInfo($classId);
  20. PxClassClass::valid($info, $this->sjId);
  21. $customId = $data['customId'] ?? 0;
  22. if (!empty($customId)) {
  23. $custom = CustomClass::getCustomInfo($customId);
  24. CustomClass::valid($custom, $this->shopId);
  25. }
  26. $get['sjId'] = $this->sjId;
  27. $get['prePrice'] = $info['tuition'];
  28. $get['actPrice'] = $info['tuition'];
  29. $get['shopId'] = $this->shopId;
  30. $get['shopAdminId'] = $this->shopAdminId;
  31. $get['className'] = $info['name'] ?? '';
  32. $get['classCover'] = $info['cover'] ?? '';
  33. $get['applyTime'] = date("Y-m-d H:i:s");
  34. $get['status'] = PxApplyClass::STATUS_UN_CONFIRM;
  35. PxApplyService::addBmPx($get);
  36. util::complete();
  37. }
  38. //新学员 学员管理 ssh 2021.3.17
  39. public function actionList()
  40. {
  41. $where = ['shopId' => $this->shopId, 'status' => PxApplyClass::STATUS_CONFIRM];
  42. $respond = PxApplyClass::getApplyList($where);
  43. util::success($respond);
  44. }
  45. }