diff --git a/app-api/controllers/AuthDeviceController.php b/app-api/controllers/AuthDeviceController.php
index bdee342..6ac3070 100644
--- a/app-api/controllers/AuthDeviceController.php
+++ b/app-api/controllers/AuthDeviceController.php
@@ -73,7 +73,8 @@ class AuthDeviceController extends BaseController
return $e;
}
// 检测是否授权过了的设备
- $deviceModel = DeviceRepository::findOne(['device_id' => $deviceId]);
+ // 这里还得判读删除之后恢复的,状态是未授权
+ $deviceModel = DeviceRepository::findOne(['device_id' => $deviceId, 'is_delete' => 0]);
if ($deviceModel && DeviceStatus::HAS_AUTH == $deviceModel->status) {
$e->mac = $deviceModel->mac;
$e->serial_no = $deviceModel->serial_no;
diff --git a/app-ht/modules/datas/views/device/device-list.php b/app-ht/modules/datas/views/device/device-list.php
index c940889..0f4ba64 100644
--- a/app-ht/modules/datas/views/device/device-list.php
+++ b/app-ht/modules/datas/views/device/device-list.php
@@ -43,7 +43,6 @@ $this->params['breadcrumbs'][] = $this->title;
-
>
厂商:=$gets['manufacture']?>
项目:=$gets['manufacture']?>
型号:=$gets['model']?>
生产日期:=$gets['production']?>
+
>厂商:=$gets['manufacture']?> 项目:=$gets['project']?> 型号:=$gets['model']?> 生产日期:=$gets['production']?>
批次编号:=$gets['batch_no']?>
diff --git a/app-ht/modules/datas/views/device/index.php b/app-ht/modules/datas/views/device/index.php
index a5ea6fd..0c7dfe4 100644
--- a/app-ht/modules/datas/views/device/index.php
+++ b/app-ht/modules/datas/views/device/index.php
@@ -70,8 +70,9 @@ $this->params['breadcrumbs'][] = $this->title;
生产日期 |
生成总数 |
删除数 |
-
授权总数 |
-
授权失败数 |
+
授权总数 |
+
超出总数 |
+
授权失败数 |
未授权数 |
@@ -88,6 +89,7 @@ $this->params['breadcrumbs'][] = $this->title;
= (isset($item["num"]) ? $item["num"] : "0") ?> |
= (isset($item["del_num"]) ? $item["del_num"] : "0") ?> |
= (isset($item["has_auth_num"]) ? $item["has_auth_num"] : "0") ?> |
+
4 |
= (!empty($item["auth_fail_num"]) ? $item["auth_fail_num"] : "0") ?> |
= (!empty($item["no_auth_num"]) ? $item["no_auth_num"] : "0") ?> |
diff --git a/app-ht/modules/device/controllers/DeviceController.php b/app-ht/modules/device/controllers/DeviceController.php
index 43a3ec4..cfcf568 100644
--- a/app-ht/modules/device/controllers/DeviceController.php
+++ b/app-ht/modules/device/controllers/DeviceController.php
@@ -43,6 +43,8 @@ class DeviceController extends BaseController
$startAuthAt = $request->get('start_auth_at');
$endAuthAt = $request->get('end_auth_at');
+ $has_re_auth = $request->get('has_re_auth');
+
$page = $request->get('page');
$where = [
'and',
@@ -81,6 +83,9 @@ class DeviceController extends BaseController
if ($endAuthAt) {
$where[] = ['>=', 'a.auth_at', strtotime($endAuthAt) + 86400];
}
+ if ($has_re_auth) {
+ $where[] = ['=', 'a.has_re_auth', $has_re_auth];
+ }
if (isset($_GET['status']) && -1 != $status) {
$where[] = ['=', 'a.status', $status];
} else {
@@ -112,6 +117,7 @@ class DeviceController extends BaseController
'end_apply_at' => $endApplyAt,
'start_auth_at' => $startAuthAt,
'end_auth_at' => $endAuthAt,
+ 'has_re_auth' => $has_re_auth,
'status' => $status
];
@@ -174,7 +180,7 @@ class DeviceController extends BaseController
$where[] = ['>=', 'a.auth_at', strtotime($startAuthAt)];
}
if ($endAuthAt) {
- $where[] = ['>=', 'a.auth_at', strtotime($endAuthAt) + 86400];
+ $where[] = ['<=', 'a.auth_at', strtotime($endAuthAt) + 86400];
}
if (isset($_GET['status']) && -1 != $status) {
$where[] = ['=', 'a.status', $status];
@@ -637,6 +643,23 @@ class DeviceController extends BaseController
}
}
+ /**
+ * 恢复删除的设备
+ * @return string
+ */
+ public function actionRestoreDevice()
+ {
+ $req = Yii::$app->request;
+ $id = $req->post('id');
+ $e = new stdClass();
+ $e->success = false;
+ $e->message = 'fail';
+ $delDevice = DeviceRepository::findOne(['id' => $id, 'is_delete' => 1]);
+
+
+ return $this->renderJson($e);
+ }
+
public function actionBatchIndex()
{
diff --git a/app-ht/modules/device/views/device/auth-fail-index.php b/app-ht/modules/device/views/device/auth-fail-index.php
index 122dcb4..5f16a53 100644
--- a/app-ht/modules/device/views/device/auth-fail-index.php
+++ b/app-ht/modules/device/views/device/auth-fail-index.php
@@ -42,7 +42,7 @@ $this->params['breadcrumbs'][] = $this->title;
- -
+ -
@@ -59,8 +59,8 @@ $this->params['breadcrumbs'][] = $this->title;