|
|
|
@ -918,6 +918,7 @@ class ArticleController extends AdminController {
|
|
|
|
|
if ($_POST['type'] == 1 ) {
|
|
|
|
|
$_POST['pop_time'] = strtotime($_POST['pop_time']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($id) {
|
|
|
|
|
$pop_rules_model = M('document_pop_rules');//M('$this->$model_name','tab_');
|
|
|
|
|
$res = $pop_rules_model->where(['id'=>$id])->save($_POST);
|
|
|
|
@ -949,5 +950,25 @@ class ArticleController extends AdminController {
|
|
|
|
|
}
|
|
|
|
|
$this->display('pop_rule_edit');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function uploadDoc() {
|
|
|
|
|
$id = $_REQUEST['id'];
|
|
|
|
|
if(@is_uploaded_file($_FILES['file']['tmp_name'])){
|
|
|
|
|
$upfile = $_FILES["file"];
|
|
|
|
|
|
|
|
|
|
$name = $upfile["name"];
|
|
|
|
|
$type = $upfile["type"];
|
|
|
|
|
$size = $upfile["size"];
|
|
|
|
|
$tmp_name = $upfile["tmp_name"];
|
|
|
|
|
$savePath = $_SERVER['DOCUMENT_ROOT'].__ROOT__.'/Uploads/Documents/';
|
|
|
|
|
move_uploaded_file($tmp_name,$savePath.$name);
|
|
|
|
|
$file_name = $savePath.$name;
|
|
|
|
|
$error=$upfile["error"];//上传后系统返回的值
|
|
|
|
|
$data['document_route'] = 'Uploads/Documents/'.$name;
|
|
|
|
|
M('document_pop_rules')->where(['id' => $id])->save($data);
|
|
|
|
|
$backData['tmp'] = $file_name;
|
|
|
|
|
$this->ajaxReturn(json_encode($backData,TRUE));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|