1
This commit is contained in:
@@ -136,12 +136,12 @@ class Major extends Controller {
|
||||
//判断是否有子集
|
||||
$check_child = $this->major_obj->where('pid', $data['major_id'])->where('major_state', 0)->select();
|
||||
if ($check_child) {
|
||||
return jsonError("存在子集不能删除");
|
||||
return jsonError("Subsets exist and cannot be deleted");
|
||||
}
|
||||
//判断是否存在引用
|
||||
$check_journal = $this->major_to_journal_obj->where('major_id', $data['major_id'])->where("mtj_state", 0)->select();
|
||||
if ($check_journal) {
|
||||
return jsonError("期刊存在引用,不能删除");
|
||||
return jsonError("The journal has references and cannot be deleted");
|
||||
}
|
||||
$this->major_obj->where("major_id", $data['major_id'])->update(['major_state' => 1]);
|
||||
return jsonSuccess([]);
|
||||
@@ -215,12 +215,12 @@ class Major extends Controller {
|
||||
$major_info = $this->major_obj->where('major_id', $data['major_id'])->where("major_state", 0)->find();
|
||||
$check_major = $this->major_to_journal_obj->where('major_id', $major_info['pid'])->where('journal_issn', trim($data['journal_issn']))->where('mtj_state', 0)->find();
|
||||
if ($major_info['pid'] != 0 && $check_major == null) {
|
||||
return jsonError("父级必须存在");
|
||||
return jsonError("Parent must exist");
|
||||
}
|
||||
//判断是否重复添加
|
||||
$check = $this->major_to_journal_obj->where('major_id', $data['major_id'])->where('journal_issn', trim($data['journal_issn']))->where('mtj_state', 0)->find();
|
||||
if ($check) {
|
||||
return jsonError("重复添加");
|
||||
return jsonError("Add repeatedly");
|
||||
}
|
||||
|
||||
$has = $this->major_to_journal_obj->where('major_id', $data['major_id'])->where('journal_issn', trim($data['journal_issn']))->where('mtj_state', 1)->find();
|
||||
@@ -385,7 +385,7 @@ class Major extends Controller {
|
||||
->where("t_major.pid", $data['major_id'])
|
||||
->select();
|
||||
if ($check) {
|
||||
return jsonError("存在子集不能删除");
|
||||
return jsonError("Subsets exist and cannot be deleted");
|
||||
}
|
||||
|
||||
$this->major_to_journal_obj->where('major_id', $data['major_id'])->where('journal_issn', $data['journal_issn'])->update(['mtj_state' => 1]);
|
||||
@@ -406,7 +406,7 @@ class Major extends Controller {
|
||||
public function getJournalMajorList() {
|
||||
$data = $this->request->post();
|
||||
if (!isset($data['journal_issn'])) {
|
||||
return jsonError("参数异常");
|
||||
return jsonError("Parameter exception");
|
||||
}
|
||||
// $data['journal_issn'] = '2815-7125';
|
||||
//获取主节点
|
||||
|
||||
Reference in New Issue
Block a user