初始化仓库
This commit is contained in:
73
service/modules/v1/controllers/DoctorMyController.php
Normal file
73
service/modules/v1/controllers/DoctorMyController.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace service\modules\v1\controllers;
|
||||
|
||||
use common\core\BaseAppController;
|
||||
use common\models\DoctorApply;
|
||||
use service\models\forms\HospitalDocForm;
|
||||
use yii\db\Exception;
|
||||
|
||||
/**
|
||||
* @doc-module 我的
|
||||
*/
|
||||
class DoctorMyController extends BaseAppController
|
||||
{
|
||||
/**
|
||||
* 升级为互医(后台)
|
||||
*/
|
||||
public function actionDoctorUpgrade()
|
||||
{
|
||||
|
||||
$post = \Yii::$app->request->post();
|
||||
$HospitalDocForm = new HospitalDocForm();
|
||||
$HospitalDocForm->attributes = $post;
|
||||
|
||||
return $HospitalDocForm->grade();
|
||||
}
|
||||
|
||||
/**
|
||||
* @doc-name 获取互医信息
|
||||
*/
|
||||
public function actionHospitalDocInfo()
|
||||
{
|
||||
$post = \Yii::$app->request->post();
|
||||
$HospitalDocForm = new HospitalDocForm();
|
||||
$HospitalDocForm->attributes = $post;
|
||||
|
||||
return $HospitalDocForm->DocInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步患者(后台)
|
||||
*/
|
||||
public function actionSyncPatient()
|
||||
{
|
||||
$post = \Yii::$app->request->post();
|
||||
$HospitalDocForm = new HospitalDocForm();
|
||||
$HospitalDocForm->attributes = $post;
|
||||
|
||||
return $HospitalDocForm->SyncPatient();
|
||||
}
|
||||
|
||||
/**
|
||||
* @doc-name 申请升级为互医
|
||||
*/
|
||||
public function actionApplyUpgrade()
|
||||
{
|
||||
|
||||
$DoctorApply=DoctorApply::find()->where([
|
||||
'service_user_id'=>\Yii::$app->user->identity->getId(),
|
||||
'is_delete'=>0
|
||||
])->one();
|
||||
|
||||
if ($DoctorApply) {
|
||||
throw new Exception('您已提交申请');
|
||||
}
|
||||
|
||||
$apply=new DoctorApply();
|
||||
$apply->service_user_id=\Yii::$app->user->identity->getId();
|
||||
$apply->status=0;
|
||||
|
||||
$apply->saveOrFail();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user