12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace frontend\controllers;
- use common\models\ActivityReceive;
- use common\models\RedActivity;
- use Yii;
- use yii\web\Controller;
- use yii\filters\AccessControl;
- /**
- * red controller
- */
- class RedactivityController extends BasewechatController
- {
- static $pagenum = 20;
- public function behaviors()
- {
- return [
- 'access' => [
- 'class' => AccessControl::className(),
- 'rules' => [
- [
- 'actions' => [],
- 'allow' => true,
- 'roles' => ['@'],
- ],
- ],
- ],
- ];
- }
- /**
- * 红包记录
- */
- public function actionRedlog()
- {
- $mod = ActivityReceive::findBySql("SELECT a.amount,a.receive_at,b.title FROM {{%activity_receive}} AS a LEFT JOIN {{%building}} AS b ON a.source_id = b.id WHERE a.uid = :uid AND a.status = :status ORDER BY a.id desc LIMIT ".self::$pagenum,[':uid'=>Yii::$app->user->id,':status'=>ActivityReceive::STATUS_YES]);
- $list = $mod->asArray()->all();
- Yii::$app->view->title="红包记录";
- return $this->render('redlog',['datas'=>$list]);
- }
- }
|