Pārlūkot izejas kodu

使用 xhGhsDevice 表保存 clientId

shizhongqi 9 mēneši atpakaļ
vecāks
revīzija
52f12b743e

+ 12 - 1
app-ghs/controllers/AdminController.php

@@ -98,12 +98,23 @@ class AdminController extends BaseController
     {
         $get = Yii::$app->request->get();
         $id = $get['id'] ?? '';
-        noticeUtil::push("客户端ID: " . $id);
+        noticeUtil::push("批发客户端ID: " . $id);
         if (empty($id)) {
             util::success(['returnStatus' => 'FAILURE']);
         }
         $this->admin->clientId = $id;
         $this->admin->save();
+
+        $device = [
+            'clientId' => $id,
+            'mainId' => $this->mainId,
+            'shopId' => $this->shopId,
+            'adminId' => $this->adminId,
+            'loginTime' => date('Y-m-d H:i:s'),
+            'status' => 1
+        ];
+        \bizGhs\device\classes\GhsDeviceClass::add($device);
+
         util::complete();
     }
 

+ 9 - 0
biz-ghs/device/classes/GhsDeviceClass.php

@@ -0,0 +1,9 @@
+<?php
+namespace bizGhs\device\classes;
+
+use \bizGhs\base\classes\BaseClass;
+
+class GhsDeviceClass extends BaseClass
+{
+    public static $baseFile = '\bizGhs\device\models\GhsDevice';
+}

+ 12 - 0
biz-ghs/device/models/GhsDevice.php

@@ -0,0 +1,12 @@
+<?php
+namespace bizGhs\device\models;
+
+use bizGhs\base\models\Base;
+
+class GhsDevice extends Base
+{
+    public static function tableName()
+    {
+        return 'xhGhsDevice';
+    }
+}