| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace hd\controllers;
- use bizHd\custom\classes\CustomClass;
- use bizHd\px\classes\PxApplyClass;
- use bizHd\px\classes\PxClassClass;
- use bizHd\px\services\PxApplyService;
- use common\components\util;
- use Yii;
- /**
- * 培训报名
- */
- class PxApplyController extends BaseController
- {
- //报名申请 ssh 2021.3.17
- public function actionAdd()
- {
- $get = Yii::$app->request->get();
- $classId = $get['classId'] ?? 0;
- $info = PxClassClass::getClassInfo($classId);
- PxClassClass::valid($info, $this->sjId);
- $customId = $data['customId'] ?? 0;
- if (!empty($customId)) {
- $custom = CustomClass::getCustomInfo($customId);
- CustomClass::valid($custom, $this->shopId);
- }
- $get['sjId'] = $this->sjId;
- $get['prePrice'] = $info['tuition'];
- $get['actPrice'] = $info['tuition'];
- $get['shopId'] = $this->shopId;
- $get['shopAdminId'] = $this->shopAdminId;
- $get['className'] = $info['name'] ?? '';
- $get['classCover'] = $info['cover'] ?? '';
- $get['applyTime'] = date("Y-m-d H:i:s");
- $get['status'] = PxApplyClass::STATUS_UN_CONFIRM;
- PxApplyService::addBmPx($get);
- util::complete();
- }
- //新学员 学员管理 ssh 2021.3.17
- public function actionList()
- {
- $where = ['shopId' => $this->shopId, 'status' => PxApplyClass::STATUS_CONFIRM];
- $respond = PxApplyClass::getApplyList($where);
- util::success($respond);
- }
- }
|