|
@@ -296,6 +296,63 @@ class AesController extends HomeBaseController{ |
|
@@ -296,6 +296,63 @@ class AesController extends HomeBaseController{ |
296
|
}
|
296
|
}
|
297
|
}
|
297
|
}
|
298
|
|
298
|
|
|
|
299
|
+ /**
|
|
|
300
|
+ * @title 设备保修
|
|
|
301
|
+ * @description 设备保修
|
|
|
302
|
+ * @author 董瑞恩
|
|
|
303
|
+ * @url /portal/Aes/addFault
|
|
|
304
|
+ * @method GET
|
|
|
305
|
+ *
|
|
|
306
|
+ * @param name:users_id type:String require:1 default:无 other: desc:用户id
|
|
|
307
|
+ * @param name:name type:String require:1 default:无 other: desc:设备名称
|
|
|
308
|
+ * @param name:fault_type type:String require:1 default:无 other: desc:错误类型
|
|
|
309
|
+ * @param name:fault_describe type:String require:1 default:无 other: desc:错误描述
|
|
|
310
|
+ * @param name:img type:String require:1 default:无 other: desc:图片地址
|
|
|
311
|
+ *
|
|
|
312
|
+ * @return state:1成功 0失败
|
|
|
313
|
+ * @return message:错误类型
|
|
|
314
|
+ * @return error:错误描述
|
|
|
315
|
+ */
|
|
|
316
|
+ public function addFault(){
|
|
|
317
|
+ $param=$this->request->param();
|
|
|
318
|
+ $param['create_time']=time();
|
|
|
319
|
+ try{
|
|
|
320
|
+ Db::name('fault')->insert($param);
|
|
|
321
|
+ }catch (\Exception $exception){
|
|
|
322
|
+ $this->apiResponse(301,$exception->getMessage());
|
|
|
323
|
+ }
|
|
|
324
|
+ $this->apiResponse(200,'success');
|
|
|
325
|
+ }
|
|
|
326
|
+
|
|
|
327
|
+ /**
|
|
|
328
|
+ * @title 上传图片
|
|
|
329
|
+ * @description 上传图片
|
|
|
330
|
+ * @author 董瑞恩
|
|
|
331
|
+ * @url /portal/Aes/upload
|
|
|
332
|
+ * @method GET
|
|
|
333
|
+ *
|
|
|
334
|
+ * @param name:file type:file require:1 default:无 other: desc:图片
|
|
|
335
|
+ *
|
|
|
336
|
+ * @return state:1成功 0失败
|
|
|
337
|
+ * @return message:错误类型
|
|
|
338
|
+ * @return error:错误描述
|
|
|
339
|
+ */
|
|
|
340
|
+ public function upload(){
|
|
|
341
|
+ $file=$this->request->file('file');
|
|
|
342
|
+ if ($file) {
|
|
|
343
|
+ $info = $file->move(ROOT_PATH . 'public' . DS . 'upload' . DS . 'portal');
|
|
|
344
|
+ $fileName = $info->getSaveName();
|
|
|
345
|
+ $path=str_replace('\\','/',$fileName);
|
|
|
346
|
+ $data=array();
|
|
|
347
|
+ $data['filename']=cmf_get_image_preview_url('portal/'.$path);
|
|
|
348
|
+ $data['name']='portal/'.$path;
|
|
|
349
|
+ if ($info) {
|
|
|
350
|
+ $this->apiResponse(200,'success',$data);
|
|
|
351
|
+ } else {
|
|
|
352
|
+ $this->apiResponse(301,'error');
|
|
|
353
|
+ }
|
|
|
354
|
+ }
|
|
|
355
|
+ }
|
299
|
|
356
|
|
300
|
//转成数组
|
357
|
//转成数组
|
301
|
private function ToArray($data){
|
358
|
private function ToArray($data){
|