64 lines
1.4 KiB
PHP
64 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace member\modules\v1\controllers;
|
|
|
|
use common\core\BaseAppController;
|
|
use common\forms\PrescripRefundForm;
|
|
use common\models\oldDb\DrugUseWay;
|
|
use member\models\forms\PrescripOrderSubmitForm;
|
|
|
|
/**
|
|
* @doc-module 处方支付订单
|
|
*/
|
|
class PrescripOrderController extends BaseAppController
|
|
{
|
|
/**
|
|
* 提交
|
|
*/
|
|
public function actionSubmit()
|
|
{
|
|
|
|
}
|
|
|
|
/**
|
|
* @doc-name 支付处方
|
|
* @doc-param int order_id 订单id
|
|
* @doc-return int is_paid 1已支付0未支付
|
|
* @doc-return int order_id 订单id
|
|
* @doc-return array config 支付配置参数,在is_paid=0时返回
|
|
*/
|
|
public function actionPay()
|
|
{
|
|
$post = \Yii::$app->request->post();
|
|
$this->requestValidate($post,[
|
|
['order_id','required']
|
|
]);
|
|
$form = new PrescripOrderSubmitForm();
|
|
return $form->getPayData($post['order_id']);
|
|
}
|
|
|
|
/**
|
|
*@doc-name 处方退款
|
|
*@doc-param int order_id 订单id
|
|
*/
|
|
public function actionCancel()
|
|
{
|
|
$post = \Yii::$app->request->post();
|
|
$this->requestValidate($post,[
|
|
['order_id','required']
|
|
]);
|
|
$form= new PrescripRefundForm();
|
|
return $form->refund($post['order_id']);
|
|
}
|
|
|
|
/**
|
|
* @doc-name 中药的使用煎熬方式
|
|
* @doc-return mixed @drug-use-way{*}
|
|
*/
|
|
public function actionUseWay()
|
|
{
|
|
return DrugUseWay::find()->all();
|
|
}
|
|
|
|
}
|