67 lines
1.3 KiB
PHP
67 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace app\modules\admin\controllers;
|
|
|
|
use app\components\TongLianPay;
|
|
use app\modules\admin\behaviors\LoginBehavior;
|
|
use app\modules\admin\models\SigningForm;
|
|
|
|
class SigningController extends Controller
|
|
{
|
|
|
|
|
|
public function behaviors()
|
|
{
|
|
return array_merge(parent::behaviors(), [
|
|
'login' => [
|
|
'class' => LoginBehavior::className(),
|
|
],
|
|
]);
|
|
}
|
|
|
|
|
|
public function actionIndex()
|
|
{
|
|
if (\Yii::$app->request->isAjax) {
|
|
|
|
$signingForm = new SigningForm();
|
|
|
|
$signingForm->attributes = \Yii::$app->request->get();
|
|
|
|
$data = $signingForm->getList();
|
|
|
|
return $this->responseHandler($data);
|
|
|
|
}
|
|
return $this->render('index');
|
|
}
|
|
|
|
|
|
public function actionRefund()
|
|
{
|
|
if (\Yii::$app->request->isAjax) {
|
|
|
|
$tongLianPay = new TongLianPay();
|
|
|
|
return $this->responseHandler($tongLianPay->refund(\Yii::$app->request->post('id'), \Yii::$app->request->post('reason')));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public function actionSigning()
|
|
{
|
|
|
|
if (\Yii::$app->request->isAjax) {
|
|
|
|
$signingForm = new SigningForm();
|
|
|
|
$signingForm->attributes = \Yii::$app->request->post();
|
|
|
|
return $this->responseHandler($signingForm->signing());
|
|
}
|
|
|
|
|
|
}
|
|
|
|
} |