/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Call::find()->alive(); $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['created_at' => 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, 'customer_id' => $this->customer_id, 'deleted' => $this->deleted, 'is_send' => $this->is_send, 'is_view' => $this->is_view, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at]); $query->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'contact', $this->contact])->andFilterWhere(['like', 'call_note', $this->call_note]); return $dataProvider; }
<?php } ?> </ul> </li> <li class="footer"> <?php echo Html::a('查看所有订单', ['/order/info/index']); ?> </li> </ul> </li> <!-- 预约通知 --> <?php $orderCalls = Call::find()->where(['is_view' => Call::STATUS_NO])->orderBy('created_at DESC')->all(); ?> <li class="notifications-menu"> <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-comment-o"></i> <span class="label label-warning"><?php echo count($orderCalls); ?> </span> </a> <ul class="dropdown-menu"> <li class="header"><?php echo $orderCalls ? '您有新预约' : '没有预约'; ?> </li> <li>