1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- use think\App;
- class DeviceRecord extends Base
- {
- public function __construct(App $app = null) {
- parent::__construct($app);
- $this->model = new \app\common\model\DeviceRecord();
- }
- public function add(){
- $json = [
- 'images'=>input('images'),
- 'content'=>input('content'),
- 'deviceId'=>input('deviceId'),
- 'userId'=>$this->userId,
- 'orgId'=>$this->orgId,
- 'checkJson'=>input('checkJson'),
- 'taskId'=>input('taskId'),
- ];
- $ret = $this->model->add($json);
- if($ret){
- HelpHander::success($ret,'添加成功');
- }else{
- HelpHander::error($this->model->getError());
- }
- }
- public function queryRecordList(){
- $page = input('page',1);
- $size = input('size',10);
- $deviceId = input('deviceId/d',0);
- $type = input('type/d',0);
- $model = $this->model;
- $ret = $model->lists($page,$size,$deviceId,$this->userId,$this->orgId,$type);
- HelpHander::success($ret);
- }
- public function queryRecordDetails(){
- $id = input('deviceRecordId/d',0);
- $model = $this->model;
- $ret = $model->details($id);
- if($ret){
- HelpHander::success($ret);
- }else{
- HelpHander::error('参数错误');
- }
- }
- }
|