|
@@ -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用户,理论上只需要第二个
|