parent
f35d165e53
commit
03f0df3a59
|
@ -4,6 +4,7 @@ return [
|
||||||
'Id' => 'ID',
|
'Id' => 'ID',
|
||||||
'Sn' => '设备序列号',
|
'Sn' => '设备序列号',
|
||||||
'Name' => '设备名称',
|
'Name' => '设备名称',
|
||||||
|
'Dev_type' => '设备类型',
|
||||||
'Lock' => '锁定',
|
'Lock' => '锁定',
|
||||||
'V' => '固件版本',
|
'V' => '固件版本',
|
||||||
'Localid' => 'localid',
|
'Localid' => 'localid',
|
||||||
|
|
|
@ -4,6 +4,7 @@ return [
|
||||||
'Id' => 'ID',
|
'Id' => 'ID',
|
||||||
'Sn' => '设备序列号',
|
'Sn' => '设备序列号',
|
||||||
'Name' => '设备名称',
|
'Name' => '设备名称',
|
||||||
|
'Dev_type' => '设备类型',
|
||||||
'Lock' => '锁定',
|
'Lock' => '锁定',
|
||||||
'V' => '固件版本',
|
'V' => '固件版本',
|
||||||
'Localid' => 'localid',
|
'Localid' => 'localid',
|
||||||
|
|
|
@ -17,24 +17,38 @@ class Info extends Api
|
||||||
{
|
{
|
||||||
//日志收集
|
//日志收集
|
||||||
$body = file_get_contents('php://input');
|
$body = file_get_contents('php://input');
|
||||||
|
|
||||||
if(!empty($body)){
|
if(!empty($body)){
|
||||||
$body = json_decode($body, true);
|
$body = json_decode($body, true);
|
||||||
|
if(empty($body['sn'])){
|
||||||
|
$this->error('error', '');
|
||||||
|
}
|
||||||
$post = [
|
$post = [
|
||||||
"mac" => $body['mac'] ?? "",
|
"mac" => $body['mac'] ?? "",
|
||||||
"localid" => $body['localid'] ?? "",
|
"localid" => $body['localid'] ?? "",
|
||||||
"name" => $body['name'] ?? "",
|
"name" => $body['name'] ?? "",
|
||||||
"v" => $body['v'] ?? "",
|
"dev_type" => $body['dev_type'] ?? "",
|
||||||
|
"v" => $body['fw'] ?? "",
|
||||||
"ip" => $this->request->ip(),
|
"ip" => $this->request->ip(),
|
||||||
"sn" => $body['sn'] ?? "",
|
"sn" => $body['sn'] ?? "",
|
||||||
"lock" => intval($body['lock']),
|
"lock" => intval($body['lock']),
|
||||||
"createtime" => time(),
|
"createtime" => time()
|
||||||
];
|
];
|
||||||
|
|
||||||
$black_log = new \app\admin\model\Blacklog();
|
$black_log = new \app\admin\model\Blacklog();
|
||||||
$black_log->save($post);
|
$black_log->save($post);
|
||||||
$black_only_log = new \app\admin\model\Blackollog();
|
$black_only_log = new \app\admin\model\Blackollog();
|
||||||
try {
|
if($post['lock'] == 0){
|
||||||
$black_only_log->save($post);
|
//解除锁定,列表中删除
|
||||||
} catch (\Exception $e) {}
|
$black_only_log->where('sn', '=', $post['sn'])->delete();
|
||||||
|
}else{
|
||||||
|
//写入列表
|
||||||
|
try {
|
||||||
|
$post['updateTime'] = time();
|
||||||
|
$black_only_log->save($post);
|
||||||
|
} catch (\Exception $e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
$this->success('success', '');
|
$this->success('success', '');
|
||||||
|
|
|
@ -29,6 +29,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
{field: 'sn', title: __('Sn'), operate: 'LIKE'},
|
{field: 'sn', title: __('Sn'), operate: 'LIKE'},
|
||||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||||
{field: 'lock', title: __('Lock'), operate: 'LIKE', formatter: Controller.api.formatter.lock},
|
{field: 'lock', title: __('Lock'), operate: 'LIKE', formatter: Controller.api.formatter.lock},
|
||||||
|
{field: 'dev_type', title: __('Dev_type'), operate: 'LIKE'},
|
||||||
{field: 'v', title: __('V'), operate: 'LIKE'},
|
{field: 'v', title: __('V'), operate: 'LIKE'},
|
||||||
{field: 'localid', title: __('Localid'), operate: 'LIKE'},
|
{field: 'localid', title: __('Localid'), operate: 'LIKE'},
|
||||||
{field: 'mac', title: __('Mac'), operate: 'LIKE'},
|
{field: 'mac', title: __('Mac'), operate: 'LIKE'},
|
||||||
|
|
|
@ -31,6 +31,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
{field: 'sn', title: __('Sn'), operate: 'LIKE'},
|
{field: 'sn', title: __('Sn'), operate: 'LIKE'},
|
||||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||||
{field: 'lock', title: __('Lock'), operate: 'LIKE', formatter: Controller.api.formatter.lock},
|
{field: 'lock', title: __('Lock'), operate: 'LIKE', formatter: Controller.api.formatter.lock},
|
||||||
|
{field: 'dev_type', title: __('Dev_type'), operate: 'LIKE'},
|
||||||
{field: 'v', title: __('V'), operate: 'LIKE'},
|
{field: 'v', title: __('V'), operate: 'LIKE'},
|
||||||
{field: 'localid', title: __('Localid'), operate: 'LIKE'},
|
{field: 'localid', title: __('Localid'), operate: 'LIKE'},
|
||||||
{field: 'mac', title: __('Mac'), operate: 'LIKE'},
|
{field: 'mac', title: __('Mac'), operate: 'LIKE'},
|
||||||
|
|
Loading…
Reference in New Issue