Beispiel #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Customer::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['id' => 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, 'phone_number' => $this->phone_number, 'dob' => $this->dob, 'gender' => $this->gender, 'language_id' => $this->language_id, 'is_active' => $this->is_active, 'status' => $this->status, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'total_purchase_orders' => $this->total_purchase_orders, 'total_purchase_products' => $this->total_purchase_products, 'total_purchase_value' => $this->total_purchase_value]);
     $query->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'password_hash', $this->password_hash])->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])->andFilterWhere(['like', 'auth_key', $this->auth_key])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'address', $this->address])->andFilterWhere(['like', 'firstname', $this->firstname])->andFilterWhere(['like', 'lastname', $this->lastname])->andFilterWhere(['like', 'image', $this->image])->andFilterWhere(['like', 'image_path', $this->image_path])->andFilterWhere(['like', 'zip_postal_code', $this->zip_postal_code]);
     return $dataProvider;
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Customer::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(['customer_birthdate' => $this->customer_birthdate]);
     $query->andFilterWhere(['like', 'customer_user_name', $this->customer_user_name])->andFilterWhere(['like', 'customer_first_name', $this->customer_first_name])->andFilterWhere(['like', 'customer_last_name', $this->customer_last_name])->andFilterWhere(['like', 'customer_address1', $this->customer_address1])->andFilterWhere(['like', 'customer_address2', $this->customer_address2])->andFilterWhere(['like', 'customer_email', $this->customer_email])->andFilterWhere(['like', 'customer_gender', $this->customer_gender])->andFilterWhere(['like', 'customer_from', $this->customer_from])->andFilterWhere(['like', 'customer_favcolor', $this->customer_favcolor]);
     return $dataProvider;
 }
Beispiel #3
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params, $pagination = 10)
 {
     $query = Customer::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pagesize' => $pagination]]);
     $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;
     }
     // grid filtering conditions
     $query->andFilterWhere(['id' => $this->id, 'role' => $this->role, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at]);
     $query->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'tel', $this->tel])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'address', $this->address])->andFilterWhere(['like', 'postal', $this->postal])->andFilterWhere(['like', 'city', $this->city]);
     return $dataProvider;
 }
Beispiel #4
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Customer::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([
     //            'ts_create' => $this->ts_create,
     //            'ts_update' => $this->ts_update,
     //            'IsDelete' => $this->IsDelete,
     //        ]);
     $query->orFilterWhere(['like', 'Cus_id', $this->globalSearch])->orFilterWhere(['like', 'Cus_Name', $this->globalSearch])->orFilterWhere(['like', 'Cus_Nickname', $this->globalSearch])->orFilterWhere(['like', 'Cus_Phone', $this->globalSearch])->orFilterWhere(['like', 'Cus_Email', $this->globalSearch])->orFilterWhere(['like', 'Cus_Website', $this->globalSearch])->orFilterWhere(['like', 'Cus_Address', $this->globalSearch])->orFilterWhere(['like', 'Cus_Contactname', $this->globalSearch])->orFilterWhere(['like', 'Cus_Customeras', $this->globalSearch])->orFilterWhere(['like', 'Cus_Country', $this->globalSearch])->orFilterWhere(['like', 'ts_name', $this->globalSearch]);
     return $dataProvider;
 }
 public function actionShowlist2($id)
 {
     $count = Customer::find()->where(['Cus_id' => $id])->count();
     $model = Customer::find()->where(['Cus_id' => $id])->all();
     if ($count > 0) {
         foreach ($model as $value) {
             $contry = \backend\models\Country::find()->where(['Cry_id' => $value->Cus_Country])->all();
             $fullname2 = '';
             foreach ($contry as $data2) {
                 $fullname2 = $data2->Cry_nameEN . " [" . $data2->Cry_nameTH . "]";
             }
             $session = new Session();
             $session->open();
             $session['shipto'] = $value->Cus_Country;
             echo "<option value='" . $value->Cus_Country . "'>{$fullname2}</option>";
         }
     } else {
         echo "<option>-</option>";
     }
 }
Beispiel #6
0
    echo Yii::$app->urlManager->createUrl('noreply-email/create');
    ?>
"><i class="fa fa-circle-o"></i> Thêm mới</a></li>
                </ul>
            </li>
            <!-- Khách hàng -->
            <li class="treeview <?php 
    echo in_array(Yii::$app->controller->id, ['customer', 'customer-log']) ? 'active' : '';
    ?>
">
                <a href="<?php 
    echo Yii::$app->urlManager->createUrl('customer/index');
    ?>
">
                    <i class="fa fa-user"></i> <span>Khách hàng</span> <span class="label label-danger pull-right"><?php 
    echo Customer::find()->where(['status' => Customer::STATUS_ACTIVE])->count();
    ?>
</span>
                </a>
<!--                <ul class="treeview-menu">
                    <li class="<?php 
    echo Yii::$app->controller->id == 'customer' && Yii::$app->controller->action->id == 'index' ? 'active' : '';
    ?>
"><a href="<?php 
    echo Yii::$app->urlManager->createUrl('customer/index');
    ?>
"><i class="fa fa-circle-o"></i> Danh sách</a></li>
                    <li class="<?php 
    echo Yii::$app->controller->id == 'customer-log' && Yii::$app->controller->action->id == 'index' ? 'active' : '';
    ?>
"><a href="<?php 
 public function actionEditpoint()
 {
     $user = new AdminUser();
     if (!$user->checkUserIsLogin()) {
         $this->redirect(Variable::$home_url);
         return;
     }
     //        $form=new CustomerForm();
     //        $req=Yii::$app->request;//创建一个请求对象
     //        $form->setScenario('update');
     //        if($form->load($req->post()) && $form->validate()){
     //            print_r($form);
     //        }
     //        $form->setScenario('update');
     $req = Yii::$app->request;
     //创建一个请求对象
     $id = trim($req->get('id'));
     if (!is_numeric($id) || $id == 0) {
         $this->redirect(Variable::$barIndex_url);
         return;
     }
     $brandModel = Customer::findOne($id);
     $catModel = Customer::find()->where(['parentId' => $id])->all();
     //        $barListModel=Bar::find()->where(['parentBar'=>$id])->all();
     return $this->render(Variable::$editPoint_view, ['catModel' => $catModel, 'brandModel' => $brandModel]);
 }