$months [$i] = ['Январь','Февраль','Март','Апрель','Май','Июнь', 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'][$i-1];
}
- $stores = ArrayHelper::map(CityStore::find()->all(), 'id', 'name');
+ $stores = ArrayHelper::map(CityStore::find()->andWhere(['visible' => '1'])->all(), 'id', 'name');
$tbSettings = [];
$teambonusSettings = TeambonusSettings::find()->where(['year' => $filterModel->year, 'month' => $filterModel->month])
$reports = [];
- $cityStoreNames = ArrayHelper::map(CityStore::find()->all(), 'id', 'name');
+ $cityStoreNames = ArrayHelper::map(CityStore::find()->where(['visible' => '1'])->all(), 'id', 'name');
$eitStores = ExportImportTable::find()->where(['export_val' => $data->stores])
->select(['entity_id', 'export_val'])
$timetableFactModelQuery->orderBy(['date_shift' => SORT_DESC]);
}
- $storeArr = CityStore::find()->all();
+ $storeArr = CityStore::find()->andWhere(['visible' => '1'])->all();
$stores = [0 => 'Любой'];
foreach ($storeArr as $store) {
$stores[$store->id] = $store->name;
$stores = CityStore::find()
->select(['name', 'id'])
->andWhere(['id' => $_SESSION["store_arr_dostup"]])
+ ->andWhere(['visible' => '1'])
->indexBy('id')
->cache(3600)
->column();
return CityStore::find()
->select(['name', 'id'])
->andWhere(['id' => $_SESSION["store_arr_dostup"]])
+ ->andWhere(['visible' => '1'])
->indexBy('id')
->cache(3600)
->column();
public function getStore(): ActiveQueryInterface
{
- return $this->hasOne(CityStore::class, ['id' => 'store_id']);
+ return $this->hasOne(CityStore::class, ['id' => 'store_id'])->andWhere(['visible' => '1']);
}
/**
$values = self::find()
->andWhere(['id' => DashboardSales::getActiveCityStore()])
+ ->andWhere(['visible' => '1'])
->orderBy([self::tableName() . '.name' => SORT_ASC])
->all();
public static function getNames(array $storeIds = []): array
{
- $query = self::find()->select(['name', 'id']);
+ $query = self::find()->select(['name', 'id'])->andWhere(['visible' => '1']);
if (!empty($storeIds)) {
$query->andWhere(['id' => $storeIds]);
->select(['name', 'id'])
->indexBy('id')
->andWhere('tip=:tip', [':tip' => $tip])
+ ->andWhere(['view' => 1])
->column();
}
$query->joinWith(['cityStore']);
// add conditions that should always apply here
+ $query->andWhere(['city_store.visible' => '1']);
$dataProvider = new ActiveDataProvider([
'query' => $query,