diff --git a/common/components/Helper.php b/common/components/Helper.php index 72c6148..9160de0 100644 --- a/common/components/Helper.php +++ b/common/components/Helper.php @@ -541,7 +541,7 @@ class Helper { public static function isRestAllowVerifyOnly() { - return \Yii::$app->params ['rest_allow_verify_only'] == true; + return \Yii::$app->params ['rest_allow_verify_only'] && \Yii::$app->params ['rest_allow_verify_only'] == true; } public static function getDoorEntryStrategy(){ diff --git a/door-api.http b/door-api.http index 41fbadf..9a52527 100644 --- a/door-api.http +++ b/door-api.http @@ -30,7 +30,7 @@ Content-Type: application/json Authorization: Basic ZG9vcl9zeXN0ZW06ZG9vcnN5c3RlbTE= { - "cardNumber": "63595944529997.36018993", + "cardNumber": "63f3e0cd399f55.53162649", "direction": "IN", "device": "Q", "validateOnly": false @@ -44,7 +44,7 @@ Content-Type: application/json Authorization: Basic ZG9vcl9zeXN0ZW06ZG9vcnN5c3RlbTE= { - "cardNumber": "63595944529997.36018993", + "cardNumber": "63f3e0cd399f55.53162649", "direction": "OUT", "device": "Q", "validateOnly": false @@ -61,7 +61,7 @@ Authorization: Basic ZG9vcl9zeXN0ZW06ZG9vcnN5c3RlbTE= "cardNumber": "123456", "direction": "IN", "device": "C", - "validateOnly": true + "validateOnly": false } ### diff --git a/frontend/components/FrontendMenuStructure.php b/frontend/components/FrontendMenuStructure.php index 7ca381e..9f55016 100644 --- a/frontend/components/FrontendMenuStructure.php +++ b/frontend/components/FrontendMenuStructure.php @@ -113,6 +113,10 @@ class FrontendMenuStructure // 'items' => $items ]; + $this->menuItems[] = ['label' => 'Kapu', + 'url' => ["/door-manager-log/index"] +// 'items' => $items + ]; } } @@ -141,4 +145,4 @@ class FrontendMenuStructure } -} \ No newline at end of file +} diff --git a/frontend/controllers/DoorManagerLogController.php b/frontend/controllers/DoorManagerLogController.php new file mode 100644 index 0000000..e0ef879 --- /dev/null +++ b/frontend/controllers/DoorManagerLogController.php @@ -0,0 +1,43 @@ +search(Yii::$app->request->queryParams); + + return $this->render('index', [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + ]); + } +} diff --git a/frontend/models/DoorManagerLogSearch.php b/frontend/models/DoorManagerLogSearch.php new file mode 100644 index 0000000..ca41cf8 --- /dev/null +++ b/frontend/models/DoorManagerLogSearch.php @@ -0,0 +1,84 @@ + $query, + 'sort' =>[ + 'defaultOrder' => [ 'created_at' => SORT_DESC ] + ] + ]); + + $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->orFilterWhere([ + 'like', + 'ticket_type_name' , $this->searchTerm, + ]); + + $query->orFilterWhere([ + 'like', + 'customer_name' , $this->searchTerm, + ]); + + $query->orFilterWhere([ + 'like', + 'card_number' , $this->searchTerm, + ]); + + $query->orFilterWhere([ + 'like', + 'key_number' , $this->searchTerm, + ]); + + return $dataProvider; + } +} diff --git a/frontend/views/door-manager-log/_search.php b/frontend/views/door-manager-log/_search.php new file mode 100644 index 0000000..2a1ea32 --- /dev/null +++ b/frontend/views/door-manager-log/_search.php @@ -0,0 +1,33 @@ + + +