123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?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'),
- 'video'=>input('video')
- ];
- $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('参数错误');
- }
- }
- }
|