|
@@ -50,7 +50,7 @@ class Project5CateController extends BaseController |
|
@@ -50,7 +50,7 @@ class Project5CateController extends BaseController |
|
50
|
if(empty($action)){
|
50
|
if(empty($action)){
|
|
51
|
$this->response('未知请求',Code::SYSTEM_ERROR);
|
51
|
$this->response('未知请求',Code::SYSTEM_ERROR);
|
|
52
|
}
|
52
|
}
|
|
53
|
- $url = $projectInfo['website'].'wp-admin/admin-ajax.php?action=get_products_category';
|
53
|
+ $url = $projectInfo['website'].'wp-admin/admin-ajax.php?action='.$action;
|
|
54
|
$data = http_get($url);
|
54
|
$data = http_get($url);
|
|
55
|
if($data && $data['status'] == 200){
|
55
|
if($data && $data['status'] == 200){
|
|
56
|
$resultData = $data['data'];
|
56
|
$resultData = $data['data'];
|
|
@@ -66,4 +66,43 @@ class Project5CateController extends BaseController |
|
@@ -66,4 +66,43 @@ class Project5CateController extends BaseController |
|
66
|
$this->response('success',Code::SUCCESS,$url);
|
66
|
$this->response('success',Code::SUCCESS,$url);
|
|
67
|
}
|
67
|
}
|
|
68
|
|
68
|
|
|
|
|
69
|
+ /**
|
|
|
|
70
|
+ * @remark :新增分类
|
|
|
|
71
|
+ * @name :addProject5Cate
|
|
|
|
72
|
+ * @author :lyh
|
|
|
|
73
|
+ * @method :post
|
|
|
|
74
|
+ * @time :2025/11/8 10:25
|
|
|
|
75
|
+ */
|
|
|
|
76
|
+ public function addProject5Cate()
|
|
|
|
77
|
+ {
|
|
|
|
78
|
+ $this->request->validate([
|
|
|
|
79
|
+ 'post_id'=>'required',
|
|
|
|
80
|
+ 'type'=>'required',
|
|
|
|
81
|
+ 'name'=>'required',
|
|
|
|
82
|
+ 'parent'=>'required',
|
|
|
|
83
|
+ ],[
|
|
|
|
84
|
+ 'post_id.required' => 'post_id不能为空',
|
|
|
|
85
|
+ 'type.required' => '类型不能为空',
|
|
|
|
86
|
+ 'name.required' => '名称不能为空',
|
|
|
|
87
|
+ 'parent.required' => '上级ID不能为空',
|
|
|
|
88
|
+ ]);
|
|
|
|
89
|
+ //获取域名
|
|
|
|
90
|
+ $ticketProjectMdoel = new TicketProject();
|
|
|
|
91
|
+ $projectInfo = $ticketProjectMdoel->read(['post_id' => $this->param['post_id']]);
|
|
|
|
92
|
+ if($projectInfo === false){
|
|
|
|
93
|
+ $this->response('当前项目不存在或数据未同步',Code::SYSTEM_ERROR);
|
|
|
|
94
|
+ }
|
|
|
|
95
|
+ $project5CateModel = new Project5Cate();
|
|
|
|
96
|
+ $projectInfo['website'] = 'https://devmark.globalso.com/';
|
|
|
|
97
|
+ $action = $project5CateModel->saveCateTypeAction($this->param['type']);
|
|
|
|
98
|
+ $url = $projectInfo['website'].'wp-admin/admin-ajax.php?action='.$action;
|
|
|
|
99
|
+ if(empty($action)){
|
|
|
|
100
|
+ $this->response('未知请求',Code::SYSTEM_ERROR);
|
|
|
|
101
|
+ }
|
|
|
|
102
|
+ $data = http_post($url,json_encode(['name'=>$this->param['name'],'parent'=>$this->param['parent']],true));
|
|
|
|
103
|
+ if($data && $data['status'] == 200){
|
|
|
|
104
|
+ $this->response('success', );
|
|
|
|
105
|
+ }
|
|
|
|
106
|
+ $this->response('请求失败',Code::SYSTEM_ERROR);
|
|
|
|
107
|
+ }
|
|
69
|
} |
108
|
} |