Swdz-WangHaiJun 4 лет назад
Родитель
Сommit
43cecba7b1

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

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

+ 3 - 0
app/Model/DeviceInfo.php

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

+ 3 - 0
public/testweb/testdevice.html

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

+ 1 - 0
public/testweb/upgrade.html

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