1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- class DpsbDevice2Action extends CommonAction {
- const tableName = 'dpsb_device2';
- const pkName = 'ID';
-
-
- function set_screen_msg2( ){
- $_GET['id'] = 0;
-
- //根据设备地址获取id信息
- if (IS_POST || $_GET['addr']) {
- if ($_GET['addr']) {
- $addr = $_GET['addr'];
- } else {
- $input = json_decode(file_get_contents("php://input"), true);
- $addr = $input['DeviceAddr'];
- }
- if (!$addr) {
- json_fail('设备地址有误');
- }
- $where = array('DeviceAddr' => $addr);
- $rows = M(self::tableName)->field('id')->where($where)->select();
- if (!$rows || count($rows) != 1) {
- json_fail('设备地址错误');
- }
- $_GET['id'] = $rows[0]['id'];
- }
-
-
- $form = new \Jiaruan\LigerIframeForm();
- $form->before_save = function(&$data){
-
- };
-
- $form->display($this);
- }
-
- }
|