73 lines
1.6 KiB
PHP
73 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace service\modules\v1\controllers;
|
|
|
|
use common\core\BaseAppController;
|
|
use common\models\oldDb\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();
|
|
}
|
|
} |