Przeglądaj źródła

电视盒子的健康数据

lizhen_gitee 8 miesięcy temu
rodzic
commit
36cde57244

+ 18 - 0
application/api/controller/tvuser/Device.php

@@ -12,6 +12,24 @@ class Device extends Api
     protected $noNeedLogin = [];
     protected $noNeedRight = ['*'];
 
+
+    public function index(){
+        $ids = Db::name('user')->where('tv_userid',$this->auth->tv_userid)->column('id');//自动注册的用户 和 app注册并绑定盒子的app用户,理论上只需要第二个
+        $device_number = Db::name('user_device')->where('user_id','IN',$ids)->count('sn');//两个用户绑定的设备号
+
+        $result = [
+            'device_number' => $device_number,
+            'text_1' => config('site.tv_device_index_text1'),
+            'text_2' => config('site.tv_device_index_text2'),
+            'qrcode' => localpath_to_netpath(config('site.tv_device_index_image')),
+            'device' => [
+                ['type_id' => 1,'type' => 'GLUC','name'=>'血糖'],
+                ['type_id' => 2,'type' => 'UA','name'=>'尿酸'],
+                ['type_id' => 3,'type' => 'CHOL','name'=>'总胆固醇'],
+            ],
+        ];
+        $this->success(1,$result);
+    }
     //
     public function lists(){
         $ids = Db::name('user')->where('tv_userid',$this->auth->tv_userid)->column('id');//自动注册的用户 和 app注册并绑定盒子的app用户,理论上只需要第二个

+ 3 - 0
application/extra/site.php

@@ -115,4 +115,7 @@ return array (
   'tv_family_top' => '微信扫码下载APP
 APP电视视频呼叫',
   'tv_firstvideo_videoorder_autofinish_minute' => '3',
+  'tv_device_index_text1' => '微信扫码,可上传血糖数据,大小屏同步',
+  'tv_device_index_text2' => '支持【设备同步】,绑定血糖仪',
+  'tv_device_index_image' => '/uploads/20240606/7538020e10cc8d35c3757b789d38e4e0.png',
 );