getRow(); $device = new DeviceServer(); // $s = request('runningStatus'); // if ($row['runningStatus'] != $s) // $device->switchDevice($row['iot_id'],$s); // $s = request('deliver_lock_switch'); // if ($row['deliver_lock_switch'] != $s) // $device->doorInOperation($row['iot_id'],$s); // $s = request('lock_switch'); // if ($row['lock_switch'] != $s) // $device->doorInOperation($row['iot_id'],$s); return $this->response()->info('操作成功')->refresh(); } public function form() { $row = $this->getRow(); // $s = 1; // if ($row['runningStatus'] == DeviceInfo::DISABLE) // $s = 0; // $this->radio('runningStatus', '锁定设备')->options(['打开','关闭'])->default($s); // $s = 1; // if ($row['deliver_lock_switch'] == 0) // $s = 0; // $this->radio('deliver_lock_switch', '投递门状态')->options(['打开','关闭'])->default($s); // $s = 1; // if ($row['lock_switch'] == 0) // $s = 0; // $this->radio('lock_switch', '收运门状态')->options(['打开','关闭'])->default($s); $this->html("