当前位置: 首页>>代码示例>>PHP>>正文


PHP Log::find方法代码示例

本文整理汇总了PHP中app\models\Log::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::find方法的具体用法?PHP Log::find怎么用?PHP Log::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Log的用法示例。


在下文中一共展示了Log::find方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionIndex

 /**
  * @return string
  */
 public function actionIndex()
 {
     $low_stock_items = Item::find()->where('quantity >= 1 AND quantity <= 10')->all();
     $empty_stock_items = Item::find()->where('quantity = 0')->all();
     $logs = Log::find()->orderBy('created_at DESC')->limit(10)->all();
     return $this->render('index', ['low_stock_items' => $low_stock_items, 'empty_stock_items' => $empty_stock_items, 'logs' => $logs]);
 }
开发者ID:edarkzero,项目名称:mi_taller,代码行数:10,代码来源:SiteController.php

示例2: actionView

 /**
  * Displays a single Goal model.
  * @param $alias
  * @return mixed
  */
 public function actionView($alias)
 {
     $goal = $this->findModel(['alias' => $alias]);
     $id = $goal->id;
     $logRows = Log::find()->where(['goal_id' => $id])->orderBy('created_at DESC')->limit(5)->all();
     $taskQuery = Task::find()->where(['goal_id' => $id, 'closed' => 0])->orderBy('date')->limit(5);
     $taskRows = $taskQuery->all();
     $taskCount = $taskQuery->count();
     return $this->render('view', ['goal' => $goal, 'logRows' => $logRows, 'taskRows' => $taskRows, 'taskCount' => $taskCount, 'logModel' => new Log(['goal_id' => $id])]);
 }
开发者ID:sapozhkov,项目名称:goal,代码行数:15,代码来源:GoalController.php

示例3: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Log::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'equipment_id' => $this->equipment_id, 'user_id' => $this->user_id, 'status_id' => $this->status_id, 'date' => $this->date, 'room_id' => $this->room_id, 'log_type_id' => $this->log_type_id]);
     $query->andFilterWhere(['like', 'location', $this->location]);
     return $dataProvider;
 }
开发者ID:ricardo1121,项目名称:FMAT-SAECC,代码行数:18,代码来源:LogSearch.php

示例4: actionIndex

 public function actionIndex()
 {
     $data = Log::find()->orderBy('time DESC');
     $pages = new Pagination(['totalCount' => $data->count(), 'pageSize' => '10']);
     $model = $data->offset($pages->offset)->limit($pages->limit)->all();
     if ($page = \Yii::$app->request->get('page')) {
         if (intval(ceil($data->count() / 10)) < $page) {
             return false;
         }
         return $this->renderAjax('_list', ['model' => $model]);
     }
     return $this->render('index', ['model' => $model]);
 }
开发者ID:aiyeyun,项目名称:grab,代码行数:13,代码来源:LogController.php

示例5: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Log::find()->orderBy(['id' => SORT_DESC]);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 200]]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'login', $this->login])->andFilterWhere(['like', 'action', $this->action])->andFilterWhere(['like', 'date', $this->date]);
     return $dataProvider;
 }
开发者ID:nthrnth,项目名称:catering-terminal,代码行数:21,代码来源:LogSearch.php

示例6: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Log::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'goal_id' => $this->goal_id]);
     $query->andFilterWhere(['like', 'data', $this->data])->andFilterWhere(['like', 'message', $this->message])->andFilterWhere(['like', 'created_at', $this->created_at]);
     return $dataProvider;
 }
开发者ID:sapozhkov,项目名称:goal,代码行数:21,代码来源:LogSearch.php

