提交 a70acf5f authored 作者: wangkr's avatar wangkr

update

上级 11af9747
config/config.php merge=ours
webmain/model/loginModel.php merge=ours
webmain/webmainConfig.php merge=ours
.idea/ merge=ours
images/OA二维码.png merge=ours
/upload/*
/config/config.php
/webmain/webmainConfig.php
/.idea/
/images/OA二维码.png
......@@ -34,3 +34,6 @@
客户编号:CUST24053保存接口成功 执行时间:4.3511328697205 s
客户编号:CUST24053提交接口成功 执行时间:0.45927286148071 s
客户编号:CUST24053审核接口成功 执行时间:0.14415597915649 s
客户名称:北京闪思科技有限公司保存接口失败 客户编号:CUST24055保存接口成功 执行时间:3.2373831272125 s
客户编号:CUST24055提交接口成功 执行时间:1.2542500495911 s
客户编号:CUST24055审核接口成功 执行时间:0.16617202758789 s
......@@ -137,3 +137,6 @@
供应商名称:中铁六局集团电务工程有限公司保存接口失败 供应商编号:VEN05006保存接口成功 执行时间:1.6346430778503 s
供应商编号:VEN05006提交接口成功 执行时间:1.1099901199341 s
供应商编号:VEN05006审核接口成功 执行时间:0.17360591888428 s
供应商名称:北京众唐家园物业管理有限公司保存接口失败 供应商编号:VEN05007保存接口成功 执行时间:3.5164778232574 s
供应商编号:VEN05007提交接口成功 执行时间:1.2535090446472 s
供应商编号:VEN05007审核接口成功 执行时间:0.16562795639038 s
差异被折叠。
<?php
class uploadClassAction extends Action{
/**
* 上传文件页面
*/
public function defaultAction()
{
$callback = $this->get('callback');
$callbacka = explode('|', $callback);
$params['callback'] = $callbacka[0];
$params['changeback'] = arrvalue($callbacka,1);
$params['maxup'] = $this->get('maxup','0');
$params['thumbnail'] = $this->get('thumbnail');
$params['maxwidth'] = $this->get('maxwidth','0');
$params['showid'] = $this->get('showid');
$params['upkey'] = $this->get('upkey');
$params['uptype'] = $this->get('uptype','*');
$params['thumbtype'] = $this->get('thumbtype','0');
$params['maxsize'] = (int)$this->get('maxsize', c('upfile')->getmaxzhao());
$urlparams = '{}';
$urlcan = $this->get('urlparams');//格式:a=b,c=d
if(!isempt($urlcan)){
$cans1 = explode(',', $urlcan);
$urlparams = array();
foreach($cans1 as $cans2){
$cans3 = explode(':', $cans2);
$urlparams[$cans3[0]]=$cans3[1];
}
$urlparams = json_encode($urlparams);
}
$params['urlparams'] = $urlparams;
$this->title = $this->get('title','文件上传');
$this->assign('params', $params);
$this->assign('callback', $params['callback']);
}
public function upfileAjax()
{
if(!$_FILES)exit('sorry!');
$upimg = c('upfile');
$maxsize= (int)$this->get('maxsize', 5);
$uptype = $this->get('uptype', '*');
$thumbnail = $this->get('thumbnail');
$upimg->initupfile($uptype, ''.UPDIR.'|'.date('Y-m').'', $maxsize);
$upses = $upimg->up('file');
$arr = c('down')->uploadback($upses, $thumbnail, false);
$this->returnjson($arr);
}
/**
* 获取文件
*/
public function getfileAjax()
{
$mtype = $this->request('mtype');
$mid = (int)$this->request('mid');
$rows = m('file')->getfiles($mtype, $mid);
echo json_encode($rows);
}
/**
* 删除文件
*/
public function delfileAjax()
{
$id = (int)$this->request('id','0');
m('file')->delfile($id);
}
public function showAction()
{
$id = (int)$this->get('id','0');
$this->display = false;
m('file')->show($id);
}
/**
* 编辑器上传文件
*/
public function upimgAction()
{
$this->display = false;
$upfile = c('upfile');
$upfile->initupfile('jpg|png|gif|jpeg',''.UPDIR.'|'.date('Y-m').'', 5);
$upses = $upfile->up('imgFile');
if(is_array($upses)){
$url = $upses['allfilename'];
$url = str_replace('../' , '', $url);
$arr = array('error' => 0, 'url' => $url);
}else{
$arr = array('error' => 1, 'message' => $upses);
}
$this->returnjson($arr);
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论