应用插件 版主:官方插件技术组
回调方法自定义里面,单选按钮字段 Select 怎么获取名称
类型:迅睿CMS 更新时间:2020-06-01 17:11:21

请教一下,回调方法自定义里面,单选按钮字段 Select 怎么获取名称?

回调方法的定义https://www.xunruicms.com/doc/351.html

回帖
  • 官方实习技术
    #1楼    官方实习技术
    2020-06-01 16:50:09
    Chrome 0
    需要把请求接口的地址发一下
  • 草木人
    #2楼    草木人
    2020-06-01 16:51:50
    Chrome 0
    /index.php?appid=1&appsecret=xxxxx&s=news&c=show&id=9284需要提供appsecret吗?官方实习技术
  • 官方实习技术
    #3楼    官方实习技术
    2020-06-01 16:58:04
    Chrome 0
    /index.php?appid=1&appsecret=xxxxx&s=news&c=show&id=9284&&api_call_function=my_test
    public function my_test($data) {
        
        $select = dr_field_options(这里填写select字段的ID号);
        $select_name = $select[$data['select字段英文名称']];
        $rt = [
            'title' => $data['title'],
            'id' => $data['id'],
            'thumb' => dr_thumb($data['thumb'], 200, 200),
            'updatetime' => dr_date($data['_updatetime'], 'Y-m-d H:i:s'),
            'select_name' => $select_name,
        ];
        return $rt;
    }

    满意答案
  • 草木人
    #4楼    草木人
    2020-06-01 17:11:21
    Chrome 0
    @官方实习技术:谢谢,谢谢,谢谢,