Kaynağa Gözat

花掌柜登录时更新或保存 devcieId

shizhongqi 6 ay önce
ebeveyn
işleme
1bc0599aa8
1 değiştirilmiş dosya ile 4 ekleme ve 1 silme
  1. 4 1
      app-hd/controllers/AdminController.php

+ 4 - 1
app-hd/controllers/AdminController.php

@@ -437,14 +437,16 @@ class AdminController extends BaseController
     {
         $get = Yii::$app->request->get();
         $clientId = $get['id'] ?? '';
+        $deviceId = $get['deviceId'];
         $autoLogin = $get['auto'] ?? 0; // 是否自动登录的请求
         if (empty($clientId)) {
             util::success(['returnStatus' => 'FAILURE']);
         }
 
-        $hdDevice = HdDeviceClass::getByCondition(['clientId'=>$clientId], true);
+        $hdDevice = HdDeviceClass::getByCondition(['deviceId'=>$deviceId], true);
         if ($hdDevice == null) {
             $device = [
+                'deviceId' => $deviceId,
                 'clientId' => $clientId,
                 'mainId' => $this->mainId,
                 'shopId' => $this->shopId,
@@ -463,6 +465,7 @@ class AdminController extends BaseController
             } else {
                 $hdDevice->pwdLoginTime = date('Y-m-d H:i:s');
             }
+            $hdDevice->clientId = $clientId;
             $hdDevice->mainId = $this->mainId;
             $hdDevice->shopId = $this->shopId;
             $hdDevice->adminId = $this->adminId;