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;
-
- @@ -62,7 +61,7 @@ $this->params['breadcrumbs'][] = $this->title;
-
>厂商: 项目: 型号: 生产日期: +
>厂商: 项目: 型号: 生产日期: 批次编号:
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; + 4 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; - - + + @@ -102,7 +102,7 @@ $this->params['breadcrumbs'][] = $this->title; @@ -115,6 +115,9 @@ $this->params['breadcrumbs'][] = $this->title;
IDID 厂商 项目 设备型号  |  - +
+
+ +
+ + - + @@ -105,6 +106,7 @@ $this->params['breadcrumbs'][] = $this->title; + @@ -139,7 +141,8 @@ $this->params['breadcrumbs'][] = $this->title; @@ -152,6 +155,9 @@ $this->params['breadcrumbs'][] = $this->title;
ID ID 序列号 厂商 项目设备型号设备型号 生产日期 MAC地址 设备ID
- +  |  +
+
+ +
- -
@@ -63,10 +56,26 @@ $this->params['breadcrumbs'][] = $this->title;
+
+
+ +
+ - +
-
+
-
+ + + +
+ +
@@ -82,12 +91,13 @@ $this->params['breadcrumbs'][] = $this->title;
  • 全部序列号
  • 删除序列号
  • -
    + + - + @@ -105,6 +115,7 @@ $this->params['breadcrumbs'][] = $this->title; + @@ -139,9 +150,12 @@ $this->params['breadcrumbs'][] = $this->title; @@ -154,8 +168,12 @@ $this->params['breadcrumbs'][] = $this->title;
    ID序列号序列号 厂商 项目 设备型号
    -  |  -  |  - + +  |  + +  |  + +
    +
    + +
    +