128 lines
4.6 KiB
PHP
128 lines
4.6 KiB
PHP
<?php
|
||
|
||
namespace member\modules\v1\controllers;
|
||
|
||
use common\core\BaseAppController;
|
||
use common\models\oldDb\PhysicalPackage;
|
||
use member\models\forms\PhysicalForm;
|
||
use Yii;
|
||
use yii\base\Exception;
|
||
|
||
/**
|
||
* @doc-module 体检套餐
|
||
*/
|
||
class PhysicalController extends BaseAppController
|
||
{
|
||
public $modelClass = PhysicalPackage::class;
|
||
public $optional = [];
|
||
|
||
/**
|
||
* @doc-name 体检套餐列表
|
||
* @doc-desc 体检套餐数据接口
|
||
* @doc-author liwei
|
||
* @doc-param int type 排序类型(1-男性;2-女未婚;3-女已婚) 0 optional
|
||
* @doc-param int all 综合排序(传-1) 0 optional
|
||
* @doc-param int page 页码 1 optional
|
||
* @doc-param int page_size 每页条数 20 optional
|
||
* @doc-return mixed @List{id-int-套餐id,name-string-套餐名称,image-string-图片,price-float-价格,intro-text-描述,content-html-项目详情,service-html-项目须知,type-int-类型,sale-int-销量} 体检套餐列表
|
||
* @doc-return mixed @Pagination{total-int-总数量,totalPage-int-总页数,pageSize-int-每页条数} 分页数据
|
||
*/
|
||
public function actionPackageList(): object
|
||
{
|
||
$form = new PhysicalForm();
|
||
$form->attributes = Yii::$app->request->post();
|
||
try {
|
||
$list = $form->getPhysicalPackageList();
|
||
} catch (Exception $e) {
|
||
return $e->getMessage();
|
||
}
|
||
$this->field = $list['field'];
|
||
|
||
return $list['data'];
|
||
}
|
||
|
||
/**
|
||
* @doc-name 体检套餐详情
|
||
* @doc-desc 体检套餐数据接口
|
||
* @doc-author liwei
|
||
* @doc-param int id 套餐id
|
||
* @doc-param int yard_id 分院id 0 optional
|
||
* @doc-return mixed {image-string-图片}
|
||
* @doc-return mixed {sale-int-销量}
|
||
* @doc-return mixed {price-float-价格}
|
||
* @doc-return mixed {name-string-套餐名称}
|
||
* @doc-return mixed {intro-string-描述}
|
||
* @doc-return mixed {content-html-项目详情}
|
||
* @doc-return mixed {service-html-服务须知}
|
||
* @doc-return mixed @YardPhysical{yard_id-int-分院id,physical_id-int-套餐id} 分院关系
|
||
* @doc-return mixed @Yard{name-string-分院名,position-string-分院地址,hospital_id-int-总院id} 分院信息
|
||
* @doc-return mixed @Reserve{day-int-日期对应的剩余预约数} 预约数据
|
||
*/
|
||
public function actionPackageDetail(): array
|
||
{
|
||
$post = Yii::$app->request->post();
|
||
$this->requestValidate($post,[
|
||
[['id'],'required']
|
||
]);
|
||
|
||
$form = new PhysicalForm();
|
||
$form->attributes = $post;
|
||
|
||
return $form->getPhysicalPackage();
|
||
}
|
||
|
||
/**
|
||
* @doc-name 体检预约
|
||
* @doc-desc 体检预约接口
|
||
* @doc-author liwei
|
||
* @doc-param int yard_id 分院id
|
||
* @doc-param int physical_id 套餐id
|
||
* @doc-param int day 预约时间(天)
|
||
* @doc-param int way 获取报告方式 0 optional
|
||
* @doc-return mixed {success-int-是否成功}
|
||
* @doc-return mixed {msg-string-预约信息}
|
||
*/
|
||
public function actionReserve(): array
|
||
{
|
||
$post = Yii::$app->request->post();
|
||
$this->requestValidate($post,[
|
||
[['yard_id','physical_id','day'],'required']
|
||
]);
|
||
|
||
$form = new PhysicalForm();
|
||
$form->attributes = $post;
|
||
|
||
return $form->setPhysicalReserve();
|
||
}
|
||
|
||
/**
|
||
* @doc-name 挂号详情
|
||
* @doc-desc 挂号详情接口
|
||
* @doc-author liwei
|
||
* @doc-param int id 预约id
|
||
* @doc-return mixed {user_id-int-用户id}
|
||
* @doc-return mixed {yard_id-int-分院id}
|
||
* @doc-return mixed {physical_id-int-体检套餐id}
|
||
* @doc-return mixed {id-int-预约id}
|
||
* @doc-return mixed {day-string-预约时间}
|
||
* @doc-return mixed {status-int-预约状态0预约中(待支付)1预约成功(已支付)2预约取消}
|
||
* @doc-return mixed {way-int-获取报告方式0电子报告}
|
||
* @doc-return mixed {intro-string-描述}
|
||
* @doc-return mixed @Yard{name-string-分院名,position-string-分院地址,hospital_id-int-总院id} 分院信息
|
||
* @doc-return mixed @User{mobile-string-用户手机号码,nickname-string-用户昵称,idcard-string-身份证} 用户数据
|
||
* @doc-return mixed @Package{name-string-套餐名称,image-string-套餐图片,price-float-套餐价格,intro-string-套餐介绍,content-html-项目详情,service-string-项目须知,type-int-类型,sale-int-销量} 体检套餐数据
|
||
*/
|
||
public function actionReserveDetail(): array
|
||
{
|
||
$post = Yii::$app->request->post();
|
||
$this->requestValidate($post,[
|
||
[['id'],'required']
|
||
]);
|
||
|
||
$form = new PhysicalForm();
|
||
$form->attributes = $post;
|
||
|
||
return $form->getReserveDetail();
|
||
}
|
||
}
|