Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Info::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, 'country' => $this->country, 'province' => $this->province, 'city' => $this->city, 'district' => $this->district, 'order_amount' => $this->order_amount, 'discount' => $this->discount, 'cms_ad_id' => $this->cms_ad_id, 'add_time' => $this->add_time, 'confirm_time' => $this->confirm_time, 'payment_time' => $this->payment_time, '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', 'order_no', $this->order_no])->andFilterWhere(['like', 'consignee', $this->consignee])->andFilterWhere(['like', 'address', $this->address])->andFilterWhere(['like', 'zipcode', $this->zipcode])->andFilterWhere(['like', 'tel', $this->tel])->andFilterWhere(['like', 'mobile', $this->mobile])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'order_note', $this->order_note])->andFilterWhere(['like', 'referer', $this->referer])->andFilterWhere(['like', 'payment_note', $this->payment_note]);
     return $dataProvider;
 }
Example #2
0
 /**
  * Finds the Info model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Info the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Info::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #3
0
</span></b>
                    </span>
                </a>
                <!-- Header Navbar: style can be found in header.less -->
                <nav class="navbar navbar-static-top" role="navigation">
                    <!-- Sidebar toggle button-->
                    <a href="javascript:;" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                        <span class="sr-only">切换</span>
                    </a>
                    <!-- Navbar Right Menu -->
                    <div class="navbar-custom-menu">
                        <ul class="nav navbar-nav">
                        	
                        	<!-- 订单通知 -->
                        	<?php 
$orderInfos = Info::find()->where(['is_view' => Info::STATUS_NO])->orderBy('created_at DESC')->all();
?>
                            <li class="dropdown notifications-menu">
                                <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">
                                    <i class="fa fa-bell-o"></i>
                                    <span class="label label-warning"><?php 
echo count($orderInfos);
?>
</span>
                                </a>
                                <ul class="dropdown-menu">
                                    <li class="header"><?php 
echo $orderInfos ? '您有新订单' : '没有订单';
?>
</li>
                                    <li>