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