add contraint , that everybody expect admin is limited to 3 days, Add card package
This commit is contained in:
@@ -97,6 +97,8 @@ class TransferSearch extends Transfer
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
echo "start date:" .$this->timestampStart;
|
||||
|
||||
$query->andFilterWhere([
|
||||
'transfer.id_account' => $this->id_account,
|
||||
'transfer.type' => $this->type,
|
||||
@@ -111,6 +113,10 @@ class TransferSearch extends Transfer
|
||||
|
||||
$query->andFilterWhere(['or' , $created_condition , $paid_condition]);
|
||||
|
||||
if (!RoleDefinition::isAdmin()){
|
||||
Helper::restrictIfNotAdminTheStartDate($query, $this->timestampStart,['transfer.created_at','transfer.paid_at'],'date');
|
||||
}
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
@@ -127,8 +133,14 @@ class TransferSearch extends Transfer
|
||||
$accountMap = ArrayHelper::map( $accounts ,'id_account','name' );
|
||||
$idUser = $this->id_user;
|
||||
|
||||
/**mk totals need date time format*/
|
||||
$start = $this->timestampStart;
|
||||
if ( isset($start) && !empty($start)){
|
||||
$start .= " 00:00";
|
||||
}
|
||||
|
||||
$this->totals = Transfer::mkTotals($this->timestampStart, $this->timestampEnd, $idUser, $this->types, $this->id_account, $accounts, $accountMap);
|
||||
|
||||
$this->totals = Transfer::mkTotals($start, $this->timestampEnd, $idUser, $this->types, $this->id_account, $accounts, $accountMap);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user