|
@@ -35,30 +35,23 @@ class NavLogic extends BaseLogic |
|
@@ -35,30 +35,23 @@ class NavLogic extends BaseLogic |
|
35
|
*/
|
35
|
*/
|
|
36
|
public function navSave()
|
36
|
public function navSave()
|
|
37
|
{
|
37
|
{
|
|
38
|
-// DB::beginTransaction();
|
|
|
|
39
|
-// try {
|
|
|
|
40
|
- if(!empty($this->param['location'])){
|
|
|
|
41
|
- if($this->param['location'] == 'header'){
|
|
|
|
42
|
- $this->param['group_id'] = BNavGroup::DEFAULT_HEADER_ID;
|
|
|
|
43
|
- }
|
|
|
|
44
|
- if($this->param['location'] == 'footer'){
|
|
|
|
45
|
- $this->param['group_id'] = BNavGroup::DEFAULT_FOOTER_ID;
|
|
|
|
46
|
- }
|
38
|
+ if(!empty($this->param['location'])){
|
|
|
|
39
|
+ if($this->param['location'] == 'header'){
|
|
|
|
40
|
+ $this->param['group_id'] = BNavGroup::DEFAULT_HEADER_ID;
|
|
47
|
}
|
41
|
}
|
|
48
|
- $this->param['image'] = str_replace_url(isset($this->param['image']) ? $this->param['image'] : '');
|
|
|
|
49
|
- $this->param['remark_image'] = str_replace_url(isset($this->param['remark_image']) ? $this->param['remark_image'] : '');
|
|
|
|
50
|
- if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
51
|
- $this->handleEditParam();//验证是否可编辑分类
|
|
|
|
52
|
- $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
53
|
- }else{
|
|
|
|
54
|
- $this->param['project_id'] = $this->user['project_id'];
|
|
|
|
55
|
- $this->model->add($this->param);
|
42
|
+ if($this->param['location'] == 'footer'){
|
|
|
|
43
|
+ $this->param['group_id'] = BNavGroup::DEFAULT_FOOTER_ID;
|
|
56
|
}
|
44
|
}
|
|
57
|
-// DB::commit();
|
|
|
|
58
|
-// }catch (\Exception $e){
|
|
|
|
59
|
-// DB::rollBack();
|
|
|
|
60
|
-// $this->fail('error');
|
|
|
|
61
|
-// }
|
45
|
+ }
|
|
|
|
46
|
+ $this->param['image'] = str_replace_url(isset($this->param['image']) ? $this->param['image'] : '');
|
|
|
|
47
|
+ $this->param['remark_image'] = str_replace_url(isset($this->param['remark_image']) ? $this->param['remark_image'] : '');
|
|
|
|
48
|
+ if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
49
|
+ $this->handleEditParam();//验证是否可编辑分类
|
|
|
|
50
|
+ $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
51
|
+ }else{
|
|
|
|
52
|
+ $this->param['project_id'] = $this->user['project_id'];
|
|
|
|
53
|
+ $this->model->add($this->param);
|
|
|
|
54
|
+ }
|
|
62
|
//编辑菜单后,通知更新
|
55
|
//编辑菜单后,通知更新
|
|
63
|
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NAV, 'route'=>'all']);
|
56
|
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NAV, 'route'=>'all']);
|
|
64
|
return $this->success();
|
57
|
return $this->success();
|