作者 李宇航

合并分支 'lyh-server' 到 'master'

Lyh server



查看合并请求 !2861
... ... @@ -91,18 +91,26 @@ class TicketUploadDataController extends BaseController
]);
//验证当前数据是否已提交
$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($info['status'] == 0){
$this->model->edit($this->param,['id'=>$this->param['id']]);
}else{
$this->response('当前状态不允许编辑', Code::SYSTEM_ERROR);
}
$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);
} else {
$id = $info['id'];
if($this->param['status'] == 0){
$this->model->edit($this->param,['id'=>$id]);
}
}
$data = ['id' => $id];
$this->response('success', Code::SUCCESS, $data);
}
}
/**
* @remark :根据项目获取分类
... ... @@ -126,10 +134,10 @@ class TicketUploadDataController extends BaseController
if ($this->param['type'] == 1) {
//todo::搜索获取分类
$productCateModel = new Category();
$data = $productCateModel->lists(['title' => ['like','%' . $this->param['search'] . '%']], 1, 20,'id',['id','title']);
$data = $productCateModel->lists(['title' => ['like','%' . $this->param['search'] . '%']], 1, 20,'id',['id','title as name']);
} else {
$keywordModel = new Keyword();
$data = $keywordModel->lists(['title' => ['like','%' . $this->param['search'] . '%']], 1, 20,'id',['id','title']);
$data = $keywordModel->lists(['title' => ['like','%' . $this->param['search'] . '%']], 1, 20,'id',['id','title as name']);
}
DB::disconnect('custom_mysql');
$this->response('success', Code::SUCCESS, $data);
... ...