/var/www/vhosts/nabawater/backend/models
Edit: /var/www/vhosts/nabawater/backend/models/WalletTransactionSearch.php (2320B)
alias('WT')
->leftJoin(['U' => User::tableName()], 'WT.user_key = U.user_key')
->orderBy(['WT.wallet_transaction_id' => SORT_DESC])
->where(['transaction_status' => 1]);
if($type == 0) {
$query->andWhere(['<>','pay_type', WalletTransaction::TRANS_TYPE_PROMATION]);
} else {
$query->andWhere(['=','pay_type', WalletTransaction::TRANS_TYPE_PROMATION]);
}
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => [
'PageSize' => Com::postPerPage(),
],
'sort' => [
'attributes' => [
'wallet_transaction_id',
],
'defaultOrder' => [
'wallet_transaction_id' => SORT_ASC,
]
]
]);
$this->load($params);
if(!$this->validate()) {
return $dataProvider;
}
$query->andFilterWhere(['like', 'WT.user_key', $this->user_key]);
// ->andFilterWhere(['like', 'last_name', $this->last_name])
// ->andFilterWhere(['like', 'email', $this->email])
// ->andFilterWhere(['like', 'username', $this->username])
// ->andFilterWhere(['like', 'mobile_number', $this->mobile_number])
// ->andFilterWhere(['like', 'status', $this->status])
// ->andFilterWhere(['=', 'wallet_point', $this->wallet_point]);
return $dataProvider;
}
}