68 lines
1.8 KiB
PHP
68 lines
1.8 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @author Any
|
|
* @description KISS
|
|
* @date 2021年6月30日
|
|
* @version 1.0.0
|
|
*
|
|
* _____LOG_____
|
|
*
|
|
*/
|
|
namespace app\modules\admin\controllers;
|
|
|
|
use app\models\Coupon;
|
|
use app\models\Store;
|
|
use app\modules\admin\behaviors\LoginBehavior;
|
|
use app\modules\admin\models\ActivityActionForm;
|
|
use app\modules\admin\models\coupon\CouponActionForm;
|
|
use app\modules\admin\models\coupon\CouponEditForm;
|
|
use app\modules\admin\models\coupon\CouponListForm;
|
|
|
|
class ActivityController extends Controller
|
|
{
|
|
public function behaviors()
|
|
{
|
|
return array_merge(parent::behaviors(), [
|
|
'login' => [
|
|
'class' => LoginBehavior::className(),
|
|
],
|
|
]);
|
|
}
|
|
|
|
//活动列表
|
|
public function actionIndex()
|
|
{
|
|
if(\Yii::$app->request->isAjax){
|
|
$form = new ActivityActionForm();
|
|
$form->attributes = \Yii::$app->request->get();
|
|
$data = $form->search();
|
|
return $this->responseHandler($data);
|
|
}
|
|
return $this->render('index');
|
|
}
|
|
|
|
//创建数据
|
|
public function actionEdit(){
|
|
$form = new ActivityActionForm();
|
|
$form->attributes = \Yii::$app->request->post();
|
|
$data = $form->actionEdit();
|
|
return $this->responseHandler($data);
|
|
}
|
|
|
|
//创建数据
|
|
public function actionDelete(){
|
|
$form = new ActivityActionForm();
|
|
$form->attributes = \Yii::$app->request->post();
|
|
$data = $form->actionDelete();
|
|
return $this->responseHandler($data);
|
|
}
|
|
|
|
// 参与用户
|
|
public function actionJoinUser(){
|
|
$form = new ActivityActionForm();
|
|
$form->attributes = \Yii::$app->request->get();
|
|
$data = $form->actionJoinUser();
|
|
return $this->responseHandler($data);
|
|
}
|
|
} |