|
@@ -16,9 +16,28 @@ class AttrLogic extends BaseLogic |
|
@@ -16,9 +16,28 @@ class AttrLogic extends BaseLogic |
|
16
|
public function __construct()
|
16
|
public function __construct()
|
|
17
|
{
|
17
|
{
|
|
18
|
parent::__construct();
|
18
|
parent::__construct();
|
|
19
|
-
|
19
|
+ $this->param = $this->requestAll;
|
|
20
|
$this->model = new Attr();
|
20
|
$this->model = new Attr();
|
|
21
|
}
|
21
|
}
|
|
22
|
|
22
|
|
|
23
|
-
|
23
|
+ /**
|
|
|
|
24
|
+ * @remark :保存attr
|
|
|
|
25
|
+ * @name :attrSave
|
|
|
|
26
|
+ * @author :lyh
|
|
|
|
27
|
+ * @method :post
|
|
|
|
28
|
+ * @time :2023/8/22 11:57
|
|
|
|
29
|
+ */
|
|
|
|
30
|
+ public function attrSave(){
|
|
|
|
31
|
+ $this->param['attr'] = json_encode($this->param['attr']);
|
|
|
|
32
|
+ if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
33
|
+ $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
34
|
+ }else{
|
|
|
|
35
|
+ $this->param['project_id'] = $this->user['project_id'];
|
|
|
|
36
|
+ $rs = $this->model->add($this->param);
|
|
|
|
37
|
+ }
|
|
|
|
38
|
+ if($rs === false){
|
|
|
|
39
|
+ $this->fail('error');
|
|
|
|
40
|
+ }
|
|
|
|
41
|
+ return $this->success();
|
|
|
|
42
|
+ }
|
|
24
|
} |
43
|
} |