示例7: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Log::find();
     $query->joinWith(['user', 'logType', 'equipment.equipmentType', 'equipment', 'location.room', 'location', 'equipmentStatus']);
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $dataProvider->sort->attributes['user'] = ['asc' => ['user.name' => SORT_ASC], 'desc' => ['user.name' => SORT_DESC]];
     $dataProvider->sort->attributes['logType'] = ['asc' => ['log_type.type' => SORT_ASC], 'desc' => ['log_type.type' => SORT_DESC]];
     $dataProvider->sort->attributes['equipmentType'] = ['asc' => ['equipment_type.name' => SORT_ASC], 'desc' => ['equipment_type.name' => SORT_DESC]];
     $dataProvider->sort->attributes['equipment'] = ['asc' => ['equipment.inventory' => SORT_ASC], 'desc' => ['equipment.inventory' => SORT_DESC]];
     $dataProvider->sort->attributes['available'] = ['asc' => ['equipment.available' => SORT_ASC], 'desc' => ['equipment.available' => SORT_DESC]];
     $dataProvider->sort->attributes['room'] = ['asc' => ['room.name' => SORT_ASC], 'desc' => ['room.name' => SORT_DESC]];
     $dataProvider->sort->attributes['location'] = ['asc' => ['location.location' => SORT_ASC], 'desc' => ['location.location' => SORT_DESC]];
     $dataProvider->sort->attributes['equipmentStatus'] = ['asc' => ['equipment_status.status' => SORT_ASC], 'desc' => ['equipment_status.status' => SORT_DESC]];
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'user.name', $this->user])->andFilterWhere(['like', 'log_type.type', $this->logType])->andFilterWhere(['like', 'equipment_type.name', $this->equipmentType])->andFilterWhere(['like', 'equipment.inventory', $this->equipment])->andFilterWhere(['like', 'equipment.available', $this->available])->andFilterWhere(['like', 'room.name', $this->room])->andFilterWhere(['like', 'location.location', $this->location])->andFilterWhere(['like', 'date', $this->date])->andFilterWhere(['like', 'equipment_status.status', $this->equipmentStatus]);
     return $dataProvider;
 }
开发者ID:rodespsan,项目名称:FMAT-SAECC,代码行数:30,代码来源:LogSearch.php

示例8: actionAdmin

 /**
  * Lists all Log models.
  * @return mixed
  */
 public function actionAdmin()
 {
     $dataProvider = new ActiveDataProvider(['query' => Log::find()]);
     return $this->render('admin', ['dataProvider' => $dataProvider]);
 }
开发者ID:andreyvaslv,项目名称:crb,代码行数:9,代码来源:LogController.php

示例9: if

$form = ActiveForm::begin();
?>
        <?php 
echo $form->field($model, 'answer')->textInput(['class' => 'input'])->label('');
?>

        <div class="form-group">
            <?php 
echo Html::submitButton('отправить код', ['class' => 'button--submit']);
?>
        </div>
        <?php 
ActiveForm::end();
?>
    </div>
    <div class="answer__header">Ответ:</div>
    <div>
        <? if ($model->is_answer_activate == 1): ?>
            <img src="<?php 
echo $model->map_url;
?>
">
        <? endif; ?>
    </div>
    <div class="log__header">Лог игры:</div>
    <?php 
echo GridView::widget(['dataProvider' => new ActiveDataProvider(['query' => \app\models\Log::find()->where(['challenge_id' => $model->id])->orderBy('id DESC')]), 'layout' => "{items}", 'columns' => ['time', 'text', 'answer']]);
?>
</div>

开发者ID:Aksigera,项目名称:dozor,代码行数:29,代码来源:index.php

示例10: run

 public function run()
 {
     $dataProvider = new ActiveDataProvider(['query' => Log::find()->where(['model' => $this->model, 'model_id' => $this->model_id])->orderBy('id DESC')]);
     return $this->render('logsGridWidget', ['dataProvider' => $dataProvider]);
 }
开发者ID:mops1k,项目名称:yiimine,代码行数:5,代码来源:LogsGridWidget.php

示例11: actionIndex

 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => Log::find()->orderBy('log_time desc')]);
     return $this->render('index', array('dataProvider' => $dataProvider));
 }
开发者ID:vilison,项目名称:yii2-order,代码行数:5,代码来源:LogController.php

示例12: actionLogs

 function actionLogs()
 {
     $logs = Log::find()->where("ip NOT IN('192.168.1.1', '127.0.0.1', '213.87.126.229')")->orderBy('id DESC')->limit(50)->all();
     return $this->renderPartial('logs', ['logs' => $logs]);
 }
开发者ID:roman1970,项目名称:lis,代码行数:5,代码来源:DefaultController.php


注:本文中的app\models\Log::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。