作者 王智

修改

... ... @@ -689,4 +689,41 @@ class Common extends Api
}
}
}
/**
* 公共接口
* @ApiTitle (设备详情)
* @ApiSummary (设备详情)
* @ApiMethod (POST)
* @ApiRoute (/api/Common/BatteryCon)
* @ApiParams (name="battery_code", type="string", required=true, description="电池编号")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturn ({
'code':'1',
'msg':'返回成功',
)
*/
public function BatteryCon()
{
$Code = input('battery_code');
if (empty($Code) || $Code == '' || $Code == "" || $Code == null) {
$this->error('请先链接蓝牙', 0);
die;
}
$map['BatteryCode'] = ['LIKE', '%' . $Code . '%'];
//用户电池分类ID
$Id = Db::name('battery_code')->where($map)->value('id');
if (empty($Id)) {
$this->error('系统没有找到该电池分类', 0);
die;
}
$data = [
'Avatar' => cdnurl($Id['avatar']),
'Title' => $Id['title'],
'Manufactor' => $Id['manufactor']
];
$this->success('成功', $data);
}
}
... ...