modules/admin/models/search/BridecycleToSellerPaymentsSearch.php
/**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
Creates data provider instance with search query applied
@param array $params


Creates data provider instance with search query applied @param array $params
public function search($params)
    {
        $query = BridecycleToSellerPayments::find();
        $query->leftJoin('users As seller', 'bridecycle_to_seller_payments.seller_id=seller.id');
        $query->leftJoin('orders As order', 'bridecycle_to_seller_payments.order_id=order.id');
        $query->leftJoin('users As buyer', 'order.user_id=buyer.id');
        $query->leftJoin('order_items', 'bridecycle_to_seller_payments.order_item_id=order_items.id');
        $query->leftJoin('products', 'order_items.product_id=products.id');
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'sort' => ['defaultOrder' => ['id' => SORT_DESC]],
            'pagination' => [
                'pageSize' => 50,
            ]
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->andFilterWhere([
            'id' => $this->id,
            'bridecycle_to_seller_payments.status' => $this->status,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);
        $query->andFilterWhere(['like', 'bridecycle_to_seller_payments.order_id', $this->order_id])
            ->andFilterWhere(['or',
                ['like', 'seller.first_name', $this->seller_id],
                ['like', 'seller.last_name', $this->seller_id]
            ])
            ->andFilterWhere(['or',
                ['like', 'buyer.first_name', $this->buyer_id],
                ['like', 'buyer.last_name', $this->buyer_id]
            ])
            ->andFilterWhere(['like', 'products.name', $this->order_item_id])
            ->andFilterWhere(['like', 'amount', $this->amount . "%", false])
            ->andFilterWhere(['like', 'note_content', $this->note_content]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = BridecycleToSellerPayments :: find ( ) ; $ query -> leftJoin ( 'users As seller' , 'bridecycle_to_seller_payments.seller_id=seller.id' ) ; $ query -> leftJoin ( 'orders As order' , 'bridecycle_to_seller_payments.order_id=order.id' ) ; $ query -> leftJoin ( 'users As buyer' , 'order.user_id=buyer.id' ) ; $ query -> leftJoin ( 'order_items' , 'bridecycle_to_seller_payments.order_item_id=order_items.id' ) ; $ query -> leftJoin ( 'products' , 'order_items.product_id=products.id' ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , 'sort' => [ 'defaultOrder' => [ 'id' => SORT_DESC ] ] , 'pagination' => [ 'pageSize' => 50 , ] ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> andFilterWhere ( [ 'id' => $ this -> id , 'bridecycle_to_seller_payments.status' => $ this -> status , 'created_at' => $ this -> created_at , 'updated_at' => $ this -> updated_at , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'bridecycle_to_seller_payments.order_id' , $ this -> order_id ] ) -> andFilterWhere ( [ 'or' , [ 'like' , 'seller.first_name' , $ this -> seller_id ] , [ 'like' , 'seller.last_name' , $ this -> seller_id ] ] ) -> andFilterWhere ( [ 'or' , [ 'like' , 'buyer.first_name' , $ this -> buyer_id ] , [ 'like' , 'buyer.last_name' , $ this -> buyer_id ] ] ) -> andFilterWhere ( [ 'like' , 'products.name' , $ this -> order_item_id ] ) -> andFilterWhere ( [ 'like' , 'amount' , $ this -> amount . " % " , false ] ) -> andFilterWhere ( [ 'like' , 'note_content' , $ this -> note_content ] ) ; return $ dataProvider ; }
Creates data provider instance with search query applied
 @param array $params
Creates data provider instance with search query applied @param array $params
// add conditions that should always apply here //'pageSize' => (!empty(\Yii::$app->params['default_page_size_for_backend'])) ? \Yii::$app->params['default_page_size_for_backend'] : 50, // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); // grid filtering conditions