65 lines
2.0 KiB
PHP
65 lines
2.0 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @author Any
|
|
* @description KISS
|
|
* @date 2021年10月4日
|
|
* @version 1.0.0
|
|
*
|
|
* _____LOG_____
|
|
*
|
|
*/
|
|
namespace app\modules\admin\controllers\integral;
|
|
|
|
use yii\helpers\VarDumper;
|
|
use app\modules\admin\controllers\Controller;
|
|
use app\modules\admin\behaviors\LoginBehavior;
|
|
use app\models\common\integral\CommonIntegralLogListForm;
|
|
use app\models\integral\Integral;
|
|
use app\models\common\integral\CommonRechargeIntegralActionForm;
|
|
|
|
class IntegralController extends Controller
|
|
{
|
|
public function behaviors()
|
|
{
|
|
return array_merge(parent::behaviors(), [
|
|
'login' => [
|
|
'class' => LoginBehavior::className(),
|
|
],
|
|
]);
|
|
}
|
|
|
|
public function actionIndex()
|
|
{
|
|
if(\Yii::$app->request->isAjax){
|
|
$form = new CommonIntegralLogListForm();
|
|
$form->attributes = \Yii::$app->request->get();
|
|
$form->cx_mch_id = $this->cx_mch_id;
|
|
$form->scene = Integral::$cxIntegralSceneUserIntegralWallet;
|
|
$data = $form->search();
|
|
return $this->responseHandler($data);
|
|
}
|
|
return $this->render('index');
|
|
}
|
|
|
|
//积分充值
|
|
public function actionRecharge()
|
|
{
|
|
if(!\Yii::$app->request->isPost){
|
|
$data = $this->invaildRequest();
|
|
return $this->responseHandler($data);
|
|
}
|
|
$form = new CommonRechargeIntegralActionForm();
|
|
$form->scenario = 'recharge';
|
|
$form->attributes = \Yii::$app->request->post();
|
|
$form->cx_mch_id = $this->cx_mch_id;
|
|
$form->scene = Integral::$cxIntegralSceneUserIntegralWallet;
|
|
$nickname = \Yii::$app->admin->identity->user->nickname;
|
|
$username = \Yii::$app->admin->identity->user->username;
|
|
$form->operator_name = "{$nickname}[$username]";
|
|
$data = $form->recharge();
|
|
return $this->responseHandler($data);
|
|
}
|
|
}
|
|
|