Esempio n. 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = MHd201509t4::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['hd201509t4_id' => $this->hd201509t4_id, 'score' => $this->score, 'create_time' => $this->create_time, 'status' => $this->status]);
     $query->andFilterWhere(['like', 'gh_id', $this->gh_id])->andFilterWhere(['like', 'openid', $this->openid])->andFilterWhere(['like', 'mobile', $this->mobile]);
     return $dataProvider;
 }
Esempio n. 2
0
    <//?= $form->field($model, 'openid')->textInput(['maxlength' => 255]) ?>

    <//?= $form->field($model, 'mobile')->textInput(['maxlength' => 16]) ?>

    <//?= $form->field($model, 'score')->textInput() ?>

    <//?= $form->field($model, 'create_time')->textInput() ?>

    <//?= $form->field($model, 'status')->textInput() ?>
    -->



    <br> <br>

    <?php 
echo $form->field($model, 'status')->dropDownList(MHd201509t4::gethd201509t4StatusOption());
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? '创建' : '修改', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
Esempio n. 3
0
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <!--
    <p>
        <//?= Html::a('Create Mhd201509t4', ['create'], ['class' => 'btn btn-success']) ?>
    </p>
    -->

    <p>
    <?php 
echo Html::a('下载 <i class="glyphicon glyphicon-arrow-down"></i>', U::current(['download' => 1]), ['class' => 'btn btn-success', 'data-pjax' => '0']);
?>
    </p>

    
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['label' => '微信昵称', 'format' => 'html', 'value' => function ($model, $key, $index, $column) {
    $user = $model->user;
    return empty($user) ? '' : "<img width=48 src=" . $model->user->headimgurl . "><br>" . emoji_unified_to_html(emoji_softbank_to_unified($user->nickname));
}, 'filter' => false, 'headerOptions' => array('style' => 'width:90px;')], 'mobile', 'score', 'create_time', ['attribute' => 'status', 'label' => '状态', 'value' => function ($model, $key, $index, $column) {
    return MHd201509t4::gethd201509t4StatusOption($model->status);
}, 'filter' => MHd201509t4::gethd201509t4StatusOption(), 'headerOptions' => array('style' => 'width:120px;')], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update}', 'buttons' => ['update' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, ['title' => Yii::t('yii', 'Update'), 'data-pjax' => '0']);
}]]]]);
?>

</div>
Esempio n. 4
0
<?php

use yii\helpers\Html;
use yii\helpers\Url;
use app\models\U;
include '../models/utils/emoji.php';
\Yii::$app->wx->setGhId($observer->gh_id);
$gh = \Yii::$app->wx->getGh();
$jssdk = new \app\models\JSSDK($gh['appid'], $gh['appsecret']);
$signPackage = $jssdk->GetSignPackage();
$lists = \app\models\MHd201509t4::find()->where(['openid' => $observer->openid, 'status' => 2])->orderBy(['create_time' => SORT_ASC])->all();
?>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>捐献积分献爱心</title>

    <!-- Sets initial viewport load and disables zooming  -->
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">

    <!-- Makes your prototype chrome-less once bookmarked to your phone's home screen -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <!-- Include the compiled Ratchet CSS -->
    <link href="/wx/web/ratchet/dist/css/ratchet.css" rel="stylesheet">
    <link href="./php-emoji/emoji.css" rel="stylesheet">    
    <link rel="stylesheet" href="http://libs.useso.com/js/font-awesome/4.2.0/css/font-awesome.min.css">
Esempio n. 5
0
 /**
  * Finds the MHd201509t4 model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return MHd201509t4 the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = MHd201509t4::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }