add transfer#list pdf download, fix helper#fixascii function
This commit is contained in:
@@ -12,17 +12,23 @@ use common\models\Account;
|
||||
class TransferListSearch extends \common\models\TransferListSearch
|
||||
{
|
||||
|
||||
public function init(){
|
||||
parent::init();
|
||||
$this->mode = 'admin';
|
||||
}
|
||||
|
||||
|
||||
protected function addAccountConstraint($query){
|
||||
if ( !RoleDefinition::isAdmin() ){
|
||||
$query->innerJoin("user_account_assignment",'transfer.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::isAdmin() ){
|
||||
// $query->innerJoin("user_account_assignment",'transfer.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 ]);
|
||||
}
|
||||
// if ( RoleDefinition::isReception()){
|
||||
// $query->andWhere(['transfer.id_user' => Yii::$app->user->id ]);
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
43
backend/models/TransferListUserGroupedSearch.php
Normal file
43
backend/models/TransferListUserGroupedSearch.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace backend\models;
|
||||
|
||||
use Yii;
|
||||
use common\models\Transfer;
|
||||
use common\components\RoleDefinition;
|
||||
use common\models\Account;
|
||||
use common\components\DailyListing;
|
||||
/**
|
||||
* TransferSearch represents the model behind the search form about `common\models\Transfer`.
|
||||
*/
|
||||
class TransferListUserGroupedSearch extends \common\models\TransferListSearch
|
||||
{
|
||||
|
||||
public $ticketMoneyByUser;
|
||||
|
||||
public function init(){
|
||||
parent::init();
|
||||
$this->mode = 'admin';
|
||||
}
|
||||
|
||||
|
||||
public function search($params)
|
||||
{
|
||||
|
||||
$this->load($params);
|
||||
|
||||
if (!$this->validate()) {
|
||||
}
|
||||
|
||||
$listing = new DailyListing();
|
||||
$listing->mode = $this->mode;
|
||||
$listing->loadFilters($this);
|
||||
|
||||
$this->ticketMoneyByUser = $listing->readTicketMoneyByUser();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user