浏览代码

升级页面手机可修改

Swdz-WangHaiJun 4 年之前
父节点
当前提交
43cecba7b1
共有 4 个文件被更改,包括 12 次插入3 次删除
  1. 5 3
      app/Http/Controllers/IndexController.php
  2. 3 0
      app/Model/DeviceInfo.php
  3. 3 0
      public/testweb/testdevice.html
  4. 1 0
      public/testweb/upgrade.html

+ 5 - 3
app/Http/Controllers/IndexController.php

@@ -196,7 +196,6 @@ class IndexController extends Controller
             return genApiData(601,'设别号必须');
             return genApiData(601,'设别号必须');
         }
         }
         $device_info = DeviceInfo::where(['device_name'=>$id])->first();
         $device_info = DeviceInfo::where(['device_name'=>$id])->first();
-
         if(empty($device_info)){
         if(empty($device_info)){
             return genApiData('601','无效设备');
             return genApiData('601','无效设备');
         }
         }
@@ -213,9 +212,12 @@ class IndexController extends Controller
         $data['id'] = $id;
         $data['id'] = $id;
         $data['status'] = $sta_arr[$res];
         $data['status'] = $sta_arr[$res];
         $data['version'] = $property['data']['version'];
         $data['version'] = $property['data']['version'];
-        $data['device_type'] = $device_info['device_type'];
-        $data['phone'] = $device_info['phone'];
+        $data['device_type'] = $device_info->device_type;
         $data['is_last'] = 1;
         $data['is_last'] = 1;
+        $data['phone'] = $device_info->phone;
+        if($data['phone'] == '1516516161616'){
+            $data['phone'] = null;
+        }
         if($property['data']['version'] !== $last_version){
         if($property['data']['version'] !== $last_version){
             $data['is_last'] = 0;
             $data['is_last'] = 0;
         }
         }

+ 3 - 0
app/Model/DeviceInfo.php

@@ -11,13 +11,16 @@ class DeviceInfo extends Model
 {
 {
     use SoftDeletes;
     use SoftDeletes;
     //public $dispatcher;
     //public $dispatcher;
+    public $timestamps = false;
 
 
     const ONLINE = 0, OFFLINE = 1, DISABLE = 2, UNACTIVE = 3;  //在营 离线 禁用 未激活  运行状态 (status)
     const ONLINE = 0, OFFLINE = 1, DISABLE = 2, UNACTIVE = 3;  //在营 离线 禁用 未激活  运行状态 (status)
     const BOXFOUR = 1, BOXFIVE = 2, BOXFOURRECYCLE = 3, BOXFIVERECYCLE = 4;//四箱 五箱
     const BOXFOUR = 1, BOXFIVE = 2, BOXFOURRECYCLE = 3, BOXFIVERECYCLE = 4;//四箱 五箱
     const OK = 0, ERROR = 1; // 正常 故障 设备状态 (runningStatus)
     const OK = 0, ERROR = 1; // 正常 故障 设备状态 (runningStatus)
     const LOCK = 1, UNLOCK = 0;
     const LOCK = 1, UNLOCK = 0;
+//    protected $connection = 'lock';
     protected $table = "device_info";
     protected $table = "device_info";
     protected $guarded = [];
     protected $guarded = [];
+
     /*
     /*
      *运行状态
      *运行状态
      */
      */

+ 3 - 0
public/testweb/testdevice.html

@@ -214,6 +214,9 @@
                 <div class="bianhao" style="padding-top: 0;">
                 <div class="bianhao" style="padding-top: 0;">
                     <span>在线情况:{{isstatus}}</span>
                     <span>在线情况:{{isstatus}}</span>
                 </div>
                 </div>
+                <div class="bianhao" style="padding-top: 0;">
+                    <span>&nbsp&nbsp&nbsp手机号:{{phone}}</span>
+                </div>
                 <div class="bianhao" style="padding-top: 0;">
                 <div class="bianhao" style="padding-top: 0;">
                     &nbsp&nbsp&nbsp<span>版本号:{{arrdata.version}}</span>
                     &nbsp&nbsp&nbsp<span>版本号:{{arrdata.version}}</span>
                 </div>
                 </div>

+ 1 - 0
public/testweb/upgrade.html

@@ -263,6 +263,7 @@
                                     this.isshezhi = true
                                     this.isshezhi = true
                                     this.equipment = res.data.data.id
                                     this.equipment = res.data.data.id
                                     this.isxian = res.data.data.status
                                     this.isxian = res.data.data.status
+                                    this.phone = res.data.data.phone
                                     this.versionNum = res.data.data.version
                                     this.versionNum = res.data.data.version
                                     this.isnew = res.data.data.is_last
                                     this.isnew = res.data.data.is_last
                                     this.typevalue = res.data.data.device_type
                                     this.typevalue = res.data.data.device_type