add reception customer search, fix reception ticket types, fix card number routing, timezone changes
This commit is contained in:
@@ -24,8 +24,9 @@ return [
|
||||
'datetimeFormat' => 'yyyy.MM.dd HH:mm',
|
||||
'timeFormat' => 'HH:mm',
|
||||
'locale' => 'hu-Hu',
|
||||
'timeZone' => 'Europe/Budapest',
|
||||
'defaultTimeZone' => 'UTC',
|
||||
// 'timeZone' => 'Europe/Budapest',
|
||||
'timeZone' => 'UTC',
|
||||
// 'defaultTimeZone' => 'UTC',
|
||||
'nullDisplay' => "-",
|
||||
],
|
||||
'authManager' => [
|
||||
|
||||
@@ -3,7 +3,7 @@ return [
|
||||
'adminEmail' => 'rocho02@gmail.com',
|
||||
'supportEmail' => 'rocho02@gmail.com',
|
||||
'user.passwordResetTokenExpire' => 3600,
|
||||
'version' => 'v0.0.17',
|
||||
'version' => 'v0.0.18',
|
||||
'company' => 'movar',//gyor
|
||||
'company_name' => "Freimann Kft.",
|
||||
'product_visiblity' => 'account',// on reception which products to display. account or global
|
||||
|
||||
88
common/models/CardSearch.php
Normal file
88
common/models/CardSearch.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\Card;
|
||||
use yii\db\Query;
|
||||
use yii\helpers\ArrayHelper;
|
||||
|
||||
/**
|
||||
* CardSearch represents the model behind the search form about `common\models\Card`.
|
||||
*/
|
||||
class CardSearch extends Card
|
||||
{
|
||||
|
||||
public $customerName;
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
['customerName','string','max' =>200],
|
||||
['number','string','max' =>200]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function scenarios()
|
||||
{
|
||||
// bypass scenarios() implementation in the parent class
|
||||
return Model::scenarios();
|
||||
}
|
||||
|
||||
public function attributeLabels(){
|
||||
return ArrayHelper::merge(parent::attributeLabels(),
|
||||
[
|
||||
'card_number' => 'Kártya szám',
|
||||
'customerName' => 'Vendég'
|
||||
]
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates data provider instance with search query applied
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return ActiveDataProvider
|
||||
*/
|
||||
public function search($params)
|
||||
{
|
||||
|
||||
$query = new Query();
|
||||
$query->select(['card.number as card_number' , 'customer.name as customer_name', 'customer.email as customer_email','customer.phone as customer_phone']);
|
||||
$query->from('card');
|
||||
$query->innerJoin('customer','card.id_card = customer.id_customer_card');
|
||||
$query->orderBy(['customer.name' => SORT_ASC]);
|
||||
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
]);
|
||||
|
||||
|
||||
|
||||
$this->load($params);
|
||||
|
||||
if (!$this->validate()) {
|
||||
// uncomment the following line if you do not want to return any records when validation fails
|
||||
// $query->where('0=1');
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
$query->andFilterWhere([
|
||||
// 'lower(customer.name)' => $this->customerName
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['like', 'customer.name', $this->customerName]);
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,7 @@ class Transfer extends \common\models\BaseFitnessActiveRecord
|
||||
return ArrayHelper::merge( [
|
||||
[
|
||||
'class' => TimestampBehavior::className(),
|
||||
'value' => function(){ return date('Y-m-d H:i:s' ); }
|
||||
'value' => function(){ return date('Y-m-d H:i:s' ,\Yii::$app->formatter->asTimestamp(date('Y-d-m h:i:s')) ); }
|
||||
],
|
||||
[
|
||||
'class' => DiscountAwareBehavior::className(),
|
||||
|
||||
Reference in New Issue
Block a user