...
|
...
|
@@ -296,6 +296,63 @@ class AesController extends HomeBaseController{ |
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title 设备保修
|
|
|
* @description 设备保修
|
|
|
* @author 董瑞恩
|
|
|
* @url /portal/Aes/addFault
|
|
|
* @method GET
|
|
|
*
|
|
|
* @param name:users_id type:String require:1 default:无 other: desc:用户id
|
|
|
* @param name:name type:String require:1 default:无 other: desc:设备名称
|
|
|
* @param name:fault_type type:String require:1 default:无 other: desc:错误类型
|
|
|
* @param name:fault_describe type:String require:1 default:无 other: desc:错误描述
|
|
|
* @param name:img type:String require:1 default:无 other: desc:图片地址
|
|
|
*
|
|
|
* @return state:1成功 0失败
|
|
|
* @return message:错误类型
|
|
|
* @return error:错误描述
|
|
|
*/
|
|
|
public function addFault(){
|
|
|
$param=$this->request->param();
|
|
|
$param['create_time']=time();
|
|
|
try{
|
|
|
Db::name('fault')->insert($param);
|
|
|
}catch (\Exception $exception){
|
|
|
$this->apiResponse(301,$exception->getMessage());
|
|
|
}
|
|
|
$this->apiResponse(200,'success');
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title 上传图片
|
|
|
* @description 上传图片
|
|
|
* @author 董瑞恩
|
|
|
* @url /portal/Aes/upload
|
|
|
* @method GET
|
|
|
*
|
|
|
* @param name:file type:file require:1 default:无 other: desc:图片
|
|
|
*
|
|
|
* @return state:1成功 0失败
|
|
|
* @return message:错误类型
|
|
|
* @return error:错误描述
|
|
|
*/
|
|
|
public function upload(){
|
|
|
$file=$this->request->file('file');
|
|
|
if ($file) {
|
|
|
$info = $file->move(ROOT_PATH . 'public' . DS . 'upload' . DS . 'portal');
|
|
|
$fileName = $info->getSaveName();
|
|
|
$path=str_replace('\\','/',$fileName);
|
|
|
$data=array();
|
|
|
$data['filename']=cmf_get_image_preview_url('portal/'.$path);
|
|
|
$data['name']='portal/'.$path;
|
|
|
if ($info) {
|
|
|
$this->apiResponse(200,'success',$data);
|
|
|
} else {
|
|
|
$this->apiResponse(301,'error');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//转成数组
|
|
|
private function ToArray($data){
|
...
|
...
|
|