|
...
|
...
|
@@ -89,16 +89,18 @@ class TicketUploadDataController extends BaseController |
|
|
|
'type.required' => '上传类型不能为空',
|
|
|
|
'text' => '数据详情不为空'
|
|
|
|
]);
|
|
|
|
//验证当前数据是否已提交
|
|
|
|
$this->param['text'] = json_encode($this->param['text'], true);
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
//执行编辑
|
|
|
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
|
|
if($this->param['status'] == 0){
|
|
|
|
$this->model->edit($this->param,['id'=>$id]);
|
|
|
|
}
|
|
|
|
$this->response('success', Code::SUCCESS, $data);
|
|
|
|
if($info['status'] == 0){
|
|
|
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
}else{
|
|
|
|
$this->response('当前状态不允许编辑', Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
//验证当前数据是否已提交
|
|
|
|
$this->param['text'] = json_encode($this->param['text'], true);
|
|
|
|
$this->response('success');
|
|
|
|
}else{
|
|
|
|
$info = $this->model->read(['project_id' => $this->param['project_id'], 'type' => $this->param['type'], 'text' => $this->param['text'], 'status' => 0]);
|
|
|
|
if ($info === false) {
|
|
|
|
$id = $this->model->addReturnId($this->param);
|
|
...
|
...
|
@@ -108,6 +110,7 @@ class TicketUploadDataController extends BaseController |
|
|
|
$data = ['id' => $id];
|
|
|
|
$this->response('success', Code::SUCCESS, $data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :根据项目获取分类
|
...
|
...
|
|