change version to v.0.0.14 , add admin menu changes, add collection change
This commit is contained in:
parent
76ec26039f
commit
dcb4e862b3
@ -4,6 +4,7 @@ namespace backend\components;
|
||||
use Yii;
|
||||
use common\models\Order;
|
||||
use yii\helpers\Html;
|
||||
use common\components\RoleDefinition;
|
||||
|
||||
class AdminMenuStructure{
|
||||
|
||||
@ -43,18 +44,22 @@ class AdminMenuStructure{
|
||||
/////////////////////////////
|
||||
// Beállítások
|
||||
/////////////////////////////
|
||||
if ( RoleDefinition::isAdmin()){
|
||||
$items[] = ['label' => 'Felhasználók', 'url' =>['/user/index']];
|
||||
$items[] = ['label' => 'Jogosultságok', 'url' =>['/user/role']];
|
||||
$this->menuItems[] = ['label' => 'Beállítások', 'url' => $this->emptyUrl,
|
||||
'items' => $items
|
||||
];
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
// Törszadatok
|
||||
/////////////////////////////
|
||||
$items = [];
|
||||
$items[] = ['label' => 'Raktárak', 'url' =>['/warehouse/index']];
|
||||
$items[] = ['label' => 'Kasszák', 'url' =>['/account/index']];
|
||||
if ( RoleDefinition::isAdmin()){
|
||||
$items[] = ['label' => 'Kasszák', 'url' =>['/account/index']];
|
||||
}
|
||||
$items[] = ['label' => 'Kedvezmények', 'url' => ['/discount/index'] ];
|
||||
$items[] = ['label' => 'Termék kategóriák', 'url' => ['/product-category/index'] ];
|
||||
$items[] = ['label' => 'Bérlet típusok', 'url' => ['/ticket-type/index'] ];
|
||||
|
||||
@ -7,6 +7,7 @@ use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\AccountState;
|
||||
use common\components\RoleDefinition;
|
||||
use common\models\Account;
|
||||
|
||||
/**
|
||||
* AccountStateSearch represents the model behind the search form about `common\models\AccountState`.
|
||||
@ -54,10 +55,16 @@ class AccountStateSearch extends AccountState
|
||||
{
|
||||
$query = AccountState::find();
|
||||
|
||||
$query->innerJoinWith('account');
|
||||
|
||||
if ( !RoleDefinition::isAdmin() ){
|
||||
$query->innerJoin("user_account_assignment",'account_state.id_account = user_account_assignment.id_account' );
|
||||
$query->andWhere(['user_account_assignment.id_user' => Yii::$app->user->id ]);
|
||||
$query->andWhere(['account.type' => Account::TYPE_ALL ]);
|
||||
|
||||
if ( RoleDefinition::isReception()){
|
||||
$query->andWhere(['transfer.id_user' => Yii::$app->user->id ]);
|
||||
}
|
||||
}
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
@ -76,13 +83,13 @@ class AccountStateSearch extends AccountState
|
||||
$query->orderBy(['created_at' => SORT_DESC]);
|
||||
|
||||
$query->andFilterWhere([
|
||||
'id_user' => $this->id_user,
|
||||
'id_account' => $this->id_account,
|
||||
'type' => $this->type,
|
||||
'account_state.id_user' => $this->id_user,
|
||||
'account_state.id_account' => $this->id_account,
|
||||
'account_state.type' => $this->type,
|
||||
]);
|
||||
|
||||
$query->andFilterWhere([ '>=', 'created_at', $this->timestampStart ] );
|
||||
$query->andFilterWhere([ '<', 'created_at', $this->timestampEnd ] );
|
||||
$query->andFilterWhere([ '>=', 'account_state.created_at', $this->timestampStart ] );
|
||||
$query->andFilterWhere([ '<', 'account_state.created_at', $this->timestampEnd ] );
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ use yii\data\ActiveDataProvider;
|
||||
use common\models\Collection;
|
||||
use common\components\Helper;
|
||||
use common\components\RoleDefinition;
|
||||
use common\models\Account;
|
||||
|
||||
/**
|
||||
* CollectionSearch represents the model behind the search form about `common\models\Collection`.
|
||||
@ -57,10 +58,19 @@ class CollectionSearch extends Collection
|
||||
{
|
||||
$query = Collection::find();
|
||||
|
||||
$query->innerJoinWith('account');
|
||||
|
||||
|
||||
if ( !RoleDefinition::isAdmin() ){
|
||||
$query->innerJoin("user_account_assignment",'collection.id_account = user_account_assignment.id_account' );
|
||||
$query->andWhere(['user_account_assignment.id_user' => Yii::$app->user->id ]);
|
||||
|
||||
$query->andWhere(['account.type' => Account::TYPE_ALL ]);
|
||||
|
||||
if ( RoleDefinition::isReception()){
|
||||
$query->andWhere(['transfer.id_user' => Yii::$app->user->id ]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
-0.0.14
|
||||
- add hidden account
|
||||
- add cart payout/delete per row
|
||||
-
|
||||
-0.0.13
|
||||
- add new profile rocho-net
|
||||
-0.0.12
|
||||
|
||||
@ -3,5 +3,5 @@ return [
|
||||
'adminEmail' => 'rocho02@gmail.com',
|
||||
'supportEmail' => 'rocho02@gmail.com',
|
||||
'user.passwordResetTokenExpire' => 3600,
|
||||
'version' => 'v0.0.13'
|
||||
'version' => 'v0.0.14'
|
||||
];
|
||||
|
||||
@ -69,6 +69,22 @@ class Collection extends \common\models\BaseFitnessActiveRecord
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function getAccount(){
|
||||
return $this->hasOne( Account::className(), ["id_account" =>"id_account" ] ) ;
|
||||
}
|
||||
|
||||
public function getAccountName(){
|
||||
$result = "";
|
||||
$account = $this->account;
|
||||
if (isset($account)){
|
||||
$result = $account->name;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
@ -116,9 +132,18 @@ public static function mkTotalQuery($mode = 'reception', $start,$end,$idUser,$ty
|
||||
|
||||
$query = new Query();
|
||||
|
||||
$query->innerJoin("account",'account.id_account = collection.id_account' );
|
||||
|
||||
if ( !RoleDefinition::isAdmin() ){
|
||||
$query->innerJoin("user_account_assignment",'collection.id_account = user_account_assignment.id_account' );
|
||||
$query->andWhere(['user_account_assignment.id_user' => Yii::$app->user->id ]);
|
||||
|
||||
$query->andWhere(['account.type' => Account::TYPE_ALL ]);
|
||||
|
||||
if ( RoleDefinition::isReception()){
|
||||
$query->andWhere(['transfer.id_user' => Yii::$app->user->id ]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$query->addSelect( [
|
||||
@ -129,7 +154,7 @@ public static function mkTotalQuery($mode = 'reception', $start,$end,$idUser,$ty
|
||||
$query->from('collection');
|
||||
|
||||
$query->andFilterWhere([
|
||||
'id_account' => $idAccount,
|
||||
'collection.id_account' => $idAccount,
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['collection.id_user' => $idUser]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user