/var/www/vhosts/nabawater/backend/models
Edit: /var/www/vhosts/nabawater/backend/models/ItemIngredientGroupSearch.php (2387B)
alias('IIG')
->select('IIG.*')
->where(['<>', 'IIG.item_ingredient_status', ItemIngredientGroup::DELETE]);
if (AdminUser::isVendor() || AdminUser::isBranch()) {
$query->andWhere(['IIG.vendor_id' => Yii::$app->getUser()->getIdentity()->vendor_id]);
}
ItemIngredientGroup::selectTranslation($query);
Vendor::selectTranslation($query,'IIG', null, 'VL');
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => [
'PageSize' => Com::postPerPage(),
],
'sort' => [
'attributes' => [
'item_ingredient_group_id',
'group_name',
'sort_no'
],
'defaultOrder' => [
'item_ingredient_group_id' => SORT_DESC,
'group_name' => SORT_ASC,
'sort_no' => SORT_DESC
]
]
]);
$this->load($params);
if(!$this->validate()) {
return $dataProvider;
}
$query->andFilterWhere(['like', 'IIGL.group_name', strtolower($this->group_name)])
->andFilterWhere(['like', 'IIG.ingredient_type', strtolower($this->ingredient_type)])
->andFilterWhere(['like', 'IIG.sort_no', strtolower($this->sort_no)])
->andFilterWhere(['like', 'IIG.vendor_id', strtolower($this->vendor_name)])
->andFilterWhere(['like', 'IIG.item_ingredient_status', $this->item_ingredient_status]);
return $dataProvider;
}
}