作者 刘锟

合并分支 'akun' 到 'master'

Akun



查看合并请求 !405
... ... @@ -562,18 +562,24 @@ class ProjectUpdate extends Command
$url = $api_url . '?' . http_build_query(['w' => $api_type, 'page' => 1, 'pagesize' => 0]);
$data = curl_c($url);
if (isset($data['code']) && $data['code'] == 200) {
if(isset($data['data']['category']) && $data['data']['category']){
$category = $data['data']['category'];
}else{
$category = [
[
'id' => 0,
'name' => $custom_info['route'],
'url' => '/' . $custom_info['route'],
'parent' => 0
]
];
$children = [];
if ($data['data']['category'] ?? []) {
foreach ($data['data']['category'] as $vc) {
$c_route = $this->get_url_route($vc['url'] ?? '');
if ($c_route != $custom_info['route']) {
$children[] = $vc;
}
}
}
$category = [
[
'id' => 0,
'name' => $custom_info['route'],
'url' => '/' . $custom_info['route'],
'parent' => 0,
'children' => $children
]
];
$this->category_custom_insert($project_id, $custom_info['id'], $category, 0);
$count = $data['data']['count'] ?? 0;
... ...