联系官方销售客服

1835022288

028-61286886

应用插件 版主:官方插件技术组
请问下获取投稿页面的栏目回调定义怎么写呀
类型:迅睿CMS 更新时间:2020-11-30 16:53:33

请问下获取投稿页面的栏目回调定义怎么写呀!我这个写法获取不到

 "category": {
                "1": {
                    "id": "1",
                    "pid": "0",
                    "pids": "0",
                    "name": "头像",
                    "dirname": "touxiang",
                    "pdirname": "",
                    "child": 1,
                    "childids": "1,4,5,6,7,8,12,14,18,19,20",
                    "thumb": "5358",
                    "show": "1",
                    "setting": {
                        "linkurl": "",
                        "seo": {
                            "list_title": "头像大全_头像发布中心[第{page}页{join}]_{SITE_NAME}",
                            "list_keywords": "头像,女生头像高冷,情侣头像",
                            "list_description": "网的头像大全频道,您可以发布、寻找各种头像、情侣头像、女生头像等。"
                        },
                        "template": {
                            "pagesize": "10",
                            "mpagesize": "10",
                            "list": "list.html",
                            "category": "category.html",
                            "search": "search.html",
                            "show": "show.html"
                        },
                        "cat_field": null,
                        "html": 0,
                        "urlrule": 3
                    },
                    "displayorder": "0",
                    "mid": "p",
                    "topid": "1",
                    "domain": "",
                    "mobile_domain": "",
                    "catids": [
                        "1",
                        "4",
                        "5",
                        "6",
                        "7",
                        "8",
                        "12",
                        "14",
                        "18",
                        "19",
                        "20"
                    ],
                    "tid": 1,
                    "permission": "",
                    "url": "/p/touxiang.html",
                    "total": 591,
                    "field": [
                        
                    ]
                },
                "2": {
                    "id": "2",
                    "pid": "0",
                    "pids": "0",
                    "name": "卡通图",
                    "dirname": "bizhi",
                    "pdirname": "",
                    "child": 1,
                    "childids": "2,9,10,34",
                    "thumb": "5359",
                    "show": "1",
                    "setting": {
                        "linkurl": "",
                        "seo": {
                            "list_title": "壁纸大全_高清动漫壁纸发布中心[第{page}页{join}]_{SITE_NAME}",
                            "list_keywords": "壁纸,高清动漫壁纸,动漫壁纸",
                            "list_description": "网的壁纸大全频道,您可以发布、寻找各种壁纸、高清动漫壁纸、动漫壁纸等。"
                        },
                        "template": {
                            "pagesize": "10",
                            "mpagesize": "10",
                            "list": "list.html",
                            "category": "category.html",
                            "search": "search.html",
                            "show": "show.html"
                        },
                        "cat_field": null,
                        "html": 0,
                        "urlrule": 3
                    },
                    "displayorder": "0",
                    "mid": "p",
                    "topid": "2",
                    "domain": "",
                    "mobile_domain": "",
                    "catids": [
                        "2",
                        "9",
                        "10",
                        "34"
                    ],
                    "tid": 1,
                    "permission": "",
                    "url": "/p/bizhi.html",
                    "total": 116,
                    "field": [
                        
                    ]
                },
                "3": {
                    "id": "3",
                    "pid": "0",
                    "pids": "0",
                    "name": "图片",
                    "dirname": "tupian",
                    "pdirname": "",
                    "child": 1,
                    "childids": "3,35,36,37,38,39,40",
                    "thumb": "5360",
                    "show": "1",
                    "setting": {
                        "linkurl": "",
                        "seo": {
                            "list_title": "图片大全_高清人物图片发布中心[第{page}页{join}]_{SITE_NAME}",
                            "list_keywords": "图片,人物图片,高清动漫图片",
                            "list_description": "网的图片大全频道,您可以发布、寻找各种图片、人物图片、高清动漫图片等。"
                        },
                        "template": {
                            "pagesize": "10",
                            "mpagesize": "10",
                            "list": "list.html",
                            "category": "category.html",
                            "search": "search.html",
                            "show": "show.html"
                        },
                        "cat_field": null,
                        "html": 0,
                        "urlrule": 3
                    },
                    "displayorder": "0",
                    "mid": "p",
                    "topid": "3",
                    "domain": "",
                    "mobile_domain": "",
                    "catids": [
                        "3",
                        "35",
                        "36",
                        "37",
                        "38",
                        "39",
                        "40"
                    ],
                    "tid": 1,
                    "permission": "",
                    "url": "/p/tupian.html",
                    "total": 164,
                    "field": [
                        
                    ]
                },
                "4": {
                    "id": "4",
                    "pid": "1",
                    "pids": "0,1",
                    "name": "女生头像",
                    "dirname": "nstx",
                    "pdirname": "touxiang/",
                    "child": 0,
                    "childids": 4,
                    "thumb": "2745",
                    "show": "1",
                    "setting": {
                        "linkurl": "",
                        "seo": {
                            "list_title": "女生头像大全_少女头像发布中心[第{page}页{join}]_{SITE_NAME}",
                            "list_keywords": "女生头像,少女头像,闺蜜头像",
                            "list_description": "头像女大全频道,您可以发布、寻找各种女生头像、少女头像、闺蜜头像等。"
                        },
                        "template": {
                            "pagesize": "10",
                            "mpagesize": "10",
                            "list": "list.html",
                            "category": "category.html",
                            "search": "search.html",
                            "show": "show.html"
                        },
                        "cat_field": null,
                        "html": 0,
                        "urlrule": 3
                    },
                    "displayorder": "0",
                    "mid": "p",
                    "topid": "1",
                    "domain": "",
                    "mobile_domain": "",
                    "catids": [
                        "4"
                    ],
                    "tid": 1,
                    "permission": [
                        
                    ],
                    "url": "/p/nstx.html",
                    "total": 57,
                    "field": [
                        
                    ]
                },
                "5": {
                    "id": "5",
                    "pid": "1",
                    "pids": "0,1",
                    "name": "闺蜜头像",
                    "dirname": "gmtx",
                    "pdirname": "touxiang/",
                    "child": 0,
                    "childids": 5,
                    "thumb": "",
                    "show": "1",
                    "setting": {
                        "linkurl": "",
                        "seo": {
                            "list_title": "闺蜜头像大全_闺蜜头像发布中心[第{page}页{join}]_{SITE_NAME}",
                            "list_keywords": "闺蜜头像,闺蜜头像",
                            "list_description": "网的闺蜜头像大全频道,您可以发布、寻找各种闺蜜头像、闺蜜头像等。"
                        },
                        "template": {
                            "pagesize": "10",
                            "mpagesize": "10",
                            "list": "list.html",
                            "category": "category.html",
                            "search": "search.html",
                            "show": "show.html"
                        },
                        "cat_field": null,
                        "html": 0,
                        "urlrule": 3
                    },
                    "displayorder": "0",
                    "mid": "p",
                    "topid": "1",
                    "domain": "",
                    "mobile_domain": "",
                    "catids": [
                        "5"
                    ],
                    "tid": 1,
                    "permission": [
                        
                    ],
                    "url": "/p/gmtx.html",
                    "total": 27,
                    "field": [
                        
                    ]
                },
                "6": {
                    "id": "6",
                    "pid": "1",
                    "pids": "0,1",
                    "name": "情侣头像",
                    "dirname": "qltx",
                    "pdirname": "touxiang/",
                    "child": 0,
                    "childids": 6,
                    "thumb": "",
                    "show": "1",
                    "setting": {
                        "linkurl": "",
                        "seo": {
                            "list_title": "情侣头像大全_情侣头像发布中心[第{page}页{join}]_{STE_NAME}",
                            "list_keywords": "情侣头像,高清情侣头像",
                            "list_description": "网的情侣头像频道,您可以发布、寻找各种侣头像、情侣头像等。"
                        },
//投稿栏目获取,需要获取栏目id和栏目名称
public function my_post($data) {
    $rt = [];
    if ($data['category']) {
        foreach ($data['category'] as $t) {
            $rt[] = [
                
            'id' => $t['id'],// id号
               
            ];
        }
    }

    return $rt;
}



插件版权:官方插件
插件名称:api

回帖
  • 官方插件技术-大山
    #1楼    官方插件技术-大山
    2020-11-30 14:50:19
    Chrome 0
    请求URL发来看看
  • 华仔
    #2楼    华仔
    2020-11-30 15:09:55
    Chrome 0
    ********此内容仅楼主可见********
    官方插件技术-大山 这个
  • 华仔
    #3楼    华仔
    2020-11-30 15:28:17
    Chrome 0
    官方插件技术-大山 老大麻烦看下
  • 官方插件技术-大山
    #4楼    官方插件技术-大山
    2020-11-30 15:43:17
    Chrome 0
    public function my_post($data) {
        $rt = [];
        if (\Phpcmf\Service::C()->module['category']) {
            foreach (\Phpcmf\Service::C()->module as $t) {
                $rt[] = [
                    
                'id' => $t['id'],// id号
                   
                ];
            }
        }
    
        return $rt;
    }
  • 华仔
    #5楼    华仔
    2020-11-30 15:47:33
    Chrome 0
    官方插件技术-大山 测试啥也没返回呀
    ********此内容仅楼主可见********
  • 官方插件技术-大山
    #6楼    官方插件技术-大山
    2020-11-30 16:36:53
    Chrome 0
    public function my_post($data) {
        $rt = [];
        if (\Phpcmf\Service::C()->module['category']) {
            foreach (\Phpcmf\Service::C()->module['category'] as $t) {
                $rt[] = [
                    
                'id' => $t['id'],// id号
                   
                ];
            }
        }
    
        return $rt;
    }
    满意答案
  • 华仔
    #7楼    华仔
    2020-11-30 16:53:33
    Chrome 0
    @官方插件技术-大山:非常感谢!