68 lines
2.5 KiB
PHP
68 lines
2.5 KiB
PHP
|
|
<?php
|
|||
|
|
|
|||
|
|
namespace app\app\controller;
|
|||
|
|
|
|||
|
|
use think\Controller;
|
|||
|
|
use think\Db;
|
|||
|
|
|
|||
|
|
class Skip extends Base{
|
|||
|
|
|
|||
|
|
protected $color = ['#FF5656','#FFAB00','#5AD06D','#6492F6','#3967D6'];
|
|||
|
|
|
|||
|
|
protected $result_end_data_mould = [
|
|||
|
|
'name'=>'',
|
|||
|
|
'value'=>'',
|
|||
|
|
'unit'=>'',
|
|||
|
|
'standard'=>'',
|
|||
|
|
'color'=>'',
|
|||
|
|
'list'=>[]
|
|||
|
|
];
|
|||
|
|
|
|||
|
|
################################################################接口################################################################
|
|||
|
|
################################################################接口################################################################
|
|||
|
|
################################################################接口################################################################
|
|||
|
|
|
|||
|
|
// 查找设备
|
|||
|
|
// $data = ['device_code'=>'asdkljiouoi']
|
|||
|
|
public function device_check($data = ['device_code'=>'asdkljiouoi']){
|
|||
|
|
$data = input();
|
|||
|
|
$result = Db::query("
|
|||
|
|
select
|
|||
|
|
adcd.id,
|
|||
|
|
adcd.state as activation_state,
|
|||
|
|
add.state as device_state,
|
|||
|
|
from app_device_code_data as adcd
|
|||
|
|
left join app_device_data as add on add.id = adcd.add_id
|
|||
|
|
where
|
|||
|
|
adcd.machine_code = '{$data['device_code']}'
|
|||
|
|
");
|
|||
|
|
if(count($result) == 1){
|
|||
|
|
return $this->msg(0,'success',['device_state'=>$result[0]['device_state'],'activation_state'=>$result[0]['activation_state']]);
|
|||
|
|
}else if(count($result) < 1){
|
|||
|
|
return $this->msg(10001,'未找到设备');
|
|||
|
|
}else{
|
|||
|
|
$this->abnormal_data_log_action(0,'device_check-设备查询出错,结果为'.count($result).',合理值应为1或0','app_device_code_data,app_device_data');
|
|||
|
|
return $this->msg(10002,'未找到设备');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
################################################################跳绳数据卡片接口################################################################
|
|||
|
|
################################################################跳绳数据卡片接口################################################################
|
|||
|
|
|
|||
|
|
|
|||
|
|
################################################################other################################################################
|
|||
|
|
################################################################other################################################################
|
|||
|
|
################################################################other################################################################
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|